Marius,
Please do file a ticket with a small shapefile that shows this error.
http://trac.osgeo.org/gdal/newticket
On Tue, Jul 12, 2011 at 8:30 AM, Marius Jigmond
mariusjigm...@hotmail.comwrote:
**
After some more investigation that is likely NOT the issue. I have an
ExecuteSQL statement
)
shapeLayer.SetAttributeFilter('DENJUD=CLUJ')
targetFeature = shapeLayer.GetNextFeature()
print targetFeature.GetField('DENJUD') # should print the DENJUD of the
feature fitting the attribute filter.
Date: Tue, 12 Jul 2011 09:13:00 -0400
Subject: Re: [gdal-dev] OGR Geometry methods
From: luke.peter
Indeed, SetAttributeFilter returns the right feature. Thanks Luke.
FYI the ExecuteSQL bug submission is http://trac.osgeo.org/gdal/ticket/4156
-marius
Date: Tue, 12 Jul 2011 12:31:03 -0400
Subject: Re: [gdal-dev] OGR Geometry methods
From: luke.peter...@gmail.com
To: mariusjigm
Hi everyone,
I am trying to test whether centroids of polygons lie/intersect within
another polygon. I have tried Intersect, Within, and Contains but they
always return false. Should these methods work for my intended purpose
or do I need to implement a point in polygon function? Thanks.
-marius
I suppose a piece of code speaks louder :):
xsect = False
for i in range(gridLayer.GetFeatureCount()):
feat = gridLayer.GetFeature(i)
geom = feat.GetGeometryRef()
point = geom.Centroid()
for j in range(aqLayer.GetFeatureCount()):
aqfeat = aqLayer.GetFeature(j)
aqgeom =
After some more investigation that is likely NOT the issue. I have an
ExecuteSQL statement which selects a certain polygon based on an
attribute value. Unfortunately it seems to return the wrong feature. The
feature I query for is unique so a duplicate is out of the question.
Here's the code: