How to display .mbtiles on a hosted server - hosted

I am using the containerized deployment of openmaptiles. I downloaded all the basic included base maps, (dark-matter, positron, etc..). Then I downloaded the satellite tiles separately from https://openmaptiles.com/downloads/planet/ . Now I have a satellite.mbtiles that I have placed in the same location as my config.json and osm-2017-07-03-v3.6.1-planet.mbtiles. But when I hit the hosted page that shows the available tiles I have, the satellite files are not there. What do I need to do to pull these satellite files I have?
To link to the current dark-matter tiles I am using something like: http://localhost/styles/dark-matter/{z}/{x}/{y}.png , what would I need for the satellite?
Also we do have a business package purchased from these guys so nothing should hamper any of this.
TLDR: How do I utilize two .mbtiles at once, using the hosted deployment.

Related

Downloading OpenStreetMap maps as png-images without a browser

Currently I am using Selenium and Folium to download OpenStreetMap maps... The issue I am encountering now is that, for my next assignment, I have to download 5 million images, and my current Python script is too slow. Having that one running in the background for hours on my laptop is not really an option.
Currently, my script opens the browser, saves the screen and extracts the nxn pixels image I need.
Does anybody know of a smarter way of extracting maps from OpenStreetMap?
Currently, I have a CSV list of 5'ish million x & y coordinates of points, and I need to download a map for each one of these in png-format... How should I proceed?
I hope you are not downloading from openstreetmap.org tile servers, because this is strictly discouraged as you can see on https://operations.osmfoundation.org/policies/tiles/ under "Bulk Downloading".
It might make sense for you to setup an own tileserver or subscribe to some tile-server service. There are static map services, which allow you to download the combined map image of an area, see
https://justmarkup.com/articles/2014-05-27-overview-of-static-map-solutions/#openstreetmap
for example.
This mentions Mapquest and Mapbox.

Is there any way to split data files into smaller chunks in Unity WebGL builds?

I am limited to the size of web applications I can build by the "Build\application.data" file.
I.e if its over a certain size I cannot upload it certain hosts, github, etc.
Ideally I would like to split the application into multiple data files under a certain size, while the application is still executable.
How would this be possible? Is this something I can do from Unity build configuration?
Can I do it after the build is done?
Can I split the file into chunks by archiving it with zero compression, and somehow still execute it from the browser? There is a file called Build.Loader.js, is it something that can be edited for this purpose?
This is for the purposes of using the application after it has been uploaded, not sharing it, I do not want to compress it into separate archives, or use gitlfs, I've tested this and the application does not work from the browser with github and gitlfs.
Thanks
Unity has 2 technologies for split data file:
Asset bundle
An AssetBundle is an archive file that contains platform-specific
non-code Assets (such as Models, Textures, Prefabs, Audio clips, and
even entire Scenes) that Unity can load at run time
Addressbles
The Addressable Asset System allows the developer to ask for an asset
via its address. Once an asset (e.g. a prefab) is marked
"addressable", it generates an address which can be called from
anywhere. Wherever the asset resides (local or remote), the system
will locate it and its dependencies, then return it.
Both technologies create separate files that you can host on a server and download as needed. Addressable is a newer technology that Unity team recommends.
Probably the total size of the bundle will grow, but user will be able to download only the necessary assets and the amount of data for the user may decrease
If you do not use Unity solutions, you can divide data file into parts. But on the client side (javascript) you will need to download all the parts, connect them and pass to Unity loader. You probably won't be able to use the browser's built-in gzip or brotli (not sure). It seems to be quite difficult.

tileserver on Github pages

Does anyone know how I can have a tile server hosted on Github pages please. I am making my own pyramid of image tiles (using either pyvips or gdal) but instead of having the tile server locally on my machine, I would like to populate a Github with these tiles and then set my application to fetch the appropriate tiles from that repo.
Any pointers highly appreciated.
Yes !
You can check https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames that will explain to you the url convention used for serving tiles.
You can then create folders of images on github with the same structure : zoom level / x_coordinates / y_coordinates.png.
I've created and test github folder.
Here is the demo page
You can see a tile being displayed, and it is served from github.

Use existing offline raster mbtiles to display on mapbox map

I'd like to transition the map in my app from currently Apple-Maps-SDK to Mapbox. My users already downloaded a lot of offline maps into several .mbtiles tiles containing raster data.
My question now is if it's possible to still use those while the user will be transitioning to the new maps? I just don't simply want to delete all offline maps and tell the user that he needs to download everything again right now, but rather give them a time-window to do that...
I was looking at MGLRasterTileSource/MGLSource and thought that I can create a subclass and somehow provide my own data to the map, but this does not seem to be supported. There are no datasource methods on it for that purpose...
Would be great if somebody could point me into the direction on how to archive what I want.
EDIT:
So I thought it might work that way... I migrate my existing raster tiles into a downloaded pack inside the mapbox offline database. So I had a look at the caches.db but at least the data in there is not just a plain png/jpg (tried with the mapbox satellite images, which should be raster).
Cause there is no public interface for getting existing raster-tiles in there, is there?
I've seen an other solution where somebody is hosting a webserver inside the app... but that somehow looks like quite an overkill to me?!?
https://gist.github.com/namannik/3b7c8b69c2d0768d0c2b48d2ed5ff71c

How to use download openstreetmap file to serve a local map app?

I have download a partial area data file (OSM format) to local. I have a local server which not connect to internet. So I want to build a local map app only with local OSM file (I use OpenLayer js).
I searched openstreetmap.org wiki, but find no solution.
Is there any way or documentaton to solve this?
By "local" you mean local on your machine or a local web server?
First you need to generate map tiles. Then you prepare the map HTML, including the OpenLayers code. The tile URL should point to your tiles (in case of a local machine, just use the "file://" protocol for URLs).
Here's one way how you can generate tiles (you can skip some of the steps): http://braincrunch.tumblr.com/post/9921938947/maperitive-tutorial-a-hiking-web-map-in-ten-easy-steps
1) i have to create an API that connects to a locally downloaded openstreet map and does to following:
2) Given a GPS location display the location on the map.
3) Be able to display the route to the location and update while the individual is on the move.
Numbers 2) and 3) are not yet my problem. number 1) is my problem for now. i don't even know where to start. i have been searching but still saw nothing i can understand.
what i want to know is: where to download OSM that i would be able to use locally? an example or a tutorial on an API that connects to the map locally and able to display it(and maybe able to zoom in, zoom out)?
the API can be in java, c#, or c++. but any other language is welcome as i have no choice.