I am currently trying to import an offline map to nutiteq.
I have downloaded a map from OpenStreetMap but that map has an .osm extension.
How can I import that kind of extension to Android ?
As scai mentions, .osm is raw data file which cannot be directly used. .osm is data exchange format and it needs processing to be used in applications, including apps with Nutiteq SDK. Main missing piece from .osm file is visual styling: .osm file defines coordinates of objects and identity (e.g. that a line is "highway"), but it gives no hint whatsoever how to draw it - with which colors, line width etc.
What I'd suggest to try is to convert .osm file to .map file using osmosis, and then use mapsforge library to render a map like shown in Nutiteq wiki page. Mapsforge includes some default style, but you can find nicer stylesheets. There are several providers for readymade and up-to-date .map files with OpenStreetMap data, so maybe you do not need to do the conversion, one of them is AndroidMaps who even includes even several stylesheets.
.osm is just OSM's XML file format containing elements and tags. That is, it contains raw data. According to the nutiteq website nutiteq doesn't support this format directly. But it supports various other formats like MBTiles which are suitable for offline use.
Related
Suppose you made a map in QGIS then used the tool "Generate XYZ Tiles" to create a directory or MBTiles file of XYZ Map Tiles. Is it possible to display that on an Android phone using OSMdroid?
If it isn't, is there another way?
Not sure about osmdroid, but it looks it's possible. For sure you can use tiles in OSMAnd (in a bit weird way, I have to admit, as overlay). OruxMaps supports tiles as well. You can check MOBAC (https://sourceforge.net/projects/mobac/) for possible outputs / programs which accepts the tiles.
For mbtiles with mobac, please see: https://gis.stackexchange.com/questions/294022/open-a-local-mbtiles-map-in-mobile-atlas-creator-mobac
I am creating an offline map application using osmdroid. I have downloaded a complete map of my country in the form of <country>.osm.bz2 from here. This zip file weighs about 170 MB and when unzipped, it becomes a 2.3 GB xml file. How can I use this file in my application. Can I use it in bz2 format or should I extract it first?
There is a similar question on StackOverflow, but it does not state which map format they want to work with offline.
I didn't find anything on how to use osm or osm.bz2 files specifically.
osmdroid does not support the .osm format. You can use mapsforge, assuming conversion from the .osm format into their format which would give you the desired effect.
I'm developing an offline routing application for android.
I'm working with osmdroid library. and I downloaded the pbf file for the region where I want to do the offline navigation but I'm not sure how to be able to convert the binary representation of the maps in the pbf files into a normal text.
You don't have to use the PBF format, at the moment the OSM XML format is still widely in use. But if you do, then you will probably have to implement a PBF reader for Android. See osmosis which serves as the reference implementation for PBF and can also convert between those two file formats.
You can take a look at the Android page in the OSM wiki where lots of OSM-related Android application are listed. Maybe there is already an Android application supporting PBF. But most of them will just display tiles and the rather popular OsmAnd uses its own file format instead.
Note that PBF has various advantages compared to XML. It is smaller and it is faster to read and write than compressed XML. It also supports random access which can become very handy for a routing engine.
I have created maps using josm editor. However, I have no idea how to put it into function in my android application. The file generated from josm editor is xml or osm. Is it xml parser is needed?
Anyone used sails MRE to create indoor navigation application before?
http://support.sailstech.com/kb/tutorial/newbie-guide-create-your-first-indoor-lbs-project
Is it a must to render my map created from josm using their map render editor? and how to retrieve the map if I use it?
You need to generate the tiles(images) and providing it to your android system:
modify osm data(using JOSM or QGIS) and export it (as .osm or .shp)
import the data in a tile generator(TileMill for example)
export the images(as a folder of .png or as .mbtiles file)
use osmdroid lib to read these tile sources in your android application
I have received a customized osm file (map.osm) from my customer to integrate Android project, but I don't know how to use that file, usually I'm using
mapView.setTileSource(TileSourceFactory.MAPNIK);
So, how I can use the map.osm file my android project.
Sorry but AFAIK it doesn't work like that. A Tilesource is a rendered raster map of geodata. Thus you need to render the data first in a local renderer, for example Maperiative or TileMill. They can create a tile folder structure output, that can be used by OSMdroid instead of the official tile sources: http://code.google.com/p/osmdroid/wiki/HowToUsePackager