lib-open-swiss-maps-sdk icon indicating copy to clipboard operation
lib-open-swiss-maps-sdk copied to clipboard

Offline XYZ tile generation

Open luzianscherrer opened this issue 3 years ago • 4 comments

In my iOS app I need the XYZ tiles (http://api.geo.admin.ch/services/sdiservices.html#xyz) like the ones that are available from the GeoAdmin API online service. Is this SDK able to produce those files? And if so, can it produce them also in an offline fashion so that one can download the material and then have the SDK generate those files without the need for an internet connection?

Should I instead check out the Open Mobile Maps SDK or is my requirement completely out of the scope?

The background for my question is that I need to provide that data to a Google Maps SDK GMSTileLayer (https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_tile_layer).

Any pointers would be much appreciated!

luzianscherrer avatar May 19 '22 18:05 luzianscherrer

The lib-open-swiss-maps-sdk and Open Mobile Maps SDK do not render vector data to raster tiles. It parses the WMTSCapabilities and renders the raster tiles using metal and OpenGL on mobile devices. We do not interoperate with the Google Maps SDK. I think you might be able to use swisstopo tiles in the EPSG:3857 projection directly with the Google Maps SDK.

stmitt avatar May 20 '22 06:05 stmitt

Thanks for getting back to me.

The Swisstopo API for the EPSG:3857 tiles is working fine but my issue is that I need an offline functionality.

I'm looking for a way to download the data and then render the tiles on the mobile device. Sorry to be asking again, but it is still not 100% clear to me: so producing the tile images using lib-open-swiss-maps-sdk or Open Mobile Maps SDK on the mobile device is not possible?

Outside of that question and in general: does the lib-open-swiss-maps-sdk or Open Mobile Maps SDK have any offline capabitilies or does it only work online?

luzianscherrer avatar May 20 '22 07:05 luzianscherrer

lib-open-swiss-maps-sdk and Open Mobile Maps SDK only work online and does not have any offline capabilities build-in apart from default url caching behaviour. What do you mean by producing the tile images? The pre-rendered raster tiles are already provided by wmts service of swisstopo.

stmitt avatar May 20 '22 11:05 stmitt

By producing the images I've ment the following:

In the Google Maps SDK for iOS you have a GMSSyncTileLayer method that takes XYZ parameters as input and returns an image. This can be used to provide the Google map with tiles locally in an offline context.

I was hoping that maybe the lib-open-swiss-maps-sdk or Open Mobile Maps SDK was able to download the map content and then produce those images in order to feed it to the Google map. This is the way I'm using another framework to generate an offline map in a Google Maps SDK context (as in [frameWork getTileBitmapWithSize:256 andZoom:zoom andX:x andY:y]).

luzianscherrer avatar May 20 '22 12:05 luzianscherrer