Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KML georeferencing not working correctly #2180

Open
bimjarr opened this issue Sep 10, 2023 · 5 comments
Open

KML georeferencing not working correctly #2180

bimjarr opened this issue Sep 10, 2023 · 5 comments

Comments

@bimjarr
Copy link

bimjarr commented Sep 10, 2023

Openorienteeringmap V4 supports a choice of true north or magnetic north. When importing a georeferenced KML file I cannot find a way of placing it correctly aligned to a magnetic north referenced template.

Our (OrienteeringWairarapa) quick fire way of producing street events is:
Create a PDF and georeferenced KMZ using openorienteeringmap.
Create a georeferenced KML through one of several methods (Maprun, Google earth etc).
Create a new map in Mapper.
Open the KMZ file as a template
Import the KML file.
Create a PDF with the template visible.
The PDF can now be used as basemap in Purple Pen to allow various changes including cosmetic changes to controls.
The final step is to replace the Purple Pen basemap with the original PDF.

This process has always worked perfectly, and still does with a true north template, but not with a magnetic north based template.

Incidentally, Maprun does align both KMZ and KML file correctly when imported to it’s Create KML Course function.

@pkturner
Copy link
Contributor

Is the alignment incorrect as soon as you import the KML into the map that has the KMZ template? Or does the alignment problem appear later on?

I tried creating a new map with a KMZ template as you describe. When I import a KML track into that map, it is aligned and georeferenced correctly.

I don't understand what version of Mapper you are using. I'm using the latest release which is 0.9.5.

@pkturner
Copy link
Contributor

Another question.
What do you mean by "magnetic north based template"? When I attempted to reproduce this issue, I started in Mapper with a map that is oriented to magnetic north. When I exported a georeferenced KMZ, the internals of the KMZ file consisted of raster image squares oriented to true north. That could be expected, because KML/KMZ use a standard coordinate system based on latitude and longitude.

In Mapper, when you create a new map and immediately open a georeferenced template, Mapper prompts you to set the new map's georeferencing. When I opened the KMZ template, Mapper suggested a geoereferencing with a declination of 0, i.e. oriented to true north. At that point you can set the declination to a good local value. But whether I set the declination or not, after importing the KML track I see it aligned correctly with the template.

@cadnant
Copy link

cadnant commented Mar 17, 2024

OpenOrienteeringMap generates kmz map files that can be orientated to grid N, mag N or at an arbitrary angle. PDF output can be similarly rotated. Mapper will correctly rotate a PDF import but not a kmz import - see linked example files.

@pkturner
Copy link
Contributor

Thanks for the examples. They will help.

@dg0yt
Copy link
Member

dg0yt commented Mar 18, 2024

Mapper supports KML via the GDAL library. IIUC this KML file uses a rotation property in <LatLonBox> which is standardized but not implemented in GDAL:
https://github.com/OSGeo/gdal/blob/master/ogr/ogrsf_frmts/libkml/ogrlibkmlgeometry.cpp#L679-L704

There is an open issue for "Superoverlays" whatever this means:
OSGeo/gdal#6093

It also seems to affect QGIS and direct GDAL use:
https://duckduckgo.com/?q=kmz+rotation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants