I'm using the GDAL libraries via the c# wrapper and have hit a problem when using geotiff's where the co-ordinates are from a state plane zone. Previously I was having trouble getting the correct affine co-ordinates converted to lat/lng.
Having figured out the problem there, I now find that when I get the GeoTransform values from the dataset, it contains lat/lng rather than the affine co-ordinates. This makes it harder to calculate he co-ordinates of each corner of a raster. (In fact, I'm not sure how to do that).
On top of that, I have to somehow detect that this raster is going to give me lat/lng rather than affine co-ordinates. The API doc doesn't mention that lat/lng may turn up in the GetGeoTransform()...should it?
My code:
double[] geot = new double[6]; ds.GetGeoTransform(geot);
returns: -77.5286920001666, 1, 0, 38.728995261289775, 0, -1
Is there some way I can either find the affine co-ordinates using the lat/lng, or even better, get the dataset object to give me the affine co-ordinates instead of the lat/lng?
EDIT: Adding GetProjectionRef() here: PROJCS["NAD_1983_HARN_StatePlane_Virginia_North_FIPS_4501_Feet", GEOGCS["NAD83(HARN)", DATUM["NAD83_High_Accuracy_Reference_Network", SPHEROID["GRS 1980",6378137,298.2572221010002, AUTHORITY["EPSG","7019"]], AUTHORITY["EPSG","6152"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4152"]], PROJECTION["Lambert_Conformal_Conic_2SP"], PARAMETER["standard_parallel_1",39.2], PARAMETER["standard_parallel_2",38.03333333333333], PARAMETER["latitude_of_origin",37.66666666666666], PARAMETER["central_meridian",-78.5], PARAMETER["false_easting",37673535.76388889], PARAMETER["false_northing",21527734.72222222], UNIT["us_survey_feet",0.3048006096012192], AUTHORITY["EPSG","2853"]]
Aucun commentaire:
Enregistrer un commentaire