Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1909 closed defect (invalid)

intersection problem

Reported by: debe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.5
Component: postgis Version: 1.5.X
Keywords: Cc: mdavis@…

Description

with this line:

geomfromtext('LINESTRING(15 56,80 12)')

and this substring line:

st_line_substring(geomfromtext('LINESTRING(15 56,80 12)'),0,0.6)

LINESTRING(15 56,54 29.6)

if i make the intersection i get only the first point:

st_intersection(
    geomfromtext('LINESTRING(15 56,80 12)'),
    st_line_substring(geomfromtext('LINESTRING(15 56,80 12)'),0,0.6)
)

POINT(15 56)

my expected result should be:

LINESTRING(15 56,54 29.6)

because if I take a substring of a line, the intersection with the original line is the substring line, correct?

thx for any help on this strange thing

Daniele

Change History (2)

comment:1 by pramsey, 12 years ago

Cc: mdavis@… added
Resolution: invalid
Status: newclosed

It's difficult to understand, but doing computer geometry we live in a quantized world. Imagine a piece of graph paper. Draw a line from one intersection to another. Now, look at all the points on that line which do not touch an intersection. Those are all the valid geometric points on the line that you cannot represent using integers. The same thing is true of lines between two double-precision points. Most of the space on that line will be points that cannot be exactly represented in double precision. Your substring includes the 0.0 proportion (the start point) and that's representable. The 0.6 proportion is not. The result is a new line that is very slightly offset from the original. Enough that the exact attempt at an intersection only picks up the original point.

comment:2 by robe, 12 years ago

Milestone: PostGIS 1.5.4PostGIS 1.5.5
Note: See TracTickets for help on using tickets.