Name: meddo
Owner: kartotherian
Description: null
Created: 2016-11-22 04:46:56.0
Updated: 2018-05-16 19:20:53.0
Pushed: 2018-05-16 19:20:58.0
Homepage: null
Size: 148
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Data source for Wikipedia maps from OSM data
This style requires an osm2pgsql database loaded with https://github.com/ClearTables/ClearTables and ocean data.
See the ClearTables documentation for details and load into the database ct
, with the command-line option -G
clone -b v0.1.0 git://github.com/ClearTables/ClearTables.git
d ClearTables
tedb ct
-d ct -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore; CREATE EXTENSION unaccent; CREATE EXTENSION fuzzystrmatch;'
# Create cleartables files
sql/types/*.sql | psql -1Xq -d ct # Load SQL types
pgsql -E 3857 -G -d ct --number-processes 2 --output multi --style cleartables.json ~/path/to/extract # Load OSM data
sql/post/*.sql | psql -1Xq -d ct # Add post-import SQL
Other osm2pgsql flags for performance or updates can be added, and will be necessary for large imports. See the osm2pgsql documentation for more details. Flags that might be needed include
--slim
--cache
--flat-nodes
Slim mode is not required by this style, so --slim --drop
can be safely used if updates are not required.
If PostgreSQL max_connections
is increased from the default, --number-processes
can be increased. If --number-processes
is omitted, osm2pgsql will
attempt to use as many processes as hardware threads. osm2pgsql will need aproximatelly number-processes * (number rendering tables + 3)
, Where the number of rendering tables is ~42.
Meddo uses data from OSMCoastline, hosted on OpenStreetMapData, and from Natural Earth. The data used is documented in full in external-data.yml
-d ct -c 'CREATE SCHEMA loading;'
t-external-data.py
get-external-data.py
should be re-run periodically, and the command options can be obtained with ./get-external-data.py -h
Meddo uses data generated by OSMBorder for administrative boundaries.
Generate the borders with OSMBorder then run the SQL
TE TABLE osmborder_lines (
m_id bigint,
min_level int,
viding_line bool,
sputed bool,
ritime bool,
y Geometry(LineString, 3857));
y osmborder_lines FROM osmborder_lines.csv
TE INDEX osmborder_lines_way_idx ON osmborder_lines USING gist (way) WITH (fillfactor=100);
TER osmborder_lines USING osmborder_lines_way_idx;
TE INDEX osmborder_lines_way_low_idx ON osmborder_lines USING gist (way) WITH (fillfactor=100) WHERE admin_level <= 4;
Meddo requires some standard stylesheet-independent functions
-d ct -f functions.sql
A suitable design program like Kosmtik or Mapbox Studio Classic is needed. If Kosmtik is installed, kosmtik serve data.yml
will start Kosmtik, and the Data Inspector can be used. For Mapbox Studio, the entire repository is a tm2source project.
It might be necessary to compile the project to Mapnik XML for production, which can be done in many ways. One way is kosmtik export data.yml --format xml --output meddo.xml
TBD.
Meddo is a type of Polynesian stick chart which contains only a section of the island chain, and meddo creates vector tiles from a larger database. It's also based on the same language as “wiki”.
The code is licensed under the MIT License. If used as directed, use ODbL licensed OpenStreetMap data.