User:Ngt

From OpenStreetMap Wiki
Jump to: navigation, search


About Me
OSM Logo This user submits data to OpenStreetMap under the name ngt.
JOSM Ngt submits data to OpenStreetMap using JOSM.
de Dieser Benutzer spricht Deutsch als Muttersprache.
en-3 This user is able to contribute with an advanced level of English.
Flag of Germany.svg Ngt has mapped in Germany.
Flag of Nepal.svg Ngt has mapped in Nepal.
Flag of the United States.svg Ngt has mapped in the United States

Aktiv in

Nepal

Schönbuchlichtung
Holzgerlingen
Altdorf
Hildrizhausen
Weil im Schönbuch

United States
South Dakota

Proposals for improvements regarding HOT response in the future

 HOT
 - provide more help in the languages of the main contributing countries
 
 HOT Task Manager
 - Unique Names for Tasks and Worksets. #1033-25 would be called "Workset 1033 Task 25"
 - List of tasks you completed, validated, contributed to
 - Follow one or more users (e.g. to help beginners)
 - Instructions of tasks translated according to selected language
 
 Tagging
 - KISS: Keep it simple, stupid. For beginners there should be only a few tags to learn:
   Road, path, building=yes
 - Unique Tags for HOT that can easily be found and remembered: e.g. hot:landuse=brownfield or hot:damage=*
   These Tags are always the same for desasters. This means, we can have ready-to-use Styles in iD and JOSM as well as a ready-to-use Carto for the first -crucial- hours.
 - No need to use misleading tags or tags having a different meaning in OSM

 JOSM
 - There is a problem using charsets. In the comment on a Task a # is changed to %23.
 - A Style for HOT-Events would be nice. E.g. nice colors for IDP-sites...
 
 technical things
 - A server containing a live planet dump wich can create offline-maps for gps-devices and mobile phones with a HOT-Style for a specified region. Job can be created by HOT staff/board members. This server provides maps not older than 30min and is a central Link to all rescue organisations - especially before their departure

Webseiten

(DE)Ubuntuusers:Lm_sensors
(DE)Ubuntuusers:Munin
(EN)Wiki:Nominatim/Installation
(DE)Offline Tile & Nominatim server by Chrisoph Ziehr
mod_tile config & troubleshooting
Nominatim install script

Serverconfig

 OS:        Ubuntu Server 14.04.1 LTS
 CPU:       Intel Core i7-4790K 4.0 GHz Quad-Core
 RAM:       32 GB (4x8GB) Corsair DDR3-1600
 Mainboard: MSI Z97 GAMING 3
 Storage:   1TB SATA-600 Western Digital Red WD10EFRX /system && /osm
            1TB SATA-600 Western Digital Red WD10EFRX /database
            2TB SATA-600 Western Digital Red WD20EFRX /tiles
 scripts & bin: /osm
 planetfile:      /osm/planet/baden-wuerttemberg.osm.pbf
 datenbank:       /database
 tiles:           /tiles
 nominatim:       /osm/Nominatim
 #style:

!! WARNING: scripts ARE incomplete and not tested at all !!

