On 2012-03-18, at 6:46 PM, Stephen Woodbridge wrote:

> Does this get you any closer to what you need:
> 
> SELECT OGR_GEOM_WKT, * FROM data;
> 
> -Steve

That's some nice ogr-foo to learn :)

Simon, it sounds like you could wrap this up pretty quickly in a python script 
too.
A rough approach example:

from osgeo import ogr
ds = ogr.Open("/tmp/on_geoname.shp")
l1 = ds.GetLayerByIndex(0)
for f in range(l1.GetFeatureCount()):
 printme = []
 g1 = l1.GetFeature(f)
 for fld in range(g1.GetFieldCount()):
  printme.append(g1.GetFieldAsString(fld))
 gr1 = g1.GetGeometryRef()
 printme.append(str(gr1.GetX()) + "-" + str(gr1.GetY()))
 print printme

For what it's worth,
Tyler

_______________________________________________
Discuss mailing list
Discuss@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/discuss

Reply via email to