Opened 17 years ago

Last modified 16 years ago

#11 closed defect (wontfix)

intersection - possible Bug

Reported by: mcayland Owned by:
Priority: medium Milestone:
Component: postgis Version:
Keywords: Cc:

Description

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

Change History (2)

comment:1 by mcayland, 17 years ago

Looks fine to me using PostgreSQL 8.2/GEOS 3.0.0 final on Linux:

pg82@mca-desktop:~/src/postgis-svn/trunk$ psql -d postgis Welcome to psql 8.2.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms

\h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit

postgis=# select asText(intersection(b.g, a.g)) as intersection, postgis-# distance (a.g, intersection(b.g, a.g)) as distance postgis-# from postgis-# (select postgis(# '01020000000200000050E8303FC2E85141B017CFC05A825541000000E0C0E85141000000205C825541'::geometry postgis(# as g) a, postgis-# (select 'LINESTRING(4694792.35840419 5638508.89950758,4694793.20840419 postgis'# 5638506.34950758)'::geometry as g) b postgis-# ;

intersection | distance


POINT(4694792.98736008 5638507.01263992) | 0

(1 row)

postgis=# select asText(intersection(b.g, a.g)) as intersection, postgis-# distance (a.g, intersection(b.g, a.g)) as distance postgis-# from postgis-# (select asText('01020000000200000050E8303FC2E85141B017CFC05A825541000000E0C0E85141000000205C825541'::geometry) as g) a, postgis-# (select 'LINESTRING(4694792.35840419 5638508.89950758,4694793.20840419 5638506.34950758)'::geometry as g) b;

intersection | distance


POINT(4694792.98736008 5638507.01263992) | 0

(1 row)

postgis=#

Can you reproduce the same error using GEOS 3.0.0 final release? If so it may be a Win32-specific bug…

ATB,

Mark.

comment:2 by mcayland, 16 years ago

Closing due to lack of activity.

ATB,

Mark.

Note: See TracTickets for help on using tickets.