0
我想指定一個框(即2個點)並選擇框內或相交的所有線串。PostGIS:查找與框重疊的LineStrings
SELECT * FROM pub_trail_segment WHERE st_force_2d(pub_trail_segment.geometry) && ST_SetSRID(ST_MakeBox2D(ST_GeomFromEWKT('SRID=4326;POINT(48.25077560316286 -124.46710205078124)'), ST_GeomFromEWKT('SRID=4326;POINT(50.4743709029765 -120.73239135742186)')), 4326);
但它返回0行。我試着擴大框的大小,並強制幾何列到2D,但我看不到我失蹤。
測試數據如下 - (DBTestCase格式,但你的想法):
<pub_trail_segment id="1" pub_trail_id="1" geometry="SRID=4326;LINESTRING(-123.258275 7 49.3607281 123.666748, -123.2583172 49.3607195 120.302124)"/>
<pub_trail_segment id="2" pub_trail_id="3" geometry="SRID=4326;LINESTRING(-123.2582757 49.3607281 123.666748, -123.2583172 49.3607195 120.302124, -123.3583172 49.3607195 120.402124)"/>
<pub_trail_segment id="3" pub_trail_id="1" geometry="SRID=4326;LINESTRING(-123.3582757 49.4607281 123.666748, -123.3583172 49.4607195 120.302124)"/>
<pub_trail_segment id="4" pub_trail_id="4" geometry="SRID=4326;LINESTRING(-123.3582757 50.4607281 123.666748, -123.3583172 50.4607195 120.302124)"/>
感謝您的幫助!
您可能會在專用站點http://gis.stackexchange.com找到更多關於GIS相關問題的專家解答。 – amercader 2010-08-03 10:25:51