<div dir="ltr">Hi!<br><div><br></div><div>I have a spatial db of cities and places inside Postgis v1.5. I've built a gist index on location column and run a bounding box query. However, I noticed a strange behavior: results of queries with huge bounding boxes are very imprecise.</div>
<div><br></div><div>For example, the first query returns Sagrada Familia (longitude ~2 and latitude ~41) and second doesn't, although 41 is inside both 34..68 and 35..69.<br></div><div><div>1)select name from places where location && ST_setSRID(ST_MakeBox2d (ST_Point(57,34), ST_Point(-28,68)),4326) and name like 'Sagrada%';</div>
<div><div><br class="">      name       |                st_astext                 </div><div>-----------------+------------------------------------------</div><div> Sagrada Família | POINT(2.17434883117676 41.4035152693628)</div>
<div><br></div></div><div>2)select name from places where location && ST_setSRID(ST_MakeBox2d (ST_Point(57,35), ST_Point(-28 69)),4326) and name like 'Sagrada%';</div></div><div><div><div> </div><div>name | st_astext </div>
<div>------+-----------</div><div>(0 rows)</div></div></div><div><br></div><div>Could you explain what is the reason for this and how to fix it?</div><div><br></div><div><br></div><div>Best regards, Alexander</div></div>