Tuesday 30 August 2016

coordinate system - Obtaining longitude and latitude from GeoTIFF with geotools


Continuing what is written in this post, I have another question:


for each point (X, Y) of my GEOTIFF file I extract the coordinates as follows:


Envelope2D pixelEnvelop = geometry.gridToWorld(new GridEnvelope2D(x, y, 1, 1));

double[] coords = new double[]{pixelEnvelop.getCenterX(), pixelEnvelop.getCenterY()};


For example I obtain


-577460.1192321777, 640293.6331481934
-577460.1192321777, 639293.9553527832
... (and so on)

However, I would like to have latitude and longitude available. Is it possible to convert them?


For information, I print also the content of pixelEnvelop.getCoordinateReferenceSystem() method


PROJCS["unnamed", 
GEOGCS["WGS 84",

DATUM["World Geodetic System 1984",
SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["central_meridian", 12.5],

PARAMETER["latitude_of_origin", 42.0],
PARAMETER["scale_factor", �],
PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH]]

As you can see, scale_factor parameter does not contain a readable value.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...