[postgis-users] Problems with st_difference

Marc Jansen jansen at terrestris.de
Sun Jan 24 14:18:16 PST 2010


Hi Marko,

ST_Intersection [1] returns all intersection-geometries between 
geometries, so when two polygons lie exactly side by side (meaning they 
share at least one "line"), you will get a linestring of the edge both 
polygons share.
I would suggest you run your query with an added typecheck of the return 
geometry (using e.g. ST_GeometryType [2] or ST_Dimension [3]).

Regards,
Marc

[1] 
http://postgis.refractions.net/documentation/manual-svn/ST_Intersection.html 
(there is an example that drops certain intersections of the "wrong" 
geometrytype)
[2] 
http://postgis.refractions.net/documentation/manual-svn/ST_GeometryType.html
[3] 
http://postgis.refractions.net/documentation/manual-svn/ST_Dimension.html


Marko Čubranić schrieb:
>
>
> ---------- Forwarded message ----------
> From: *Marko Čubranić* <mcubranic at gmail.com <mailto:mcubranic at gmail.com>>
> Date: 2010/1/23
> Subject: Re: [postgis-users] PROBLEM CONVERTING AND MANIPULATING 
> LONGITUDE ANDLATITUDE COORDINATES
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net 
> <mailto:postgis-users at postgis.refractions.net>>
>
>
> Dear colleagues,
>
> i have problems with ST_difference operator.
> I have imported two *.shp files in postgis databas, country(polygon) 
> and region of country(polygon).
> I have run ST_difference query and the result was as i  expected, but  
> result was also part of
> both polygons, more precise some of boundary lines that both polygons 
> contains.
> I have checked geometries in AutoCAD and both geometries are similar, 
> line on line, point on point.
> Than I run queries in postgis to show me Geometry as text of both 
> polygons and result of ST-difference. And all geometries contained 
> same coordinates.
>
> I hope that you have understand my problem and thank you for your help.
>
> Marko
>
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   




More information about the postgis-users mailing list