My Own Mapserver: Unterschied zwischen den Versionen
Aus DL8RDS Wiki
Dl8rds (Diskussion | Beiträge) (→Get the Mapnik style) |
Dl8rds (Diskussion | Beiträge) (→Get the Mapnik style) |
||
Zeile 160: | Zeile 160: | ||
inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.shx | inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.shx | ||
root@mapserver:/home/dl8rds/src/mapnik-style# | root@mapserver:/home/dl8rds/src/mapnik-style# | ||
+ | </pre> | ||
+ | |||
+ | Now modify some mapnik definitions: | ||
+ | |||
+ | $ cd inc | ||
+ | $ cp fontset-settings.xml.inc.template fontset-settings.xml.inc | ||
+ | $ cp datasource-settings.xml.inc.template datasource-settings.xml.inc | ||
+ | $ cp settings.xml.inc.template settings.xml.inc | ||
+ | |||
+ | Modify the file '''settings.xml.inc''' like this: | ||
+ | |||
+ | <pre> | ||
+ | <!-- | ||
+ | Settings for symbols, the spatial reference of your postgis tables, coastline s$ | ||
+ | --> | ||
+ | |||
+ | <!-- use 'symbols' unless you have moved the symbols directory --> | ||
+ | <!ENTITY symbols "symbols"> | ||
+ | |||
+ | <!-- use the '&srs900913;' entity if you have called osm2pgsql without special $ | ||
+ | <!ENTITY osm2pgsql_projection "&srs900913;"> | ||
+ | |||
+ | <!-- used for 'node in way' ST_DWithin spatial operations --> | ||
+ | <!-- Use 0.1 (meters) when your database is in 900913 --> | ||
+ | <!-- Use 0.000001 (degrees) when your database is in 4326 --> | ||
+ | <!ENTITY dwithin_900913 "0.1"> | ||
+ | <!ENTITY dwithin_4326 "0.00001"> | ||
+ | <!ENTITY dwithin_node_way "&dwithin_900913;"> | ||
+ | |||
+ | <!-- use 'world_boundaries', which is the usual naming for the local folder the$ | ||
+ | <!ENTITY world_boundaries "/usr/local/share/world_boundaries"> | ||
+ | |||
+ | <!-- use 'planet_osm' unless you have customized your database table prefix usi$ | ||
+ | <!ENTITY prefix "planet_osm"> | ||
</pre> | </pre> | ||
Version vom 29. Dezember 2017, 05:07 Uhr
Inhaltsverzeichnis
1 Scope
We have a really great high performance computer at DB0HSR, and since we're going to do several geography based experiments with it, we need our own mapserver to display positions.
There are other mapservers in the HAMNET:
2 Implementation
I am replicating this report:
2.1 Preparations
$ sudo apt-get install libmapnik-dev mapnik-utils git subversion \ dh-autoreconf apache2-dev apache2 unzip postgis make cmake g++ \ libboost-dev libboost-system-dev libboost-filesystem-dev \ libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev \ lua5.2 liblua5.2-dev postgis imposm git postgresql postgresql-9.5-postgis-2.2 \ postgresql-9.5-postgis-scripts
2.2 Get the Mapnik style
$ mkdir ~/src $ cd ~/src
If behind a firewall, subversion will consider the file ~./subversion/servers. There check the settings:
http-proxy-host = (your proxy IP address) http-proxy-port = (your proxy portnumber)
Then check out the style:
$ svn co http://svn.openstreetmap.org/applications/rendering/mapnik mapnik-style $ cd ~/src/mapnik-style
If behind a firewall, wget will consider the environment variable http_proxy, in the format http://(proxy IP number):(proxy port number)
$ sudo ./get-coastlines.sh /usr/local/share
will do something like this:
root@mapserver:/home/dl8rds/src/mapnik-style# ./get-coastlines.sh /usr/local/share --2017-12-29 03:50:41-- http://tile.openstreetmap.org/world_boundaries-spherical.tgz Connecting to 44.225.41.33:8080... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz [following] --2017-12-29 03:50:41-- http://planet.openstreetmap.org/historical-shapefiles/world_boundaries-spherical.tgz Reusing existing connection to 44.225.41.33:8080. Proxy request sent, awaiting response... 200 OK Length: 52857349 (50M) [application/x-gzip] Saving to: ‘/usr/local/share/world_boundaries-spherical.tgz’ /usr/local/share/world_boundaries-spherical.tg 100%[==================================================================================================>] 50,41M 1,12MB/s in 44s 2017-12-29 03:51:25 (1,14 MB/s) - ‘/usr/local/share/world_boundaries-spherical.tgz’ saved [52857349/52857349] --2017-12-29 03:51:25-- http://tile.openstreetmap.org/processed_p.tar.bz2 Connecting to 44.225.41.33:8080... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: http://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2 [following] --2017-12-29 03:51:26-- http://planet.openstreetmap.org/historical-shapefiles/processed_p.tar.bz2 Reusing existing connection to 44.225.41.33:8080. Proxy request sent, awaiting response... 200 OK Length: 409468857 (390M) [application/x-bzip2] Saving to: ‘/usr/local/share/processed_p.tar.bz2’ /usr/local/share/processed_p.tar.bz2 100%[==================================================================================================>] 390,50M 1,16MB/s in 6m 21s 2017-12-29 03:57:47 (1,03 MB/s) - ‘/usr/local/share/processed_p.tar.bz2’ saved [409468857/409468857] --2017-12-29 03:57:47-- http://tile.openstreetmap.org/shoreline_300.tar.bz2 Connecting to 44.225.41.33:8080... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: http://planet.openstreetmap.org/historical-shapefiles/shoreline_300.tar.bz2 [following] --2017-12-29 03:57:47-- http://planet.openstreetmap.org/historical-shapefiles/shoreline_300.tar.bz2 Reusing existing connection to 44.225.41.33:8080. Proxy request sent, awaiting response... 200 OK Length: 43867136 (42M) [application/x-bzip2] Saving to: ‘/usr/local/share/shoreline_300.tar.bz2’ /usr/local/share/shoreline_300.tar.bz2 100%[==================================================================================================>] 41,83M 1,29MB/s in 34s 2017-12-29 03:58:21 (1,23 MB/s) - ‘/usr/local/share/shoreline_300.tar.bz2’ saved [43867136/43867136] --2017-12-29 03:58:21-- http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip Connecting to 44.225.41.33:8080... connected. Proxy request sent, awaiting response... 302 Moved Temporarily Location: http://naciscdn.org/naturalearth/10m/cultural/ne_10m_populated_places.zip [following] --2017-12-29 03:58:22-- http://naciscdn.org/naturalearth/10m/cultural/ne_10m_populated_places.zip Reusing existing connection to 44.225.41.33:8080. Proxy request sent, awaiting response... 200 OK Length: 2002618 (1,9M) [application/x-zip-compressed] Saving to: ‘/usr/local/share/ne_10m_populated_places.zip’ /usr/local/share/ne_10m_populated_places.zip 100%[==================================================================================================>] 1,91M 184KB/s in 11s 2017-12-29 03:58:34 (178 KB/s) - ‘/usr/local/share/ne_10m_populated_places.zip’ saved [2002618/2002618] --2017-12-29 03:58:34-- http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip Connecting to 44.225.41.33:8080... connected. Proxy request sent, awaiting response... 302 Moved Temporarily Location: http://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip [following] --2017-12-29 03:58:35-- http://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip Reusing existing connection to 44.225.41.33:8080. Proxy request sent, awaiting response... 200 OK Length: 45804 (45K) [application/x-zip-compressed] Saving to: ‘/usr/local/share/ne_110m_admin_0_boundary_lines_land.zip’ /usr/local/share/ne_110m_admin_0_boundary_line 100%[==================================================================================================>] 44,73K 68,1KB/s in 0,7s 2017-12-29 03:58:35 (68,1 KB/s) - ‘/usr/local/share/ne_110m_admin_0_boundary_lines_land.zip’ saved [45804/45804] world_boundaries/ world_boundaries/places.shx world_boundaries/world_boundaries_m.index world_boundaries/world_bnd_m.shx world_boundaries/builtup_area.shx world_boundaries/world_bnd_m.dbf world_boundaries/builtup_area.prj world_boundaries/places.shp world_boundaries/world_boundaries_m.shx world_boundaries/world_boundaries_m.shp world_boundaries/places.dbf world_boundaries/places.prj world_boundaries/builtup_area.dbf world_boundaries/world_bnd_m.shp world_boundaries/world_bnd_m.prj world_boundaries/world_boundaries_m.dbf world_boundaries/builtup_area.shp world_boundaries/world_boundaries_m.prj world_boundaries/world_bnd_m.index world_boundaries/builtup_area.index processed_p.dbf processed_p.index processed_p.shp processed_p.shx shoreline_300.dbf shoreline_300.index shoreline_300.shp shoreline_300.shx Archive: /usr/local/share/ne_10m_populated_places.zip inflating: /usr/local/share/world_boundaries/ne_10m_populated_places.README.html extracting: /usr/local/share/world_boundaries/ne_10m_populated_places.VERSION.txt extracting: /usr/local/share/world_boundaries/ne_10m_populated_places.cpg inflating: /usr/local/share/world_boundaries/ne_10m_populated_places.dbf inflating: /usr/local/share/world_boundaries/ne_10m_populated_places.prj inflating: /usr/local/share/world_boundaries/ne_10m_populated_places.shp inflating: /usr/local/share/world_boundaries/ne_10m_populated_places.shx Archive: /usr/local/share/ne_110m_admin_0_boundary_lines_land.zip inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.README.html extracting: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.VERSION.txt extracting: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.cpg inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.dbf inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.prj inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.shp inflating: /usr/local/share/world_boundaries/ne_110m_admin_0_boundary_lines_land.shx root@mapserver:/home/dl8rds/src/mapnik-style#
Now modify some mapnik definitions:
$ cd inc $ cp fontset-settings.xml.inc.template fontset-settings.xml.inc $ cp datasource-settings.xml.inc.template datasource-settings.xml.inc $ cp settings.xml.inc.template settings.xml.inc
Modify the file settings.xml.inc like this:
<!-- Settings for symbols, the spatial reference of your postgis tables, coastline s$ --> <!-- use 'symbols' unless you have moved the symbols directory --> <!ENTITY symbols "symbols"> <!-- use the '&srs900913;' entity if you have called osm2pgsql without special $ <!ENTITY osm2pgsql_projection "&srs900913;"> <!-- used for 'node in way' ST_DWithin spatial operations --> <!-- Use 0.1 (meters) when your database is in 900913 --> <!-- Use 0.000001 (degrees) when your database is in 4326 --> <!ENTITY dwithin_900913 "0.1"> <!ENTITY dwithin_4326 "0.00001"> <!ENTITY dwithin_node_way "&dwithin_900913;"> <!-- use 'world_boundaries', which is the usual naming for the local folder the$ <!ENTITY world_boundaries "/usr/local/share/world_boundaries"> <!-- use 'planet_osm' unless you have customized your database table prefix usi$ <!ENTITY prefix "planet_osm">