Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid polygons after simplification, coord. transform or clipping #5

Closed
pka opened this issue Jul 28, 2016 · 3 comments
Closed

Comments

@pka
Copy link
Member

pka commented Jul 28, 2016

Some vector tile creation steps can produce invalid polygons:

  • Simplification
  • Coordinate transform
  • Clipping (tile buffer)

See also mapbox/vector-tile-spec#58 (comment) and tilezen/mapbox-vector-tile#42 (comment)

@Wykks
Copy link
Contributor

Wykks commented Jun 16, 2017

Indeed. I'm getting this

image

Using these data https://raw.githubusercontent.com/gregoiredavid/france-geojson/v2-hd-dev/departements.geojson
Imported to postgis with
ogr2ogr -f PostgreSQL PG:"host=127.0.0.1 port=9500 dbname=postgres user=postgres password=test" departements.geojson -nln depts -s_srs EPSG:4326 -t_srs EPSG:3857

Edit:
Oops, it's actually working fine with buffer_size = 1 (after reading what going on in #18)
For some reason, genconfig didnt set buffer_size = 1 for this layer.
It set geometry_type = "GEOMETRY" which doesn't works. So I changed to POLYGON but forgot to set buffer_size = 1

@pka
Copy link
Member Author

pka commented Jun 16, 2017

@Wykks buffer_size is now also generated for type GEOMETRY (eb89553)

@Wykks
Copy link
Contributor

Wykks commented Jun 16, 2017

Actually, I don't know what's type GEOMETRY. T-rex generate config with this, but then it doesn't know what to do with it:
Error converting between Postgres and Rust types: Unknown geometry type GEOMETRY.
It seems that t-rex is incorrectly detecting the geometry_type from postgis.
QGIS detect the geometry_type POLYGON without issue, so I think that my datasource is fine.

@pka pka closed this as completed Jul 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants