[gdal-dev] retrieving geometry vesus .GetGeometryRef() function

2013-02-16 Thread David Verbyla
I'm looking for documentation explaining when to use .geometry instead of .GetGeometryRef(() for example: >>> testPoly1 = square1.geometry() >>> testPoly2 = square1.GetGeometryRef() the seem to both return the same polygon object ___ gdal-dev mailing li

[gdal-dev] THANK YOU!

2013-02-05 Thread David Verbyla
e_points.shp', 0)#0--read-only > layer = ds.GetLayer() > layerName = layer.GetName() #returns string 'three_points' > test = ds.ExecuteSQL('select * from "%s"' % layerName) > > Cheers, > > Homme > > On Tue, Feb 05, 2013 at 12

[gdal-dev] Python ogr DataSource.ExecuteSQL syntax?

2013-02-04 Thread David Verbyla
QL: testLayer = dataSource.ExecuteSQL("select * from fireLayer") type(testLayer) #retuns NoneType testLayer = dataSource.ExecuteSQL("select * from fireLayer where FIREID < 75") type(testLayer) #retuns NoneType Thanks in advance. Dave Verbyla On Sat, Dec 22, 2012 at 7:17 AM, David Verbyla

Re: [gdal-dev] OSR Python: nearest polygon distance from each point feature?

2012-12-22 Thread David Verbyla
> I am a newbie to OGR/OSR using Python 2.7.2, please excuse my ignorance: > I am trying to find the distance to the closest polygon for each point. > Is there a more efficient way than simply computing the distance to all > polygons for each point? For example: > nPts = pointsLayer.GetFeatureCou

[gdal-dev] Layer.GetNextFeature() does not seem to get the next feature (Python 2.7.2, GDAL1.9.2

2012-12-20 Thread David Verbyla
I have a layer of 15 polygons from a shapefile. I can access the features using Layer.GetFeature(i), but not using Layer.GetNextFeature(). For example: >>> polyFeature = pondsLayer.GetFeature(0) >>> print polyFeature.GetFID() 0 >>> polyFeature = pondsLayer.GetFeature(1) >>> print polyFeature.GetF

[gdal-dev] OSR Python: SR.ImportFromEPSG(4326), SR.ImportFromESRI(strPrj) return null values

2012-12-16 Thread David Verbyla
I am a newbie to OGR/OSR using Python 2.7.2, please excuse my ignorance: I'm having problems creating spatial reference using either .ImportFromEPSG or .ImportFromESRI(prjfile string). Yet .SetWellKnownGeogCS works fine. from osgeo import ogr import osr,os testSR = osr.SpatialReference() testSR.S