[postgis-users] intersection problem

Daniele Debernardi daniele at geosar.ch
Tue Jul 3 04:35:56 PDT 2012


hi,
I have a problem with an intersection with 2 lines that don't return 
what I expect:

sample intersection between a line and a substring of the same line:
first line: LINESTRING(675315.7 158956.9,675280 158912.9)
second: st_makeline(geomfromtext('POINT(675315.7 158956.9)'),
ST_Line_Interpolate_Point(geomfromtext('LINESTRING(675315.7 
158956.9,675280 158912.9)'),0.6))

select st_astext(st_intersection(
     geomfromtext('LINESTRING(675315.7 158956.9,675280 158912.9)'),
     st_makeline(geomfromtext('POINT(675315.7 158956.9)'),
ST_Line_Interpolate_Point(geomfromtext('LINESTRING(675315.7 
158956.9,675280 158912.9)'),0.6))
));

result: POINT(675315.7 158956.9)

what I expect is that the result of the intersection is not only the 
point of start of the 2 lines, but a linestring
starting with that point but ending with the point returned by the 
interpolation (expected to be over the line)

I'm doing something wrong with the intersection? there is another way to 
get the result I expect?
or is a problem in postgis?

ps: I'm using the POSTGIS 1.5.3 version

thx for help
Daniele




More information about the postgis-users mailing list