[postgis-users] intersection - possible Bug
Rene Neidt
r.neidt at idu.de
Wed Mar 5 05:06:30 PST 2008
Dear PostGis Users,
we are using PostgreSQL / PostGIS very intensively - at the moment in combination with PG-Routing.
Because we are routing on areas, we create somthing like a network on them and intersect this netzwork with some area - properties (e.g. vegetation).
While doing this, a very strange behaviour occured: intersection of two lines created a point, which is relative far away from one line. Here the simplified sql - statment:
select asText(intersection(b.g, a.g)) as intersection,
distance (a.g, intersection(b.g, a.g)) as distance
from
(select '01020000000200000050E8303FC2E85141B017CFC05A825541000000E0C0E85141000000205C825541'::geometry as g) a,
(select 'LINESTRING(4694792.35840419 5638508.89950758,4694793.20840419 5638506.34950758)'::geometry as g) b
-> so the distance of point and first line is 0.88 (meters)
when I use asText for the first Line:
select asText(intersection(b.g, a.g)) as intersection,
distance (a.g, intersection(b.g, a.g)) as distance
from
(select asText('01020000000200000050E8303FC2E85141B017CFC05A825541000000E0C0E85141000000205C825541'::geometry) as g) a,
(select 'LINESTRING(4694792.35840419 5638508.89950758,4694793.20840419 5638506.34950758)'::geometry as g) b
-> the distance reduces to a very little value (xe-10) - with this I have no problem, because I use some little tollerance - but 0.88 is too much in my case.
As a workaround I use allways asText at the moment.
Our PostGIS fullVerion is
"POSTGIS="1.3.2" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct 2006" USE_STATS"
on "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)"
By the way - the same Statment in
"POSTGIS="1.2.0" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.5.0, 22 Oct 2006" USE_STATS"
on "PostgreSQL 8.2.0 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)"
creates a point with a small distance (but >0) in both cases
Greetings
Thomas and Rene
IDU Ingenieurgesellschaft für Datenverarbeitung und Umweltschutz mbH
Thomas Höhne
Theodor-Körner-Allee 16
02763 Zittau
Germany
Tel ++49 3583 5409 499 / 5409 497
Fax ++49 3583 5409 / 498
Internet www.idu.de
NL Dresden
Deutsche Werkstätten Hellerau
Moritzburger Weg 67
01109 Dresden
Gebäude A Büroeinheit 1/19
Tel ++49 0351 88 38 35 31
Geschäftsführer:
Dr. D. Bothmer
Dr. F. Zimmermann
Amtsgericht Dresden, HRB 8371
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080305/864fc2bf/attachment.html>
More information about the postgis-users
mailing list