[OSM-dev] projection for calculating distances in PostGIS

Marcus Wolschon Marcus at Wolschon.biz
Wed May 19 21:50:46 BST 2010

On Wed, May 19, 2010 at 10:35 PM, John Smith <deltafoxtrot256 at gmail.com> wrote:
> On 19 May 2010 22:06, Marcus Wolschon <Marcus at wolschon.biz> wrote:
>> Hello,
>> what projections do you use to calculate distances (in meters) in postgis?
>> I have some code here that tried to use 27700 but that is not defined
>> on all inhabited continents of this planet.
>> An error of at most 25% would be acceptable as this is just about search
>> -areas and not street-length.
> If you generate an area that you want to cover, then all you need to
> do is use ST_Within() function I think it is.

No, I do need the "&&" = st_intersects() and after the intersects() the
result is checked for distance.
Because the geometries I am checking against my bounding-box may be
ways and areas and thus not be completely inside the bounding-box but
just intersecting it.
 Both the creation of the bounding-box and
the distance -calculation require a projection.


More information about the dev mailing list