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

KMZ export #138

Closed
dg0yt opened this issue Nov 13, 2012 · 8 comments · Fixed by #1793
Closed

KMZ export #138

dg0yt opened this issue Nov 13, 2012 · 8 comments · Fixed by #1793

Comments

@dg0yt
Copy link
Member

dg0yt commented Nov 13, 2012

puzzlepaint reported on Sourceforge [tickets:#138]:

Add kmz export capability, optionally only for selected objects. For georeferenced maps only.
The internal process would be to export the map as raster image and cut it into tiles.

This can be used for example to display the map in Google Earth as overlay or use it as custom map on some Garmin devices.

@harzol
Copy link

harzol commented Nov 5, 2020

This can be very useful for me.

Today I'm using OCAD to convert omap file to kmz.
First I have to save as OCAD file, than I can export KMZ file from OCAD.

But now I'm faceing an issue when I save ocad file in oomapper. - "Coordinates are adjusted to fit into the OCAD 8 drawing area"

How is it possible to turn off this coordinate adjustion?

@dg0yt
Copy link
Member Author

dg0yt commented Nov 5, 2020

Today I'm using OCAD to convert omap file to kmz.
First I have to save as OCAD file, than I can export KMZ file from OCAD.

Thanks to GDAL, we do have KMZ export via File > Export as... > Geospatial vector data. However, it is probably not what you will expect after using the other software, or from the first post here.

(I recently read how MapRun wants maps to be exported to KMZ: raster tiles indeed, not vector data.)

But now I'm faceing an issue when I save ocad file in oomapper. - "Coordinates are adjusted to fit into the OCAD 8 drawing area"

How is it possible to turn off this coordinate adjustion?

Don't use OCD 8. If you think there is a bug in loading or saving your file, please open a separate issue.

@SimonStarkey
Copy link

This would be a useful feature with our increasing use of MapRun through lockdown. Currently exporting map as an image then re-referencing the map in the MapRun utility

@dg0yt
Copy link
Member Author

dg0yt commented Dec 12, 2020

This would be a useful feature with our increasing use of MapRun through lockdown.

Sure. Implementing export should be more feasible once I can load the result into Mapper again. So I'm working on KMZ reading at the moment, in order to verify the expected results.
#1793
OpenOrienteering/superbuild#85

Currently exporting map as an image then re-referencing the map in the MapRun utility.

There is also a webservice which accepts JPG+world file to create KMZ, but you must temporarily change the georefencing of the map before JPG export:
http://maprunners.weebly.com/maps---kmz-files.html
http://www.p.fne.com.au/rg/cgi-bin/o-utils.cgi

@SimonStarkey
Copy link

SimonStarkey commented Dec 12, 2020 via email

@dg0yt dg0yt modified the milestones: v1.0, v0.9.5 Dec 19, 2020
dg0yt added a commit that referenced this issue Dec 20, 2020
Add export of KML/KMZ ground overlay files, based on MapPrinter's page
drawing and GDAL's vsizip virtual file system. Other than our existing
output variant (raster, PDF, printing), KML needs raster images
oriented to true north.
Formally, this is a "KML" export, with "KMZ" being a zipped variant.
Following populer recognition and usage, we prefer labelling as "KMZ".
Resolves GH-138 (KMZ export).
dg0yt added a commit that referenced this issue Dec 20, 2020
Add export of KML/KMZ ground overlay files, based on MapPrinter's page
drawing and GDAL's vsizip virtual file system. Other than our existing
output variant (raster, PDF, printing), KML needs raster images
oriented to true north.
Formally, this is a "KML" export, with "KMZ" being a zipped variant.
Following populer recognition and usage, we prefer labelling as "KMZ".
Resolves GH-138 (KMZ export).
@dg0yt
Copy link
Member Author

dg0yt commented Dec 21, 2020

Implementation notes

  • The tile size is fixed at 512x512 pixels.
  • The image format is fixed as JPG, quality 75/100.

KMZ requirements for MapRunF (http://maprunners.weebly.com/maps---kmz-files.html):

  • 512x512 tiles.
  • 150dpi: User choice.
  • KMZ size max 1 MB: Not checked, but indirectly controlled by user via resolution and map area.
  • Raster files named files/tile_x_y.jpg (c9856ca)

KMZ requirements for Garmin (https://support.garmin.com/en-IE/?faq=FtEncUXbaE0xE04yZ7gTq5):

  • KML file named doc.kml.
  • Image format is JPEG.
    • without progressive image: default setting of Qt's JPEG writer.
  • Image size not over 1 megapixel.
  • Image size less than 3 MB: Not checked, but reasonable assumtion for tile size and quality parameter.

@dg0yt
Copy link
Member Author

dg0yt commented Dec 22, 2020

  • 150dpi: User choice.

Not yet entirely true for Windows: #1815

@dg0yt
Copy link
Member Author

dg0yt commented Dec 25, 2020

Oh, MapRunF is much more restricted than expected:

Error: Error in the file content - Error in the KMZ file format - (Exception: Tiles in the KMZ file need to be named as a grid of files/tile_x_y.jpg - Instead found: files/0.jpg)

dg0yt added a commit that referenced this issue Dec 26, 2020
#138 (comment)
At the same time, use safe integer variables for looping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants