t-rex-tileserver / t-rex

t-rex is a vector tile server specialized on publishing MVT tiles from your own data
https://t-rex.tileserver.ch/
MIT License
552 stars 69 forks source link

Issue with gpkg rendering #126

Open trip1 opened 5 years ago

trip1 commented 5 years ago

First, I really enjoy working with the t-rex server, runs fast and really useful in generating our maps.

Only issue I seem to be having is with one gpkg file of the oceans. I'm taking the water polygon shape file from osm coastline and using ogr2ogr ogr2ogr -f GPKG water.gpkg water_polygons.shp to convert to gpkg files.

When inspecting both the shapefile and the gpkg file in qgis both render correctly with no issue. Not sure where I might have messed something up or if there's an issue rendering gpkg files with the full ocean polygon. Here's an example of the issue in rendering.

Screenshot from 2019-07-11 08-28-20

Here's my test config file:

# t-rex configuration

[service.mvt]
viewer = true

[[datasource]]
name = "ocean"
path = "water.gpkg"

[grid]
predefined = "web_mercator"

[[tileset]]
name = "planet"
minzoom = 2
maxzoom = 7

[[tileset.layer]]
name = "water"
datasource = "ocean"
table_name = "water_polygons"
geometry_field = "geom"
geometry_type = "POLYGON"

[cache.file]
base = "/tmp/layers"

[webserver]
# Bind address. Use 0.0.0.0 to listen on all adresses.
bind = "0.0.0.0"
port = 6767

[[webserver.static]]
path = "/static"
dir = "/tmp/layers"
pka commented 5 years ago

Thanks for the feedback, @trip1!

Never saw exactly this kind of artefacts before. Similar problems are are caused when reprojecting from WGS84 to Webmercator. Are you using the Mercator or the WGS84 shapefiles?

trip1 commented 5 years ago

Fairly certain I'm using the Mercator files, but I can double check tomorrow. Would I need to specify the projection when converting shapefile to geopackage using ogr2ogr?

trip1 commented 5 years ago

I tested both the mercator and wgs84 shape files without converting them and testing with reprojection on and off with both. Still had the same issue with artifacts showing up.