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

Gustavo Henrique Sberze Ribas gribas at cpqd.com.br
Fri May 6 09:57:55 PDT 2005


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
> 



More information about the postgis-users mailing list