I created a table of ST_ClosestPoint()s to polylines.  I assumed that if the
closest points were on the line the queries below would give equal results,
but that's not happening.

 

"InsideWorking".simplified is a line.

"gaps".closeststartpoint is a point.

 

SELECT "gaps".closeststartpoint FROM "gaps" 

WHERE "gaps".closeststartpoint IS NOT NULL; --Query produces 462 results.

 

SELECT * FROM "gaps","InsideWorking" 

WHERE ST_Covers("InsideWorking".simplified,"gaps".closeststartpoint);
--Query produces 1228 results.

 

SELECT * FROM "gaps","InsideWorking" 

WHERE ST_Contains("InsideWorking".simplified,"gaps".closeststartpoint);
--Query produces 548 results.

 

SELECT "gaps".closeststartpoint FROM "gaps","InsideWorking" 

WHERE ST_Touches("InsideWorking".simplified,"gaps".closeststartpoint);
--Query produces 680 results.

 

----------------------------------------------------------------------------
----------------------------------------

 

SELECT "gaps".closeststartpoint FROM "gaps","InsideWorking" 

WHERE ST_DWithin("InsideWorking".simplified,"gaps".closeststartpoint,0);
--Query produces 1258 results.

 

Inspection shows the ST_DWithin() query is getting better results than the
other queries.  So I think I've got something that works, but I'd appreciate
some advice on why the others don't give similar results.

 

Thanks in advance.

<<image001.gif>>

_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to