Setup Script for PGSql 9.3, Nominatim, Mapnik, osm-carto, mod_tile

 #!/bin/bash
 
 echo "This will install Nominatim, osm2pgsql, mod_tile, apache2 with php5, postgresql 9.3, postgis 2.1, osm-carto style and munin"
 echo "This install will require up to 1.5 GB free disk space"
 read -p "Continue:" goon
 
 sudo mkdir /osm
 sudo chown -R $USER /osm
 mkdir /osm/files
 mkdir /osm/planet
 mkdir /osm/shapefiles
 
 sudo mkdir -m 755 /tiles
 sudo chown -R $USER /tiles
 
 sudo mkdir /var/run/renderd
 sudo chown $USER /var/run/renderd
 sudo mkdir /var/lib/mod_tile
 sudo chown $USER /var/lib/mod_tile
 
 sudo apt-get update
 sudo apt-get -y upgrade
 sudo apt-get --no-install-recommends -y install libboost-all-dev subversion git vim tar unzip wget bzip2 build-essential autoconf automake gcc
 sudo apt-get --no-install-recommends -y install node-carto proj-bin libgeos++-dev libpq-dev libbz2-dev libproj-dev libprotobuf-c0-dev protobuf-c-compiler
 sudo apt-get --no-install-recommends -y install libpng12-dev libtiff4-dev libicu-dev libgdal-dev libcairo-dev libcairomm-1.0-dev libagg-dev liblua5.2-dev
 sudo apt-get --no-install-recommends -y install ttf-unifont lua5.1 liblua5.1-dev libgeos-c1 python-software-properties libtool libxml2-dev libgeos-dev
 sudo apt-get --no-install-recommends -y install postgresql postgresql-contrib postgis postgresql-9.3-postgis-2.1 postgresql-server-dev-9.3 libfreetype6-dev
 sudo apt-get --no-install-recommends -y install libboost-regex-dev libboost-system-dev libboost-thread-dev apache2-mpm-prefork lm-sensors
 sudo apt-get --no-install-recommends -y install apache2 apache2-dev apache2-utils libwww-perl libdbd-pg-perl php5 php-pear php5-pgsql php5-json php-db
 sudo apt-get --no-install-recommends -y install munin munin-node munin-plugins-extra
 
 if [ ! -d "/var/www" ]; then
   	sudo mkdir /var/www
 fi
 sudo mkdir -m 755 /var/www/nominatim
 sudo chown $USER /var/www/nominatim
 
 sudo mkdir /database
 sudo mkdir /database/data
 sudo chown -R postgres /database
 
 #Drop default cluster
 sudo -u postgres pg_dropcluster --stop 9.3 main
 sudo -u postgres pg_createcluster -d /database/data 9.3 osmcluster
 sudo service postgresql start
 sudo -u postgres createuser -s $USER
 sudo -u postgres createuser -SDR www-data
 
 psql -d gis -c "CREATE EXTENSION postgis;"
 psql -d gis -c "GRANT SELECT ON spatial_ref_sys TO PUBLIC;"
 psql -d gis -c "GRANT ALL ON geometry_columns TO $USER;"
 psql -d gis -c "ALTER TABLE spatial_ref_sys OWNER TO $USER;"
 psql -d gis -c "ALTER TABLE geometry_columns OWNER TO $USER;"
 
 cd /osm
 git clone git://github.com/mapnik/mapnik
 cd mapnik
 git branch 2.2 origin/2.2.x
 git checkout 2.2
 python scons/scons.py configure INPUT_PLUGINS=all OPTIMIZATION=3 SYSTEM_FONTS=/usr/share/fonts/truetype/
 make
 sudo make install
 sudo ldconfig
 
 cd /osm
 git clone git://github.com/openstreetmap/mod_tile.git
 cd mod_tile
 ./autogen.sh
 ./configure
 make
 sudo make install
 sudo make install-mod_tile
 sudo ldconfig
 
 sudo touch /etc/apache2/conf-available/mod_tile.conf
 sudo chmod 777 /etc/apache2/conf-available/mod_tile.conf
 echo "LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so" >> /etc/apache2/conf-available/mod_tile.conf
 
 cd /osm
 git clone --recursive git://github.com/twain47/Nominatim.git
 cd Nominatim
 ./autogen.sh
 ./configure
 make
 
 cd /osm
 git clone https://github.com/gravitystorm/openstreetmap-carto.git
 
 #Create copy of Nomintatim to allow an import to a seperate import-table to allow a full reimport and operation at the same time
 mkdir /osm/Nominatim-import  
 mv /osm/Nominatim/* /osm/Nominatim-import
 touch /osm/Nominatim-import/settings/local.php
 echo "<?php" >> /osm/Nominatim/settings/local.php
 echo "@define('CONST_Postgresql_Version', '9.3');" >> /osm/Nominatim-import/settings/local.php
 echo "@define('CONST_Postgis_Version', '2.1');" >> /osm/Nominatim-import/settings/local.php
 echo "@define('CONST_Database_DSN', 'pgsql://@/nominatim_new');" >> /osm/Nominatim-import/settings/local.php
 echo "?>" >> /osm/Nominatim-import/settings/local.php
 
 touch /osm/Nominatim/settings/local.php
 echo "<?php" >> /osm/Nominatim/settings/local.php
 echo "@define('CONST_Postgresql_Version', '9.3');" >> /osm/Nominatim/settings/local.php
 echo "@define('CONST_Postgis_Version', '2.1');" >> /osm/Nominatim/settings/local.php
 echo "@define('CONST_Website_BaseURL', 'http://localhost/nominatim/');" >> /osm/Nominatim/settings/local.php
 echo "?>" >> /osm/Nominatim/settings/local.php
 
 /osm/Nominatim/utils/setup.php --create-website /var/www/nominatim
 
 #nominatim plugins
 sudo ln -s /osm/Nominatim/munin/nominatim_query_speed /etc/munin/plugins
 sudo ln -s /osm/Nominatim/munin/nominatim_importlag /etc/munin/plugins
 sudo ln -s /osm/Nominatim/munin/nominatim_requests /etc/munin/plugins
 #postgres plugins
 sudo ln -s /usr/share/munin/plugins/postgres_bgwriter /etc/munin/plugins/
 sudo ln -s /usr/share/munin/plugins/postgres_cache_ /etc/munin/plugins/postgres_cache_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_cache_ /etc/munin/plugins/postgres_cache_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_cache_ /etc/munin/plugins/postgres_cache_gis
 sudo ln -s /usr/share/munin/plugins/postgres_cache_ /etc/munin/plugins/postgres_cache_gis_new
 sudo ln -s /usr/share/munin/plugins/postgres_checkpoints /etc/munin/plugins/
 sudo ln -s /usr/share/munin/plugins/postgres_connections_ /etc/munin/plugins/postgres_connections_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_connections_ /etc/munin/plugins/postgres_connections_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_connections_ /etc/munin/plugins/postgres_connections_gis
 sudo ln -s /usr/share/munin/plugins/postgres_connections_db /etc/munin/plugins/
 sudo ln -s /usr/share/munin/plugins/postgres_size_ /etc/munin/plugins/postgres_size_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_size_ /etc/munin/plugins/postgres_size_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_size_ /etc/munin/plugins/postgres_size_gis
 sudo ln -s /usr/share/munin/plugins/postgres_size_ /etc/munin/plugins/postgres_size_gis_new
 sudo ln -s /usr/share/munin/plugins/postgres_querylength_ /etc/munin/plugins/postgres_querylength_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_querylength_ /etc/munin/plugins/postgres_querylength_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_querylength_ /etc/munin/plugins/postgres_querylength_gis
 sudo ln -s /usr/share/munin/plugins/postgres_scans_ /etc/munin/plugins/postgres_scans_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_scans_ /etc/munin/plugins/postgres_scans_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_scans_ /etc/munin/plugins/postgres_scans_gis
 sudo ln -s /usr/share/munin/plugins/postgres_tuples_ /etc/munin/plugins/postgres_tuples_nominatim
 sudo ln -s /usr/share/munin/plugins/postgres_tuples_ /etc/munin/plugins/postgres_tuples_nominatim_new
 sudo ln -s /usr/share/munin/plugins/postgres_tuples_ /etc/munin/plugins/postgres_tuples_gis
 #apache plugins
 sudo ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/
 sudo ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/
 sudo ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/
 #mod_tile plugins
 sudo ln -s /osm/mod_tile/munin/* /etc/munin/plugins/
 sudo chmod a+x /osm/mod_tile/munin/*
 #sensors
 sudo ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_fan
 sudo ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_volt
 sudo ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_temp
 
 sudo touch /etc/munin/plugin-conf.d/munin-node
 sudo chmod 755 /etc/munin/plugin-conf.d/munin-node
 echo "" >> /etc/munin/plugin-conf.d/munin-node
 echo "[postgres_*]" >> /etc/munin/plugin-conf.d/munin-node
 echo "user postgres" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.PGUSER postgres" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.PGPORT 5432" >> /etc/munin/plugin-conf.d/munin-node
 echo "" >> /etc/munin/plugin-conf.d/munin-node
 echo "[nominatim_*]" >> /etc/munin/plugin-conf.d/munin-node
 echo "user www-data" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.PGUSER www-data" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.PGPORT 5432" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.PGDATABASE nominatim" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.age_warning 21600" >> /etc/munin/plugin-conf.d/munin-node
 echo "env.age_critical 86400" >> /etc/munin/plugin-conf.d/munin-node
 
 sudo ln -s /var/cache/munin/www/ /var/www/munin
 
 sudo touch /etc/apache2/sites-available/munin.conf
 sudo chmod 755 /etc/apache2/sites-available/munin.conf
 echo "" >> /etc/apache2/sites-available/munin.conf
 echo ' Alias /munin/ "/var/www/munin/"' >> /etc/apache2/sites-available/munin.conf
 echo '   <Directory "/var/www/munin/">' >> /etc/apache2/sites-available/munin.conf
 echo '       Options Indexes MultiViews FollowSymLinks' >> /etc/apache2/sites-available/munin.conf
 echo '       AllowOverride None' >> /etc/apache2/sites-available/munin.conf
 echo '       Order deny,allow' >> /etc/apache2/sites-available/munin.conf
 echo '       Allow from all' >> /etc/apache2/sites-available/munin.conf
 echo '       Require all granted' >> /etc/apache2/sites-available/munin.conf
 echo '   </Directory>' >> /etc/apache2/sites-available/munin.conf
 
 sudo sed -i "s|Allow from.*|Allow from all|" /etc/munin/apache.conf
 
 sudo service munin-node restart
 sudo service apache2 reload
 
 echo "Setup complete!"
 proj
 psql --version
 grep 'default_version' '/usr/share/postgresql/9.3/extension/postgis.control'
 geos-config --version
 osm2pgsql --version
 osmconvert -h | head -n2
 echo " "
 echo "Important Folders:"
 echo "/osm            All OSM-Related programs and files"
 echo "/osm/log		  Logfiles für setup and imports"
 echo "/database       All "
 echo "/osm/nominatim"
 echo "/osm/planet     Exported .osm.pbf file"
 echo "/osm/files      Additional Files"
 echo "/osm/style      Style mapnik will use"
 echo "/osm/shapefiles Shapefiles"
 
 wget -N -O /osm/planet/baden-wuerttemberg-latest.osm.pbf http://download.geofabrik.de/europe/germany/baden-wuerttemberg-latest.osm.pbf
 wget -N -O /osm/files/simplified-land-polygons-complete-3857.zip http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip
 wget -N -O /osm/files/land-polygons-split-3857.zip http://data.openstreetmapdata.com/land-polygons-split-3857.zip
 wget -N -O /osm/files/ne_10m_populated_places_simple.zip http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places_simple.zip
 sudo unzip /osm/files/simplified-land-polygons-complete-3857.zip  -d /osm/shapefiles
 sudo unzip /osm/files/land-polygons-split-3857.zip  -d /osm/shapefiles
 sudo unzip /osm/files/ne_10m_populated_places_simple.zip  -d /osm/shapefiles

osm-update.sh

 #!/bin/bash
 
 #wget -N -O /osm/planet/baden-wuerttemberg-latest.osm.pbf http://downloads.geofabrik.de/europe/germany/baden-wuerttemberg-latest.osm.pbf
 #wget -N -O /osm/Nominatim-import/data/wikipedia_article.sql.bin http://www.nominatim.org/data/wikipedia_article.sql.bin
 #wget -N -O /osm/Nominatim-import/data/wikipedia_redirect.sql.bin http://www.nominatim.org/data/wikipedia_redirect.sql.bin
 
 dropdb gis_new
 createdb gis_new
 psql -d gis_new -c "CREATE EXTENSION postgis;"
 psql -d gis_new -c "GRANT SELECT ON spatial_ref_sys TO PUBLIC;"
 psql -d gis_new -c "GRANT ALL ON geometry_columns TO $USER;"
 psql -d gis_new -c "ALTER TABLE spatial_ref_sys OWNER TO $USER;"
 psql -d gis_new -c "ALTER TABLE geometry_columns OWNER TO $USER;"
 
 osm2pgsql --create --slim -d gis_new --cache 8000 --number-processes 6 --style /osm/openstreetmap-carto/openstreetmap-carto.style --multi-geometry /osm/planet/baden-wuerttemberg-latest.osm.pbf
 psql postgres -c "SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname='gis';ALTER DATABASE gis RENAME TO gis_old;"
 psql postgres -c "ALTER DATABASE gis_new RENAME TO gis;"
 
 
 dropdb nominatim_new
 /osm/Nominatim-import/utils/specialphrases.php --countries > /osm/files/specialphrases_countries.sql
 /osm/Nominatim-import/utils/specialphrases.php --wiki-import > /osm/files/specialphrases.sql
 /osm/Nominatim-import/utils/setup.php --osm-file /osm/planet/baden-wuerttemberg-latest.osm.pbf --all --osm2pgsql-cache 8000 --threads 4 2>&1 | tee /osm/log/`date +"$Y%m%d"`nominatim_import.log
 psql -d nominatim_new -f /osm/files/specialphrases.sql
 psql -d nominatim_new -f /osm/files/specialphrases_countries.sql
 dropdb nominatim_old
 psql postgres -c "SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE datname='nominatim';ALTER DATABASE nominatim RENAME TO nominatim_old;"
psql postgres -c "ALTER DATABASE nominatim_new RENAME TO nominatim;"
Retrieved from "http://wiki.openstreetmap.org/w/index.php?title=User:Ngt&oldid=1179713"