[postgis-users] Precision of the bounding box query

Mike Toews mwtoews at gmail.com
Mon Sep 2 04:05:05 PDT 2013


On 2 September 2013 18:10, Alexander Ulanov <avulanov at gmail.com> wrote:
> Does this mean that all bounding box queries have to be written with casting
> to geometry type? Bounding box originates from the browser with google maps.

I suppose so, as long as the map used to base the BBOX queries share
the same grid orientation as a lat/long grid (not the case for UTM,
LCC and others, but true for Mercator projections). To get a good idea
of a straight line for the geography type you have to see it on a
globe (or something like Google Earth), but never on a flat map.

> Related question. Do I really need geography type for my locations if my
> queries are only bounding box and st_dwithin ?

Geography types are still really handy for ST_DWithin, since they use
nice linear metric units for distances. So I guess it depends how much
you use this function or other distance-based functions. There are
also several ways to get metric area and distance values from geometry
data of long/lat too. Be sure to read the relevant manual section [1]
to help you decide.

[1] http://postgis.net/docs/using_postgis_dbmanagement.html#PostGIS_Geography

-Mike


More information about the postgis-users mailing list