{"id":2326,"date":"2024-10-31T10:02:20","date_gmt":"2024-10-31T01:02:20","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=2326"},"modified":"2024-10-31T10:02:35","modified_gmt":"2024-10-31T01:02:35","slug":"%ec%a7%80%ec%98%a4%ec%bd%94%eb%94%a9%ec%9d%84-%ec%9c%84%ed%95%9c-nominatim-%ec%84%a4%ec%b9%98","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=2326","title":{"rendered":"\uc9c0\uc624\ucf54\ub529\uc744 \uc704\ud55c Nominatim  \uc124\uce58"},"content":{"rendered":"<p><b>I. \ubaa9\ud45c<\/b><\/p>\n<p>Nominatim\ub97c \uc774\uc6a9\ud558\uc5ec Geocoding\ubc0f\u00a0 Reverse Geocoding \ucc98\ub9ac\ub97c \ud574\ubcf8\ub2e4.<\/p>\n<p><b>II. \uc5f0\uad6c<\/b> <b>\ubc0f<\/b> <b>\uac1c\ubc1c\ub0b4\uc6a9<\/b><\/p>\n<p><strong><span style=\"font-size: 1rem;\">1. PHP \uc124\uce58<\/span><\/strong><\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">apt-get install php<\/p>\n<p>apt-get install libapache2-mod-php php-pgsql php-mysql<\/p>\n<p>apt-get\u00a0 install postgresql-server-dev-12<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>2. \uc0ac\uc6a9\uc790 \uacc4\uc815 \ucd94\uac00<\/strong><\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">adduser nominatim<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>3. POSTGRESSQL \ud29c\ub2dd<\/strong><\/p>\n<p>\/etc\/postgresql\/12\/main\/postgressql.conf<\/p>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>shared_buffers = 2GB<\/p>\n<p>maintenance_work_mem = 10GB<\/p>\n<p>autovacuum_work_mem = 2GB<\/p>\n<p>work_mem = 50MB<\/p>\n<p>effective_cache_size = 24GB<\/p>\n<p>synchronous_commit = off<\/p>\n<p>max_wal_size = 1GB<\/p>\n<p>checkpoint_timeout = 10min<\/p>\n<p>checkpoint_completion_target = 0.9<\/p>\n<p>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\ucc38\uace0) \ucc98\uc74c Import \ud560\ub54c\uc5d0\ub294\u00a0 \uc544\ub798 \uc0ac\ud56d\uc744 \ucd94\uac00, \uc784\ud3ec\ud2b8\uac00 \ub05d\ub098\uba74 \uc544\ub798 \uc0ac\ud56d\uc744 \uc81c\uac70<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>fsync = off<\/p>\n<p>full_page_writes = off<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>4. POSTGRES \uc0ac\uc6a9\uc790 \ucd94\uac00<\/strong><\/p>\n<p>1) nominatim: \u00a0\uc784\ud3ec\ud2b8\uc6a9<\/p>\n<p>2) www-data :\u00a0 \uc6f9\uc11c\ubc84 \uc561\uc138\uc2a4\uc6a9(\uc77d\uae30\uc804\uc6a9)<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>sudo -u postgres createuser -s nominatim<\/p>\n<p>sudo -u postgres createuser www-data<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>5. Nominatim \ube4c\ub4dc<\/strong><\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td><b>nominatim@moram-linux<\/b>:<b>~<\/b>$ mkdir Service<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~<\/b>$ mkdir .\/Service\/Nominatim<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~<\/b>$ cd .\/Service\/Nominatim\/<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim<\/b>$ wget <a href=\"https:\/\/nominatim.org\/release\/Nominatim-4.0.1.tar.bz2\">https:\/\/nominatim.org\/release\/Nominatim-4.0.1.tar.bz2<\/a><\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim<\/b>$ tar xf Nominatim-4.0.1.tar.bz2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim<\/b>$ mkdir .\/build<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim<\/b>$ cd .\/build<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim\/build<\/b>$ cmake ..\/Nominatim-4.0.1<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim\/build<\/b>$ make<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/Nominatim\/build<\/b>$ sudo make install (\ub610\ub294 root\ub85c \ub85c\uadf8\uc778\ud558\uc5ec make install)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><strong>6. \uc6f9\uc11c\ubc84 \uc124\uc815<\/strong><\/p>\n<p>1) \uc11c\ube44\uc2a4 \ub514\ub809\ud1a0\ub9ac \uc0dd\uc131<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><b>geocode@moram-linux<\/b>:<b>~<\/b>$ mkdir Service\/GeocodeWebSolution<\/p>\n<p><b>geocode@moram-linux<\/b>:<b>~<\/b>$ mkdir Service\/GeocodeWebSolution\/geocode-web<\/p>\n<p><b>geocode@moram-linux<\/b>:<b>~<\/b>$<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>2) \uc544\ud30c\uce58 \ud658\uacbd\uc124\uc815<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>cd \/etc\/apache2\/sites-available\/<\/p>\n<p>vi geocode.mbizok.com.conf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\">&lt;VirtualHost *:80&gt;<\/p>\n<p>ServerAdmin admin@moramcnt.com<\/p>\n<p>DocumentRoot \/home\/geocode\/Service\/GeocodeWebSolution\/geocode-web<\/p>\n<p>DirectoryIndex index.php<\/p>\n<p>ServerName geocode.mbizok.com<\/p>\n<p>&lt;Directory \/home\/geocode\/Service\/GeocodeWebSolution\/geocode-web&gt;<\/p>\n<p>Options FollowSymLinks MultiViews<\/p>\n<p>AddType application\/json\u00a0\u00a0 .php<\/p>\n<p>DirectoryIndex search.php<\/p>\n<p>Require all granted<\/p>\n<p>&lt;\/Directory&gt;<\/p>\n<p>Alias \/nominatim \/home\/geocode\/Service\/GeocodeWebSolution\/geocode-web<\/p>\n<p>LogLevel warn<\/p>\n<p>ErrorLog \/var\/log\/apache2\/error-geocode.mbizok.com.log<\/p>\n<p>CustomLog \/var\/log\/apache2\/access-geocode.mbizok.com.log combined<\/p>\n<p>&lt;\/VirtualHost&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>a2ensite geocode.mbizok.com.conf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>service apache2 restart<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>3) Nomination\uc124\uc815<\/p>\n<p>\/usr\/local\/etc\/nominatim\/.env \ud30c\uc77c \uc0dd\uc131<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr style=\"height: 509px;\">\n<td style=\"width: 100%; height: 509px;\">NOMINATIM_FLATNODE_FILE=&#8221;\/usr\/local\/etc\/nominatim&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p># base URL of the replication service<\/p>\n<p>NOMINATIM_REPLICATION_URL=&#8221;https:\/\/download.geofabrik.de\/asia\/south-korea-updates\/&#8221;<\/p>\n<p># How often upstream publishes diffs (in seconds)<\/p>\n<p>NOMINATIM_REPLICATION_UPDATE_INTERVAL=86400<\/p>\n<p># How long to sleep if no update found yet (in seconds)<\/p>\n<p>NOMINATIM_REPLICATION_RECHECK_INTERVAL=900<\/p>\n<p>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>7. \ub370\uc774\ud130 \uc784\ud3ec\ud2b8<\/strong><\/p>\n<p>1) Wikipedia\/Wikidata \uc21c\uc704 : \uc57d 400\uba54\uac00\ub85c, Nominatim \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc57d 4GB\ub97c \ucd94\uac00<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>mkdir .\/Serivce\/GeocodeWebSolution\/data<\/p>\n<p>cd .\/Service\/GeocodeWebSolution\/data<\/p>\n<p>wget <a href=\"https:\/\/www.nominatim.org\/data\/wikimedia-importance.sql.gz\">https:\/\/www.nominatim.org\/data\/wikimedia-importance.sql.gz<\/a><\/p>\n<p>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2) \uc9c0\ub3c4\ub370\uc774\ud130<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>wget <a href=\"https:\/\/download.geofabrik.de\/asia\/south-korea-latest.osm.pbf\">https:\/\/download.geofabrik.de\/asia\/south-korea-latest.osm.pbf<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>3) Import<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>nominatim import &#8211;osm-file south-korea-latest.osm.pbf 2&gt;&amp;1 | tee setup.log<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\uba87\uc2dc\uac04\ub3d9\uc548 \ucc98\ub9ac\ud560\uc218 \uc788\uc73c\uba70 \ucc98\ub9ac\uc644\ub8cc\uc2dc .\/website \ub77c\ub294 \ud3f4\ub354\uc0dd\uc131<\/p>\n<p>&nbsp;<\/p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>&nbsp;<\/p>\n<p>2023-06-05 19:37:57: Starting indexing postcodes using 24 threads<\/p>\n<p>2023-06-05 19:37:57: Starting postcodes (location_postcode) (using batch size 20)<\/p>\n<p>2023-06-05 19:37:59: Done 4880 in 2 @ 2401.034 per second &#8211; postcodes (location_postcode) ETA (seconds): 3.52<\/p>\n<p>2023-06-05 19:38:02: Done 7280 in 5 @ 1444.560 per second &#8211; postcodes (location_postcode) ETA (seconds): 4.19<\/p>\n<p>2023-06-05 19:38:05: Done 8720 in 7 @ 1120.482 per second &#8211; postcodes (location_postcode) ETA (seconds): 4.12<\/p>\n<p>2023-06-05 19:38:08: Done 9840 in 11 @ 886.524 per second &#8211; postcodes (location_postcode) ETA (seconds): 3.95<\/p>\n<p>2023-06-05 19:38:10: Done 10740 in 12 @ 850.881 per second &#8211; postcodes (location_postcode) ETA (seconds): 3.05<\/p>\n<p>2023-06-05 19:38:11: Done 11580 in 13 @ 871.244 per second &#8211; postcodes (location_postcode) ETA (seconds): 2.02<\/p>\n<p>2023-06-05 19:38:12: Done 12460 in 14 @ 854.248 per second &#8211; postcodes (location_postcode) ETA (seconds): 1.03<\/p>\n<p>2023-06-05 19:38:14: Done 13300 in 16 @ 796.466 per second &#8211; postcodes (location_postcode) ETA (seconds): 0.05<\/p>\n<p>2023-06-05 19:38:15: Done 13338\/13338 in 17 @ 769.445 per second &#8211; FINISHED postcodes (location_postcode)<\/p>\n<p>&nbsp;<\/p>\n<p>2023-06-05 19:39:39: Post-process tables<\/p>\n<p>2023-06-05 19:41:24: Create search index for default country names.<\/p>\n<p>2023-06-05 19:41:31: Recompute word counts<\/p>\n<p>2023-06-05 19:47:07: Setup website at \/home\/nominatim\/Service\/GeocodeWebSolution\/data\/website<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><b>nominatim@moram-linux<\/b>:<b>~\/Service\/GeocodeWebSolution\/data<\/b>$<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; border-color: #eeeeew; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>nominatim refresh &#8211;website<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I. \ubaa9\ud45c Nominatim\ub97c \uc774\uc6a9\ud558\uc5ec Geocoding\ubc0f\u00a0 Reverse Geocoding \ucc98\ub9ac\ub97c \ud574\ubcf8\ub2e4. II. \uc5f0\uad6c \ubc0f \uac1c\ubc1c\ub0b4\uc6a9 1. PHP \uc124\uce58 apt-get install php apt-get install libapache2-mod-php php-pgsql php-mysql apt-get\u00a0 install postgresql-server-dev-12 2. \uc0ac\uc6a9\uc790 \uacc4\uc815 \ucd94\uac00 adduser nominatim 3. POSTGRESSQL \ud29c\ub2dd \/etc\/postgresql\/12\/main\/postgressql.conf &nbsp; shared_buffers = 2GB maintenance_work_mem = 10GB autovacuum_work_mem = 2GB work_mem = 50MB effective_cache_size = 24GB synchronous_commit = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[5,2],"tags":[278,277],"class_list":["post-2326","post","type-post","status-publish","format-standard","hentry","category-gis","category-2","tag-geocoding","tag-nominatim"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2326"}],"version-history":[{"count":4,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2326\/revisions"}],"predecessor-version":[{"id":2330,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2326\/revisions\/2330"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2326"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}