[gdal-dev] kml to wld

Daniele Romagnoli daniele.romagnoli at geo-solutions.it
Tue Oct 2 05:10:28 PDT 2018


Hi Luca,
actually, the coefficients of a world file aren't simply pixel size and
rotation. Therefore, with a rotation in the mix, you may need to do some
math :(
You may want to take a look a the world file definitions to see what these
6 coeffs represent:
https://en.wikipedia.org/wiki/World_file

I never had to deal with such cases so I can't provide you additional
information.
However, looks like someone else already faced that problem:
https://gis.stackexchange.com/questions/12181/how-to-generate-a-world-file-with-rotation

Hope this provides you some hint to solve the problem.
Regards,
Daniele





On Tue, Oct 2, 2018 at 1:37 PM Luca Delucchi <lucadeluge at gmail.com> wrote:

> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
Regards,
Daniele Romagnoli
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181002/3313f2fd/attachment.html>


More information about the gdal-dev mailing list