[postgis-users] Cut lines with polygon

Brian Modra brian at zwartberg.com
Mon Oct 5 05:57:44 PDT 2009


2009/10/5 Alexander Strunck <A.Strunck at gmx.net>:
> Hello
>
> i am really new to postgis and i try to cut lines with a polygon. the sql statement is
>
> create table osm_line_in_dorfring2_5_10 as
> SELECT b.way_id, b.geom,
> Intersection ( g.geom, b.geom )
>  FROM stadtdorfbuffer2_5_10 AS g, osm_line AS b
>  WHERE IsEmpty ( Intersection ( g.geom, b.geom ) ) = FALSE;
>
> but when i look at the result the lines are not cut by the polygon. the lines go a little bit over the borders of the polygon. Why is that?

Have you checked the coords and done the maths (manually) to see if
the intersection points are wrong? Maybe its just a rendering problem
in whatever you are using to view them?

> the second problem ist when i want to do the same thing with two different polygon tables. i get the error
> NOTICE:  TopologyException: found non-noded intersection between 8.18405 48.9483, 8.18366 48.9481 and 8.18285 48.947, 8.18933 48.9551 8.18381 48.9482
> ERROR:  GEOS Intersection() threw an error!
>
> ********** Fehler **********
>
> ERROR: GEOS Intersection() threw an error!
> SQL Status:XX000

See if you can find the polygon that its throwing this for, and view
it to see if there is something obvious about the topology.

>
> i tested the polygon tables with ST_IsValid and everything seems to be all right.
>
> does someone have any suggestions?
>
> thx in advance
>
> alex
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Brian Modra   Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/



More information about the postgis-users mailing list