mapbox / wagyu

A general library for geometry operations of union, intersections, difference, and xor
Other
164 stars 32 forks source link

Compare against PostGIS MakeValid() #47

Open flippmoke opened 7 years ago

flippmoke commented 7 years ago

It would be very interesting to see how Wagyu compares against GEOS/MakeValid in PostGIS both from performance and accuracy. It seems that the method for PostGIS is located here and perhaps it could be extracted and put into a benchmark.

First step would be to determine how to use this method in a standalone fashion if possible.

/cc @pramsey @strk

Komzpa commented 5 years ago

Now that @Algunenano has a branch shipping wagyu into PostGIS https://github.com/postgis/postgis/pull/356 this can be done by writing a PostGIS CUnit test, for example.

Algunenano commented 5 years ago

I did this a while back (months before implementing wagyu inside Postgis): image

This was comparing our tiler serving MVTs using St_AsMVT or using node-mapnik. The main difference I've noticed when comparing postgis+wagyu and node-mapnik is that node-mapnik drops any inner rings bellow the first one (so inner rings can't have inner rings themselves), while my implementation using wagyu just creates the extra polygons (so the 3rd ring is a new polygon, for example).

I'll probably end up implementing the comparison either with cunit or postgis regress test, so if you are interested in any special case let me know.