On 4/18/10 11:40 AM, Josh Livni wrote:
> Assuming you have set the srid (probably 4326) on your geometry, then
> somegeometry.transform(26910) will transform / reproject it to utm zone
> 10 north. Replace with the appropriate epsg code for your utm zone of
> choice.
Yes, `geom.tranform(utm_srid)` is the way to go. Remember to set the
SRID when creating your geometries, and that the coordinate ordering is
(lon, lat) -- here's an example transforming a point for Houston, Texas
to it's UTM zone:
>>> from django.contrib.gis.geos import Point
>>> lon, lat = -95.363151, 29.763374
>>> pnt = Point(lon, lat, srid=4326)
>>> pnt.transform(32615) #
http://spatialreference.org/ref/epsg/32615/
>>> print pnt
POINT (271507.6854771426296793 3294905.7410673047415912)
-Justin