[postgis-users] ST_Split with Multilinestring
Birgit Laggner
birgit.laggner at thuenen.de
Thu Jun 16 01:46:21 PDT 2016
Hi Rémi,
thank you for sharing your function. In the meantime I seem to have
solved the problem by combining the st_split function with a function
from an old use case:
CREATE OR REPLACE FUNCTION ST_SplitPolygon(poly geometry, blade
geometry) RETURNS geometry AS
$$
declare
out_geom geometry;
begin
begin
out_geom := st_split(poly, blade);
exception when internal_error then
out_geom := ST_Collect((d).geom) FROM (SELECT
ST_Dump(ST_Polygonize(ST_Union(ST_Boundary(poly), blade))) AS d) f WHERE
ST_Area(ST_Intersection(poly, (d).geom)) / ST_Area((d).geom) >= 1 - 1e-10;
end;
return out_geom;
end;
$$
LANGUAGE plpgsql IMMUTABLE STRICT COST 100;
But I will definitely give your function a try and compare the results!
Thanks again! Regards,
Birgit
Am 16.06.2016 um 10:18 schrieb Rémi Cura:
> Hey,
> I wrote a multi-friendly st_split a while ago.
> Maybe it will help you:
> https://github.com/Remi-C/PPPP_utilities/blob/master/postgis/rc_split_multi.sql
>
> Cheers,
> Rémi-C
>
> 2016-06-15 19:19 GMT+02:00 Birgit Laggner, vTI
> <birgit.laggner at thuenen.de <mailto:birgit.laggner at thuenen.de>>:
>
> Hi Sandro,
>
> yes, I read so, too. But, our database has PostGIS version:
> "POSTGIS="2.2.1 r14555" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel.
> 4.9.1, 04 March 2015" GDAL="GDAL 1.11.2, released 2015/02/10"
> LIBXML="2.9.2" LIBJSON="0.11.99" TOPOLOGY RASTER" and I still get
> that error. Any idea why?
>
> Regards,
>
> Birgit
>
>
> Am 15.06.2016 um 19:02 schrieb Sandro Santilli:
>
> On Tue, Jun 14, 2016 at 02:52:52PM +0200, Birgit Laggner wrote:
>
> ERROR: Splitting a Polygon by a MultiLineString is unsupported
>
> Support for this functionality was added in PostGIS-2.2.0
>
> --strk;
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
> http://lists.osgeo.org/mailman/listinfo/postgis-users
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20160616/91b99382/attachment.html>
More information about the postgis-users
mailing list