-
Notifications
You must be signed in to change notification settings - Fork 75
Globe renderer
Starting from 2.3 release, Nutiteq SDK supports globe map rendering. This is implemented as special render projection. It is simple to use and requires minimal changes in code in most cases. To switch to globe rendering mode, simply specify spherical render projection option:
mapView.getOptions().setRenderProjection(Options.SPHERICAL_RENDERPROJECTION);
Likewise, to switch it off, use:
mapView.getOptions().setRenderProjection(Options.PLANAR_RENDERPROJECTION);
View-specific parameters like focus point, rotation, tilt are carried over the switch.
There are few limitation that may need changes in source code:
- Sky rendering is not currently supported, backdrop image is recommended instead. Backdrop image can be specified using Options.setBackgroundImageBitmap and Options.setBackgroundImageDrawMode(Options.DRAW_BACKDROP_BITMAP)
Globe rendering requires considerably more resources that flat rendering. There are few options that may increase performance when switched off:
-
Tile fading (in extreme cases may increase performance up to 2x)
-
Background plane/sphere rendering (may increase performance up to 2x)
-
Tile preloading (has much less impact)
The number of visible raster tiles varies depending on latitude. Near poles tiles are more compressed, thus more textures are needed and performance is somewhat lower.
Most available tilesets use EPSG3857 projection, which works but it has some performance penalty and they do not cover poles. So if possible then EPSG4326 tilesets are recommended.
Here are some MBTiles format tilesets (zoom range 0-5), which are in EPSG4326:
a) From Natural Earth
- https://db.tt/uFKYrAS5 - from NE2_HR_LC_SR_W_DR.tif (with rivers and lakes)
- https://db.tt/PsG3MLLM - from NE2_HR_LC_SR_W.tif (no rivers and lakes)
b) From NASA Blue Marble NG, similar resolution but nicer:
- BlueMarble_WTB_200408_EPSG4326.mbtiles - Blue Marble NG (2004 August)
- BlueMarble_WTB_200408_webp_EPSG4326.mbtiles - Blue Marble NG (2004 August), more zooms (0..7) and 2x smaller file using webp. Requires Android 4.0+
- https://db.tt/GyUSujKu - NASA Visible Earth: Night Lights 2012
c) Others:
- TrueMarble_epsg4326.mbtiles - from True Marble™ by Unearthed Outdoors
- [TileMill Geography class] (https://dl.dropboxusercontent.com/u/3573333/mapdata/global_mbtiles/geography-class_world.mbtiles) - it is EPSG3857
Usage as base layer. Note that projection is EPSG4326 here:
try {
MBTilesRasterDataSource dataSource = new MBTilesRasterDataSource(new EPSG4326(), 0, 5, "/sdcard/BlueMarble_WTB_200408_EPSG4326.mbtiles", false, this);
RasterLayer mapLayer = new RasterLayer(dataSource, 1508);
mapView.getLayers().setBaseLayer(mapLayer);
} catch (IOException e) {
e.printStackTrace();
}
- Zoom bias may need to be set (Options.setTileZoomLevelBias). This is caused by tiles being inflated near equator while being compressed near the poles.