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.
Related
I'm having a really hard time to get OSMDroid working with our custom tile server. I'm getting our tiles in a zip file which has the following structure:
ZoomLevel/Y/X
I've tried unzipping the zip to the osmdroid/tiles folder and the osmdroid/tiles/Mapnik folder but none of them seem work. I think I need to use the FileBasedTileSource but I don't know what to put in the aName and URL part of the method.
I'm trying to download specific areas as a zip file for use in offline situations, which on Google Maps works perfectly but I want to try out OSMDroid and see of the performance is better.
Can anyone give me some pointers on how to get this working?
Zip archives for osmdroid must have the following structure
{Source}/Z/X/Y.{extension}
Then tell osmdroid to use a tile source whose name matches exactly {Source}. Everything should be automatic.
Also, consider using sqlite database, they are generally faster
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 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.
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
I am currently doing the android apps to determine the road surface condition. When i have all handphone sensor data in text file format, i need to convert to kml. to get the allignment, i convert the file to xls. Then i have 3 way to convert it.
By android apps to convert the kml.
By manually,
-retrieve coordinate from the file and save it to xls.
-use excel equation to decide the line color by using accelerometer and orientation data
-put to www.earthpoint.us/ExcelToKml.aspx to convert xls to kml
-put the kml to google earth to do analyzing
By automated. could be VB, JAVA and etc. but i m not familiar which program can do it
nicely.
Thanks
I am not completely sure what you are wanting to do here, but if you build this all in android then you can simply use Java Regular Expressions (java.util.regex) to parse out the sensor data into kml. You would need to open the sensor file, parse, and then output into the kml file.
I think you have all the steps to do this manually.
If you are building the app as described in #1, then you don't need this. All those program languages you described, can do what you want.