Hello everyone!
I have tried the following code:
I am wondering if there is the possibility to import variables X, Y in the place of the number coordinates (red coloured text) in order to perform a for loop among several x, y coordinates.
Thank you very much.
I have tried the following code:
Code:
from osgeo import ogr
LandUse = ogr.Open("C:\\Python26\\ArcGIS10.0\\landuse shpfile (polygon)\\landuse.shp")
lyr = LandUse.GetLayerByName("landuse data_ypan")
lyr.ResetReading()
point = ogr.CreateGeometryFromWkt("POINT(503234.931458 3443753.43622)")
for feat in lyr:
geom = feat.GetGeometryRef()
if geom.Contains(point):
sm = feat.GetField(feat.GetFieldIndex("Land_Group"))
print smThank you very much.