[gdal-dev] Transform pixel coordinates

Andre Joost andre+joost at nurfuerspam.de
Sat Oct 25 00:09:43 PDT 2014


Am 25.10.2014 um 07:05 schrieb Artur Bercik:
> On Sat, Oct 25, 2014 at 2:00 PM, Andre Joost <andre+joost at nurfuerspam.de>
> wrote:
>
>> Am 25.10.2014 um 06:03 schrieb Artur Bercik:
>>
>>> Dear GDAL users
>>>
>>> I have a raster image of 406 lines and 270 samples with 5km pixel size.
>>> The
>>> center coordinates (lats and lons in degrees in GCS) of upper left pixel,
>>> and the center coordinates (lats and lons in degrees in GCS) of the lower
>>> right pixel  are given, how can I calculate the coordinates of upper left
>>> corner (ulx and uly) and the coordinates of lower right corner (lrx and
>>> lry)?
>>>
>>>
>> You need to know the projection definition to calculate from distance in
>> pixel or km to degrees.
>>
>
> yes the projection are in GCS with WGS84 datum
>

GCS has units of degrees, not kilometers. Your image is 2030x1350 km, 
but you have to know if it is Mercator, Transverse Mercator, Lambert 
Coformal Conical, Stereographic, Albers Equal Area, Sinusoidal or 
whatever. And you have to know the origin of the projection, like 
Central meridian of UTM projections. And if North is upwards or not.

Greetings,
André Joost




More information about the gdal-dev mailing list