Create maps for maptiler - android

I´m actually doing a CustomTileProvider for Android, but I dont have idea how can I create tiles from MapTiler. It ask´s me for a Raster map Files, but Is there any tool to generate this map files.

MapTiler (http://www.maptiler.com/) can process normal images - such as a scanned paper map saved as JPEG or TIFF. You can also create a map in Adobe Photoshop or similar software. See: Visually aligning a jpeg image to Google Maps in preparation for Photoshop tile cutter
MapTiler opens the standard GIS data formats too (GeoTIFF, ECW, MrSID, ...).
Free geodata (opendata) are avaialable on the web nowadays. For example:
topographic maps for hiking (USGS DRGs) at http://www.archive.org/details/maps_usgs
nautical charts for sailing (NOAA) at http://www.nauticalcharts.noaa.gov/mcd/Raster/
etc.
Some typical maps rendered with MapTiler are visible at http://tileserver.maptiler.com/:
The free geodata are available in USA and some countries in Europe from the government websites.
High-quality geodata can be also purchased from various commercial data providers.
UPDATE: MapTiler Desktop application and command-line MapTiler Engine can now also generate raster tiles from vector data input (typically in PDF or GeoPDF format).
MapTiler tools can produce also Vector Tiles (MVT) from ShapeFiles or other vector GIS data - which can be displayed with Android/iOS native GL accelerated components or with client-side styles in a web browser. Maps made with vector tiles can be freely zoomed and rotated - with placenames displayed always in a readable non-rotated form. Look at https://www.maptiler.com/maps/ to see such maps - and create an account to make similar maps like this on your own. ;-)

Related

Android OpenStreetMap tracker available offline

I'm new at osmdroid and I'm trying to build simple GPS tracking application that must work offline. So first of all I know that osmdroid works with .osm But how to download osm file directly to my android device and more importantly how later I need to use it. I dont understand .osm file is simply just xml with lots of coordinates and other data. So how that .osm file can be transform to a graphical map? I know that is necessary to parse .osm file to get data, but where to download actual graphical map?
osmdroid does not currently present .osm data, mainly due to performance reasons. osmdroid does render raster images that someone can capture into a zip or database and then transfer to device. The problem really is space. It's a big planet and getting raster images can be huge! You'd have to prepare geographic regions into a database then host them somewhere and have your app download them on demand.
osmdroid as a wiki on offline maps here:
https://github.com/osmdroid/osmdroid/wiki/Offline-Map-Tiles
An alternative approach is something like Mapsforge, which can preconvert .osm data into their own binary format, also chunked up by geographic region. Same rules apply, however the file/download sizes are much smaller. Support for osmdroid using Mapsforge is in beta at the moment, however mapsforge can run on it's own and has it's own demo apps and whatnot.
To transform the .osm file into a graphical map, you need something like renderd and a slew of other tools, all on open street maps wiki. Again, you need a boat ton of storage for the planet to convert it into raster images. Then you'd still have to package them somehow and get them on device.
Or you can just use online maps.

Use of Planet.osm with osmDroid for offline maps

does anyone know if it is possible to build an Android application using osmDroid that makes use of Planet.osm stored on an SD card?
for example, you would store Planet.osm on a large SD card that has been put in a phone. The application loaded on the phone would then look in the SD card for the relevent maptiles and allow the user to have a full map offline.
No, not as you would expect it.
The Planet contains raw vector data whereas osmdroid needs pre-rendered raster tiles. You would need a renderer on your mobile device but rendering is a very ressource-intensive task and not really suited for mobile devices. Unless you are using pre-processed data (and ideally a vector renderer) as done by multiple mobile apps like OsmAnd. Storing pre-rendered tiles could be an option, but only for limited areas as their storage requirements increase very fast.
You can take a look at mapsforge if you intend to add vector rendering to your application.

offline vector TileProvider that extends google map api v2 in android

I know there are some Android maps libraries that can render vector based tiles from OSM (*.map, etc.). But I did not found any library that only has engine to graphically render vector tiles and returns it as TileProvider to the Google maps api v2 for Android.
For the offline raster tiles: I know how to do for the raster tiles
(osmdroid jpg files). Good and working example:
TileProvider using local tiles.
Does anybody know where to find this for vector tiles?
Kind regards,
Toni
If you can find a library to render the vector tiles, or enough documentation of the format to write your own renderer, it's pretty easy to turn it into a TileProvider. Tile#data needs to be a compressed image in one of the supported image formats. Once you have a Bitmap, use Bitmap#compress(...) to write the data to a ByteArrayOutputStream, then use ByteArrayOutputStream#toByteArray() to get the data for the Tile.

Showing my raster map on mobile app (iOS/Android)

I'd like to show a map on my app and handling some events within it. I'm also need to load a background raster map to it (dwg format, which is the AutoCAD format for raster, but it doesn't really matter, since it can be converted to any other known format), doesn't matter if the file is local or remote.
I know very well how to id on desktop, but which options I have on mobile?
Thanks!
You have TileOverlays on Android and Tile Layers on iOS, which can both use remote and local data source.

Best way to deal with big (shape-)data for map in Android Application

I am building the prototype for an Android app that should result in a versatile map that can deal with a large but static amount of environmental data combined with (user-generated) data that will be hosted on a separate platform.
My current approach is to fetch the large static data via Google Fusion Tables (in original a shape file - .shp, .dbf, .shx that I have exported as a .kml with QGisMaps - the "smaller" .kml I am using is already 66.4MB, the one intended for final use over 140 MB...) I know it is possible to slice down .kml but will this have an effect on loading times?
You can see a current example of the shape data on Google Maps here https://www.google.com/fusiontables/DataSource?snapid=S717313eWaJ
But now I am wondering if I am on the right path at all since this one layer of data is loading very slowly on my machine and I am not aware of the hassle to put this map into an Android app - and more importantly also fetching more data from a separate server and putting it as another (filterable) layer on top of it. This layer will be collected data from users, thus not "static" but regularly updated - integer values displayed in color per geodata.
Several people hinted me to use Open Street Maps but some advised that Android is very eloquent with Google Maps - in the middle of development I thought maybe someone can tell me whether I chose the right direction to go for or are most likely facing less problems with an alternative solution.
I would be really glad if someone could advise me on the issue with combining map data from two different sources layerd onto one map in Android whereas one bunch of data is huge but static and the other user-generated values.
Thanks so much for your time and looking over this
best
Birgit
EDIT #1: I am now switching to Open Street Maps, hoping to be able to set up a GeoServer myself hosting the data and querying the WMS with the App. It seems like the size of the data still has to be compressed in some way, I will keep you updated.
I'll not be able to address all of your concernes, but I can share some of my experience with maps and ovelays.
The most important concept you must be aware is the memory heap. Each android application has a maximum memory amount that can be used to allocate data objects, called memory heap. This limit is different from device to device and can go from 16MB in small older devices to 64MB in new tablets.
Having said that, you will never be able to load all your data at one shot if the data structure required to hold it exceeds the maximum heap available for the application.
Also, usaging large amounts of memory makes your application better candidate to be terminated by users or by the SO when additional memory is required by critical activities (like a phone call).
Now, going to the maps part...
I've used Google maps as well as mapsforge api for OpenStreet maps. Google maps requires internet connection, while mapsforge enables you to use a local map file or online connection. OpenStree maps don't provide the sattelite view.
Regarding performance, online connection tends to be faster, as they download already rendered map images, while offline map requires the images to be rendered as needed. Mapforges can use a local cache to improve this a little.
Displaying Overlays:
I've used both API's to display paths with arround 10.000 points over a map, together with additional overlays (compass, scale bar, pop-ups, etc.) and the code runs smoothly in a mid-rande device. However, my code have some optimizations to reduce recreation of paths (when user zoom or move map) by transforming the already existing path.
good luck.
So this is how I eventually converted a .shp file into a format that could be displayed by OSMdroid's XYTilesource.
I exported the layers separately as .kml projected WGS84 and imported them as layers to TileMill. After having defied the colors for each layer in CSS, I exported my map as a set of MBTiles. I uploaded them to Mapbox.com. From there I can fetch the tiles which are in the format a.tiles.mapbox.com/v3/myUsername.myTiles/{z}/{x}/{y}.png in my OSMdroid Mapview.
final myTileSource tileSource = new XYTileSource("myTiles", null, 10, 16, 256, ".png", "http://a.tiles.mapbox.com/v3/myUserName.myTiles/");

Categories

Resources