[postgis-users] Exception Handling in Postgis function

Rémi Cura remi.cura at gmail.com
Sun Nov 15 12:38:52 PST 2015


Hey,
you are probably using the wrong function,
you may want to use
http://postgis.net/docs/manual-dev/TopoGeo_AddLineString.html

For exception, this is pretty easy using plpgsql
http://www.postgresql.org/docs/current/static/plpgsql-control-structures.html
40.6.6

Cheers,
RémiC

2015-11-14 3:17 GMT+01:00 ranjitsaurav <ranjitsaurav at gmail.com>:

> Hi
>
> I am new in the postgressql and postgis. I am trying to using the exception
> handling for
> the postgis function. The query is as follows.
>
> "SELECT topology.AddEdge('road_topology', ST_GeomFromText(l.linestring,
> 4326)) As edgeid
> from
> (SELECT ST_AsText(geom) as linestring FROM public.clip_linestring) as l;"
>
> This query is showing error as follows
>
> ERROR:  Edge intersects (not on endpoints) with existing edge 162 at or
> near
> point POINT(100.3812061 13.6915724)
>
> I would like to implement exception handling so that I could know from
> which
> line of table "clip_linestring" this error is coming. I would like to know
> the row in the table from which the error is being generated.
>
> How do I use the exception handling for these kind of issue.
>
> Thank you.
>
> Regards,
> Saurav Ranjit
>
>
>
> --
> View this message in context:
> http://postgis.17.x6.nabble.com/Exception-Handling-in-Postgis-function-tp5009311.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> 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/20151115/e07630e9/attachment.html>


More information about the postgis-users mailing list