acalcutt / wdb-map-gen

OpenMapTiles basemap generation for WifiDB.net
Other
5 stars 0 forks source link

urban area polygons #5

Open wendellwt opened 2 years ago

wendellwt commented 2 years ago

I (finally!) created my own map using the instructions you provided (but using pg_tileserv as the server). In displaying the data, it seems that the ne_10m_urban_areas_landscan dataset contains extra polygons within some of the city boundaries as shown here: chicago polygons

Why is that? Are there selectors either in the database population step or the tile retrieval step that could be used to eliminate the extra polygons? When the urban areas are displayed with a semi-transparent style it makes the urban areas look confusing.

Thank you, Wendell

acalcutt commented 2 years ago

This is part of load_naturalearth.sh, which I based on an old obsoleted openmaptiles docker image here ( https://github.com/openmaptiles/import-natural-earth )

The original for this downloaded an sqlite file from natural earth, then deleted some tables(like that 'ne_10m_urban_areas_landscan' you mentioned), with this script ( https://github.com/openmaptiles/import-natural-earth/blob/master/clean-natural-earth.sh ).

However, I ended up finding natural earth tables that were missing when I did it the way the docker image did it, which caused generated sql script that run later to fail. In my load_naturalearth.sh I ended up making my own 'natural_earth_vector.sqlite' file by taking all the 10m,50m,and 110m natural earth shape file downloads and then using ogr2ogr to append them into an sqllite file, then importing the sqlite file into the postgres database. In my version I just left all the unused tables because they didn't get in the way of anything I was doing, so that 'ne_10m_urban_areas_landscan' table could probably be removed.

At one point I had tried to modify the load_naturalearth.sh script so that it went right from shape into postgres, but it caused the sql scripts to fail and I reverted it back to what worked