GPSFileDepot.com
 

News:

Welcome to GPSFileDepot!

Main Menu

Android tablets

Started by BobT, December 02, 2014, 10:07:14 AM

Previous topic - Next topic

popej

#15
Vector maps for Locus (and for Orux too) are created by mapsforge plugin to osmosis. You need java for these tools.

Osmosis page is here:
http://wiki.openstreetmap.org/wiki/Osmosis

Info about mapsforge plugin is here:
https://github.com/mapsforge/mapsforge/blob/master/docs/Getting-Started-Map-Writer.md

There are some nuances with installing this plugin. On my Windows I put it to osmosis\lib\default directory and add a text (no parantesis) "org.mapsforge.map.writer.osmosis.MapFileWriterPluginLoader " to file osmosis\config]osmosis-plugins.conf

Currently I'm using osmosis 4.3.1 and map-writer plugin 0.4.0. Probably newer plugin will work too.

Conversion of data is controlled by xml file indicated in "tag-conf-file" option to command line. Xml contains all tags that should be preserved in map. See example of xml here:
https://github.com/applantation/mapsforge/blob/master/mapsforge-map-writer/src/main/config/tag-mapping.xml
http://www.openandromaps.org/en/map-basics-2/tag-mapping

Locus has published their xml too, but all links that I have are outdated.

There is equivalent of TYP file for these maps. It is called a theme and it is an xml file with icons. You can find themes and more help on locus forum:
http://forum.locusmap.eu/index.php

Edit: I have forgot about OsmAnd. Compilation of maps for OsmAnd is simple, just run OsmAnd Map Creator, which can be downloaded form main site:
http://osmand.net/

Boyd

#16
Thanks. I looked at those, but am really lost with this Java stuff, LOL.  ;) 

But it looks like I can export .osm files from my vector data in Globalmapper and apparently OsmAndMapCreator can turn them into .obf files. Are these directly usable in Orux and Locus? The MapsForge maps I downloaded in Orux have a .map extension.

I don't want to create routable or searchable maps, I just want to get my vector data on the screen! :)

Will take a closer look at this soon.

popej

#17
OsmAnd has own map format, it won't work in Locus or Orux (well, I haven't even tried). But you can try OsmAnd too.

Creating maps for Locus can be done with command line window. I use some batches for this task. For example my batch for creating map of Poland form OSM data looks like this:
set JAVACMD_OPTIONS=-Xmx14000m
call osmosis\bin\osmosis.bat --rb poland.pbf --rb pl_sea.pbf --m --mapfile-writer "preferred-language=pl" "comment=(C) CC BY-NC...." "file=poland.map" "bbox=48.98,14.09,55.1,24.17" "tag-conf-file=tag-mapping.xml"


Xmx option in "set" reserves memory for java, --rb options read pbf files, --m merges last 2 files, --mapfile-writer call plugin to compile map. All subsequent options are for plugin.

Boyd

But it appears you are using .pbf files from OSM for this. I want to use my own data that is currently stored in globalmapper .gmp files. This seems complicated.... I can export to shapefiles but then I lose any colors/styles in the original source file and I also need separate files for areas, lines and points.

Seems like there should be a straightforward way to do this, but maybe I just need to adapt to a completely new way of thinking?  :D

popej

#19
All these tools expect OSM xml on input. There are programs that can create xml in OSM format. One is Global Mapper, but probably you would need current version. Quick google search showed me this page:
http://wiki.openstreetmap.org/wiki/Converting_map_data_between_formats

There are 2 tools to directly convert mp to OSM, I don't know them, but maybe they are worth trying.

I have used ogr2osm, which can convert shp (and some other formats) to OSM:
http://wiki.openstreetmap.org/wiki/Ogr2osm

This is one of these free tools, that needs a bit study to get it working. I'm using it inside OSGeo4W shell provided by QGIS. Ogr2osm does only formal conversion from one format to another. To get usable data in OSM, source format should contain attributes as used in OSM.

Boyd

#20
Thanks again, it's going to take me awhile to get up to speed here but I appreciate your help!

I am going in a little different direction now however. I am going to use Orux for the time being, and if I convert my globalmapper files to raster imagery, then convert them to the .rmap format (using CompeGPS), they look very nice. But raster imagery has the problem of not working well through a wide range of zoom levels.

The real strength of this app seems to be downloading WMS tiles though, and they can contain multiple levels so that line width, font size, etc are properly scaled as you zoom. So it occurred to me that I could create my own WMS server, use it as a data source and cache/download data from it in Orux.

I have installed the GeoServer package and have it running on the LAN with a shapefile as a test. http://docs.geoserver.org/stable/en/user/index.html

I was able to add it to Orux as a data source and it can render my shapefile through the full range of zoom levels. The roads are all just plain blue lines, so now I have to learn how to create different styles. But it works. :)

Lots more to learn here, but it might be a simple way to get maps into Orux and other similar apps. Of course, it will still have the limitation that everything is rendered in North Up view, but maybe I just need to accept that for the time being.


