[postgis-users] Projections and Functions (was Simple question: How to get projected distance?)

Gustavo Henrique Sberze Ribas gribas at cpqd.com.br
Fri Aug 12 13:57:53 PDT 2005

> If you are not super concerned about accuracy, create a 
> planar project  for your region of interest (CONUS, right?) 
> and use that instead of figuring out the right UTM zone on 
> the fly.  I think there are some nice 
> Lambert parameterizations that do all of CONUS.  You can just 
> insert the 
> relevant definnitions into spatial_ref_sys and go from there.

  Paul, what if my region of interest covers the whole world?
Would you be so kind as to elaborate your idea? I'm a bit

>> One last question - Is this cycle of WGS84 -> UTM -> WGS84 
>> considered best practice i.e. is this the easiest way to 
>> accomplish what I need?  
  I don't know if it's the best way, but it's easy and it seems
to work. However I keep asking myself what would happen if
I create a buffer of 1km real close to the border that
delimit a zone, will the Easting and Northing be correctly converted
back to lat/long?

>> It would imply that I need to add logic to figure the right 
>> intermediate UTM zone.

  Now that's easy, to get the UTM zone of a lat/long coordinate:

  select (round((X($1)+180)/6 + 0.5))::int

  where $1 is a geometry. The boring thing is to create a table
that will map all UTM's SRID.

  or you could create some functions like 

 where it assumes the ellipsoid of the given geometry to calculate
the output.


More information about the postgis-users mailing list