[gdal-dev] kml to wld

Luca Delucchi lucadeluge at gmail.com
Tue Oct 2 04:37:26 PDT 2018


Hi all,

I need to use the coordinates information contained in a kml file to
write a wld file.

In the KML I have

<LatLonBox>
    <north>47.551729</north>
    <south>45.438335</south>
    <east>12.736706</east>
    <west>9.670600</west>
    <rotation>-1.35</rotation>
</LatLonBox>

I converted them to UTM WGS84 32N coordinate system

<LatLonBox>
    <north>5273247.79</north>
    <south>5031864.43</south>
    <east>781130.01</east>
    <west>552448.98</west>
    <rotation>-1.35</rotation>
</LatLonBox>

I calculated the resolution doing the differences between north/south
and east/west and I get 251.441 and 238. To have squared pixel I would
set to 250 (maybe it could be better to use 240?).

with this info I created the wld file

250
-1.35
-1.35
250
552448.98
5273247.79

The reprojection works quite well, but it seems shifted by some
pixels, does the procedure make sense or is completely wrong?

PS
With latlong values the image is located in a wrong place, but the wld
seems correct, maybe the pixel value is wrong.

0.002201452083
-1.35
-1.35
-0.002201452083
9.670600
47.551729


-- 
ciao
Luca

www.lucadelu.org


More information about the gdal-dev mailing list