[postgis-users] ST_Difference query returns a dissolved result

Nicolas Ribot nicolas.ribot at gmail.com
Fri Sep 5 00:58:16 PDT 2014


Hi,

Your multipolygon is invalid: PG parts cannot share an edge in a
MultiPolygon.
Postgis unions the two parts during the st_difference process.

Geometric operation should be called only on valid objects.

Nicolas




On 4 September 2014 21:20, Max Demars <burton449geo at gmail.com> wrote:

> Hi!
>
> I am using the ST_Difference to erase multipolygon feature by a mask.
> However, the query returns a dssolved multipolygon.
>
> The query is the following:
>
> '''SELECT ST_AsGeoJSON(ST_Collect(geom))
> ::json
>    FROM (SELECT (
>      ST_Dump (
>
> ST_Difference(ST_GeomFromGeoJSON('%s'),ST_GeomFromGeoJSON('%s')))).geom)
>              As f''' % (feature,mask)
>
> Please take a look at those images above to understand the problem:
>
> Input: http://i.stack.imgur.com/QO4MN.png
> Output: http://i.stack.imgur.com/Slw32.png
>
> Thank you all,
> -Max Demars
> --
> Stack Overflow: http://stackoverflow.com/users/1914034/burton449
> GIS Overflow: http://gis.stackexchange.com/users/14426/burton449
> LastFm: http://www.lastfm.fr/user/burton449
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140905/3b9559ff/attachment.html>


More information about the postgis-users mailing list