<div dir="ltr">Hi,<br><br>I'm running some tests on my data, and I just found out that a point on my map is not being located well. When I try to find on which road segment is this point (tried different points in the same area, all same problem) I am getting no result. As I keep increasing the expand, I get the nearest point kilometers away. <br>
<br>This is the query I am running:<br><br>SELECT gid, astext(the_geom), distance(the_geom, pointfromtext ('POINT(639313.5 20222798)'))<br>              FROM streets_proper<br>                  WHERE <br>                    (<br>
                      the_geom && expand ( pointfromtext ('POINT(639313.5 20222798)') ,100000000 )<br>                    )<br>              ORDER BY distance ( the_geom, pointfromtext ('POINT(639313.5 20222798)') )<br>
<br><br>This is the result to the query:<br><br>30639;"MULTILINESTRING((636287.854148259 258075.811758838,636275.375133364 258080.421709569,636240.8320266 258092.166940159,636202.57661422 258100.818946874,636167.995585384 258102.57210146,635486.176381905 258095.192278846,635217.654866998 258082.45545628,634931.3812964 258060.198164721,634873.589774273 258053.320848581,634830.821635244 258043.906498968))";19964695.6756909<br>
<br>.. and so on.<br><br>This is the result of EXPLAIN ANALYZE<br><br>                              QUERY PLAN                                        <br>--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
 Sort  (cost=19591.83..19716.20 rows=49751 width=180) (actual time=7986.343..8185.926 rows=49746 loops=1)<br>   Sort Key: distance(the_geom, '010100000000000000A3822341000000E034497341'::geometry)<br>   ->  Seq Scan on streets_proper  (cost=0.00..10890.64 rows=49751 width=180) (actual time=0.327..5996.988 rows=49746 loops=1)<br>
         Filter: (the_geom && '01030000000100000005000000000000C07EB097C1000000C0360593C1000000C07EB097C100000040D1A99C410000004089FE974100000040D1A99C410000004089FE9741000000C0360593C1000000C07EB097C1000000C0360593C1'::geometry)<br>
 Total runtime: 17130.283 ms<br>(5 rows)<br><br><br><br>It is the first time that this is happening, anything you suggest I should do please? All the other points on the map are acting normally, its just this area of points which is acting strange. I tried to use different points in the same area, which is quite remote in the map, all giving similar results. Normally I just do the expanding distance just by 100, and if it doesn't fidn it continue increasing by 100 until it does, which is rarely used.<br>
<br><br>Any help is extremely appreciated!!<br><br>Kind Regards<br><br>Matt<br><br clear="all"><br>-- <br>Matthew Pulis<br>URL : <a href="http://www.solutions-lab.net">http://www.solutions-lab.net</a><br>MSN : pulis_matthew[@]<a href="http://hotmail.com">hotmail.com</a><br>
ICQ : 145951110<br>Skype : <a href="http://solutions-lab.net">solutions-lab.net</a><br>
</div>