Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing UTM with geodjango
    text
    copied!<p>I'm looking into using the <a href="http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system" rel="nofollow noreferrer">UTM</a> coordinate system with geodjango. And I can't figure out how to get the data in properly.</p> <p>I've been browsing the documentation and it seems that the "<a href="http://geodjango.org/docs/geos.html#geosgeometry-geo-input-srid-none" rel="nofollow noreferrer">GEOSGeometry(geo_input, srid=None)</a>" or "<a href="http://geodjango.org/docs/gdal.html?highlight=convertion#ogrgeometry" rel="nofollow noreferrer">OGRGeometry</a>" could be used with an EWKT, but I can't figure out how to format the data.</p> <p>It looks like the UTM <a href="http://en.wikipedia.org/wiki/SRID" rel="nofollow noreferrer">SRID</a> is: 2029</p> <p>From the <a href="http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system" rel="nofollow noreferrer">wikipedia article</a> the format is written like this: </p> <p>[<em>UTMZone</em>][<em>N or S</em>] [<em>easting</em>] [<em>northing</em>]</p> <p><em>17N 630084 4833438</em> </p> <p>So I tried the following with no luck:</p> <pre><code>&gt;&gt;&gt; from django.contrib.gis.geos import * &gt;&gt;&gt; pnt = GEOSGeometry('SRID=2029;POINT(17N 630084 4833438)') GEOS_ERROR: ParseException: Expected number but encountered word: '17N' &gt;&gt;&gt; &gt;&gt;&gt; from django.contrib.gis.gdal import OGRGeometry &gt;&gt;&gt; pnt = OGRGeometry('SRID=2029;POINT(17N 630084 4833438)') Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "C:\Python26\lib\site-packages\django\contrib\gis\gdal\geometries.py", line 106, in __init__ ogr_t = OGRGeomType(geom_input) File "C:\Python26\lib\site-packages\django\contrib\gis\gdal\geomtype.py", line 31, in __init__ raise OGRException('Invalid OGR String Type "%s"' % type_input) django.contrib.gis.gdal.error.OGRException: Invalid OGR String Type "srid=2029;point(17n 630084 4833438)" </code></pre> <p>Are there any example available to show how this is done?</p> <p>May be I should just do any necessary calulations in UTM and convert to decimal degrees?<br> In this case does GEOS or other tools in geodjango provide convertion utitilites?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload