Anyone have a tile server recommendation that can supply the blue marble data to a Cesium map that has no connectivity to the internet?
Thanks in advance!
-J
Anyone have a tile server recommendation that can supply the blue marble data to a Cesium map that has no connectivity to the internet?
Thanks in advance!
-J
Hi,
One easy way to do it is to grab the Blue Marble source data, tile it up with MapTiler (http://www.maptiler.org/) and then access the pile of static files MapTiler created using Cesium’s TileMapServiceImageryProvider. At that point you can use any standard web server to serve the imagery.
Kevin
Is it possible to do something like that with the planet.pbf data from http://wiki.openstreetmap.org/wiki/Planet.osm ?
I’ve managed to use Maperitive to generate Tiles from .pbf but when I try to load that as the new source it says
tilemapresource.xml 404 (Not Found)
``
how can I generate an xml for my tiles? or what is the structure so I can create it myself?
Maperative generates a JSON file instead of an xml and this is its structure
{
“tilejson”:“1.0.0”,
“name”:“My Map”,
“description”:“Made with Maperitive”,
“attribution”:“Map data © OpenStreetMap contributors”,
“tiles”:
[
“tiles/{z}/{x}/{y}.png”
],
“minzoom”:11,
“maxzoom”:15,
“bounds”:
[
4.5689989657938037,
51.201442305146031,
4.9943794818540823,
51.307795143935138
],
“center”:
[
4.7816892238239426,
51.254618724540585,
11
]
}
``
Hi David,
It would be very straightforward to write a Cesium ImageryProvider to work with this tileset, but I don’t think any of the out-of-the-box ones will work. Take a look at TileMapServiceImageryProvider.js and see if you can adapt it. The hardest part will probably be figuring out what to call the new ImageryProvider type. Let me know if you have any questions, and we’d welcome a pull request if you’re able to implement it cleanly.
Thanks,
Kevin
Ok I’ll look into that, for now I’ve found that Maperative can create Mbtiles for OSM and Qgis can create a GeoJson from mbtiles if anyone is interested.
Quick Update: Simple Solution to Offline Map
OSM data: http://wiki.openstreetmap.org/wiki/Planet.osm (Download a region or planet, be sure to get ‘.pbf’ compressed format)
OSM Convert: http://wiki.openstreetmap.org/wiki/Osmconvert
Maperative: http://maperitive.net/
Infostreams mbtiles-php: https://github.com/infostreams/mbtiles-php
apache: http://httpd.apache.org/
ex:
``
generate-mbtiles minzoom=5 maxzoom=16
``
rename it to what you like (ex: OpenStreetMap.mbtiles)
ex:
var viewer = new Cesium.Viewer(‘cesiumContainer’, {
imageryProvider : new Cesium.OpenStreetMapImageryProvider({
url : ‘http://localhost/server/OpenStreetMap’
}),
baseLayerPicker : false
});
``
David - thanks for the walk-through. Do you have blog? This would be a great post as a mini-tutorial.
Patrick
I don’t, I have a makeshift mediawiki that isn’t guaranteed to always be online.
http://longlostbro.com/mediawiki/index.php/OpenStreetMapTileServer
You are more than welcome to host a tutorial with the provided information.
Thanks David. I’ll make a note of it.
Patrick
I was also able to get it to work without the php requirement, using only node js by replacing the mbtiles-php with https://github.com/mapbox/tilestream
that requires a rectangle when adding the provider, otherwise the map won’t show up.
new Cesium.ImageryLayer(new Cesium.OpenStreetMapImageryProvider({
url: ‘http://localhost:8888/v2/OpenStreetMap/’,
rectangle: new Cesium.Rectangle.fromDegrees(-112.69, 39.89, -110.85, 41.22),
minimumLevel: 0,
maximumLevel: 15
})