RES: [postgis-users] How does PostGIS know Units?

Paul Ramsey pramsey at refractions.net
Fri May 6 10:47:34 PDT 2005


You'll want to be sure to use a UTM zone appropriate to your data, but 
yes, this works fine. One could wrap this in a PL/PgSQL function to make 
it simpler for operational use.

Gustavo Henrique Sberze Ribas wrote:

> Hello,
> 
>  The following command transforms a point from lat/long WGS84 to
> UTM, uses buffer() to create a 250Km radius circle and transform
> that circle back to lat/long coordinates.
>  I don't known if that's the smartest way do to this, but it
> works. :)
> 
> 
>  select 
>  transform(
>    setSRID(
>       buffer(
>          transform(
>            'SRID=4326;POINT(-47.2407989501953 -22.7394008636475)',32723
> 	 ),
> 	 250000
>       ),
>       32723
>    ),
>    4326
>  )
> 
> --
> Gustavo
> 
> 
>>>>Yes, PostGIS assumes all your units are the same. Which 
>>
>>means that if 
>>
>>>>you are working in degrees, buffer will also work in 
>>
>>degrees. Which is 
>>
>>>>probably not what you want. You will want to choose a planar 
>>>>projection to work in that is suitable to your data.
>>>
>>>Great!  But how do I go about doing this?  Like I said, I'm 
>>
>>still very 
>>
>>>new to PostGIS?  Let's say my full SQL is:
>>>    select AsText( Buffer( PointFromText( 'POINT(39.0 
>>
>>-83.4)' ),125.0 ) );
>>
>>>What should I do to choose a planar projection so that PostGIS 
>>>understands that my POINT is given in lat/lon and that 
>>
>>Buffer() is using 
>>
>>>km? 
>>
>>You reproject your points *into* the planar projection, and 
>>then perform 
>>the calculation as before... what is the extent of your data? 
>>That will 
>>inform your choice of projection.
>>
>>
>>>And will I need the Proj4 module for this (in case I don't already 
>>>have it)?
>>
>>Yes you'll need proj4. select postgis_full_version for a list of 
>>libraries (I think).
>>
>>
>>_______________________________________________
>>postgis-users mailing list
>>postgis-users at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list