[gdal-dev] Check validity of geometries before writing them into vector tiles?

Blake Thompson flippmoke at gmail.com
Wed Feb 14 12:04:19 PST 2018


All,

Geometry validity with polygons is really hard. The only solution at Mapbox
we found to fix this properly for Vector Tiles that we create was to modify
an existing algorithm to solve all the potential problems of geometry
validity. The result of this is https://github.com/mapbox/wagyu/ which we
use in our Vector Tile creation scripts now. Unfortunately it doesn't have
great performance when using extremely high numbers of points in polygons.
However, for vector tiles this typically should not be needed if
simplification is done prior to VT creation. If there is supported needed
around this problem I am more then willing to lend my expertise.

Thanks,

Blake Thompson

On Wed, Feb 14, 2018 at 10:53 AM, Rahkonen Jukka (MML) <
jukka.rahkonen at maanmittauslaitos.fi> wrote:

> Even Rouault wrote:
>
> > Perhaps you could play with the SIMPLIFICATION and
> SIMPLIFICATION_MAX_ZOOM options ?
> Sure, as I wrote I admit that my test did not make much sense, but trying
> things before reading the manual sometimes reveals something interesting.
>
> > Perhaps you should also use an already simplified layer for the lowest
> zoom level (see the CONF option)
> For sure yes, coordinate space of 4096x4096 is far too small for this
> dataset.
>
> > Are you sure you get polygons with less than 4 points ? Normally they
> should be discarded.
> Quite sure yes by looking at what the ST_IsValidReason from the SQLite
> dialect prints
> ST_IsValidReason(geometry) (String) = Invalid: Toxic Geometry ... too few
> points
>
> There are other variants of invalid geometries and actually a few valid as
> well. Here is one example with an invalid component
>
>   MULTIPOLYGON (((516384 6815744,516384 6815744,532768 6815744,516384
> 6815744)),
> ((516384 6815744,516384 6815744)),((516384 6815744,516384 6815744)))
>
> My zero tile is here http://www.latuviitta.org/downloads/0.pbf
>
> -Jukka Rahkonen-
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180214/b063c40e/attachment.html>


More information about the gdal-dev mailing list