I am extremely new to GIS.
gdal to read in a landuse/landcover map and I need to pick out the lat/lng of certain land cover types to index into a different dataset which is expressed only in lat/lng. Unfortuantely, I don't understand the form of the x and y coordinates given to me from the geotransform, specifically the
geotransform = dataset.GetGeoTransform() originX = geotransform originY = geotransform
Printing these values gives me coordinates like
(447466.693808, 4952570.40529). How do these relate to the original latitude and longitude?
Here's a simple python example that got me what I was looking for:
srs = osr.SpatialReference() srs.ImportFromWkt(dataset.GetProjection()) srsLatLong = srs.CloneGeogCS() ct = osr.CoordinateTransformation(srs,srsLatLong) print ct.TransformPoint(originX,originY)
Stolen from: tolatlong.py