popej

I'm not a fun of raster maps. Too big size, too little functionality. It is kind of last resort, rarely needed, with huge geographic data gathered by OSM. My knowledge of related technology is weak. I think mobac is quite popular tool for raster maps:
http://mobac.sourceforge.net/

Boyd

#22
I agree about the limitations of raster maps, but it is going to take awhile for me to figure out how to get my maps into one of these compatible vector formats and give them the appearance I want.  My career has been art and design, so I'm particular about all the little details. :) With raster maps, I know exactly what I'm getting. And I know how to make maps look the way I like in Globalmapper. So I will live with the limitations while I learn about these new vector formats.

I now have geoserver setup with a test topo map about 20 miles x 30 miles and 4 layers. Each layer is a separately rendered TIF file (for levels 14-15-16-17). I like this because I can use appropriate details, font sizes and line widths for each zoom level. So I can do things like removing the minor contour lines and short roads as you zoom the map out.

I downloaded MOBAC awhile ago but didn't take the time to really understand. I have configured my local geoserver as a custom map source in MOBAC now, and just used it to create a map for Orux. Seems to work very well.

Now I need to go back into Globalmapper, build a bigger map and tweak the appearance of each zoom level. I am certainly learning a lot of new things. :)

Boyd

#23
Here's an update on my Android adventures. :) I ended up exchanging the Dell Venue tablet at Best Buy for a Samsung Galaxy Tab 4 8.0. Turned out that the Dell tablet didn't have an internal GPS chip (a spec not posted on Best Buy's site). I thought it wouldn't be a problem since I can use my Garmin GLO bluetooth GPS, but I was wrong. The Google Play store won't even let you download many apps if your device doesn't have an internal GPS.

Am very happy with the Galaxy Tab, the screen is really bright. Quite a bit brighter than my Garmin Dezl 760 and much brighter than my Nuvi 3550. Have built two custom mounts and am trying to decide which I like best. :)








Sticking primarily with Oruxmaps for now, although I have tried several other apps like Backcountry Navigator, Locus and TwoNav. I like the user interface better on Orux.

Concentrating on raster imagery for now. I have a map that covers the southern half of New Jersey with 5 zoom levels. It's big, about 1.5gb, and using MOBAC with the sqlite format there are about 39,000 files. I learned that FAT32 doesn't like this, I was getting errors towards the end of copying the files. Reformatting the SD card as exFAT solved that problem.

I really like using geoserver as a personal WMS server while working on maps. This allows me to test them on the tablet without copying any files or installing anything. I can access them directly on the server with the tablet over wifi.

My current focus is developing a relational database that will automatically scale all the map features for each zoom level. I export shapefiles from Globalmapper, import the .dbf files into FileMaker Pro, then export back to Globalmapper. When I'm happy with the appearance I render the map as a raster image.

MOBAC is a nice software package as well. Runs on Macs and PCs. And it can export raster imagery in almost any format for Android, iOS or even Garmin's "custom map" (.kmz) format.

BobT

Boyd and Pope, I enjoy reading you post sharing your knowledge and insight.  Just wish I understood most of it.  Keep it up.

93ToyTruck

#25
I have a Garmin map that I convert to MBTiles for use on Android and Apple devices. MBTiles is a raster map so the files are large. The conversion process was actually really easy. ESRI shapefiles are exported out of of GPSMapEdit then used in TileMill as the source data. TileMill uses CartoCSS file for styling the map. It's similar to CSS but it has conditional logic. You write IF statements that reference the fields in your ESRI data.  The fields are the data from the MP file like Type, Label, EndLevel. I had to convert the POI icons and backgrounds in my TYP file to PNG then reference them in the css.  Line styles are defined in the css and there's a lot of control for styles like opacity. There's zoom value in the css that you map to EndLevel to control when elements are displayed.

I was planning on converting to TileMill's vector map but it won't work offline. OSM vector appears to be the only offline vector option. I'm expecting the conversion to be similar where the data and styles are migrated separately. The data conversion being performed programmatically and the style conversion being a manual effort.

It seems like ESRI shapefiles would be the most likely format for conversion to OSM. I was able to get Gdal and ogr2Osm working on Windows using these steps:
http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/

The only way I could get the versions to agree was to use Phython 2.7.9. Make sure you get the right version of Gdal and Python if you're got an amd processor.

I ran Ogr2Osm on a 120mb Esri shapefile of my roads. It took up 8gb of ram which the amount of physical memory that I've got installed. It ran for a few hours and appeared to be working but I killed the process because I needed to use my computer. I'm going to let it run tonight and see what happens.

Is the OSM output xml or binary? I've got topo data that I want to convert and the shape files are over 1 gb. If it's xml then the file size will be huge.

Is the esri shapefile data supposed to be prepared in some way before converting to osm? How does it get converted to pbf?

How are OSM maps styled?

Thanks for any help that you can provide!