Hi list,<br>I&#39;m creating a shapefile using the OGR python bindings. (from  the 1.6.1 installer)<br>I have some issues in creating the boundingBox for it.<br>This is a snippet of the code I&#39;m using:<br>-----------------------------------------------------<br>
from osgeo import ogr<br>from osgeo import osr<br>....<br>....<br>northings_llc = dd[&#39;northings_llc&#39;]<br>northings_urc = dd[&#39;northings_urc&#39;]<br>eastings_llc = dd[&#39;eastings_llc&#39;]<br>eastings_urc = dd[&#39;eastings_urc&#39;]<br>
t_srs = osr.SpatialReference()<br>t_srs.SetFromUserInput(&#39;EPSG:32632&#39;)<br>drv = ogr.GetDriverByName(&#39;ESRI Shapefile&#39;)<br>ds = drv.CreateDataSource(fileout)<br>x0, y0, x1, y1 = str(eastings_llc[0][0]), str(northings_llc[0][0]), str(eastings_urc[0][0]), str(northings_urc[0][0])<br>
<br>layer = ds.CreateLayer(ds.GetName(), geom_type = ogr.wkbPolygon, srs = t_srs)<br>geom = ogr.Geometry(type = layer.GetLayerDefn().GetGeomType())<br>geom.AssignSpatialReference(t_srs)<br>wkt = &#39;POLYGON(&#39;+x0+&#39;,&#39;+y0+&#39;,&#39;+ x0+&#39;,&#39;+ y1+&#39;,&#39;+ x1+&#39;,&#39; +y1+&#39;,&#39;+ x1+&#39;,&#39; +y0+&#39;,&#39;+ x0+&#39;,&#39; +y0+&#39;)&#39;<br>
print(wkt)<br>geom.importFromWkt(wkt)<br>...<br>...<br><br>When running, I get this output:<br>POLYGON(602759.984846,4739727.96408,602759.984846,4739720.3473,602760.45247,4739720.3473,602760.45247,4739727.96408,602759.984846,4739727.96408)<br>
Traceback (most recent call last):<br>  File &quot;prova.py&quot;, line 42, in &lt;module&gt;<br>    geom.importFromWkt(wkt)<br>  File &quot;c:\python26\lib\site-packages\osgeo\ogr.py&quot;, line 2672, in &lt;lambda&gt;<br>
    __getattr__ = lambda self, name: _swig_getattr(self, Geometry, name)<br>  File &quot;c:\python26\lib\site-packages\osgeo\ogr.py&quot;, line 34, in _swig_getattr<br>    raise AttributeError,name<br>AttributeError: importFromWkt<br>
<br clear="all">Indeed, looking at the ogr.py there is no &quot;importFromWkt&quot; in the Geometry definition.<br>How can I set the bounding box within the geometry?<br>Any help would be greatly appreciated.<br><br>Best Regards,<br>
Daniele<br><br>-- <br>-------------------------------------------------------<br>Eng. Daniele Romagnoli <br>Software Engineer<br><br>GeoSolutions S.A.S.<br>Via Carignoni 51<br>55041 Camaiore (LU)<br>Italy<br><br>phone: +39 0584983027<br>
fax:     +39 0584983027<br>mob:   +39 328 0559267<br><br><br><a href="http://www.geo-solutions.it">http://www.geo-solutions.it</a><br><br>-------------------------------------------------------<br><br>