1

I need to show indoor custom maps in an Android device. I have created the png tiles using MapTiler (from the building's floor plan), and using JOSM I added nodes and routes, exporting a .osm file.

I was able to show the png tiles by using Nutiteq, but I haven't figured out how to connect the osm file to that.

I am not even sure that the coordinates in the osm file relate to the coordinates in the png tiles, because I used different programs to create these.

Does the png tiles go on a layer, and the nodes from the osm file go on another?

The nodes are basically used to show the rooms' name, and for routing purposes.

zed
  • 3,180
  • 3
  • 27
  • 38

1 Answers1

1

Yes, generally you put png tiles to one layer, and data from OSM file to another one.

Now there is question how to read OSM XML file as layer. OSM XML is meant as flexible data exchange format, not for rendering, so it is bulky and does not have indexes. You can create XML parser and read it directly, which is ok if you have small dataset, but I would:

  1. convert it to Spatialite using spatialite_osm_map tool
  2. then read via SpatiaLite DataSource (in AdvancedLayers) to a Vector Layer.
JaakL
  • 4,107
  • 5
  • 24
  • 37
  • Uh, I have been trying to install spatialite_osm_map tool for an hour and a half now. Lots of dependencies. Ended with an error: spatialite-tools-4.1.1/shell.c:2569: undefined reference to `load_XL' Thank you for your answer, it is very helpful! I will report back if this has worked. – zed Apr 19 '14 at 11:45
  • All set up and is read by nutiteq. However, what table name and column name would I be using. There are lots of tables, and none of them seem to have any clear information where my nodes are. I added some "shops" in JOSM, but I can't find their names in the sqlite. – zed Apr 20 '14 at 08:52
  • spatialite_osm_map has specfic fixed mapping between specific OSM tags and tables/columns in Spatialite table. Maybe you should check the source of it to find it out. Generally you should use standard OSM tags, something like amenity=shop and name=ShopName to get the shop into sqlite file. But it might be simpler to use QGIS instead of JSOM to manipulate Spatialite file directly, this way you can use any structure you need. Newest QGIS versions should show also MBTiles files (as GDAL/Raster data source) – JaakL Apr 22 '14 at 12:55
  • Thank you, I guess I'll go for QGIS. – zed Apr 23 '14 at 12:06
  • SOLUTION: The coordinate system between the png tiles and spatialite never worked out with me. So I created my own sqlite database with coordinates taken directly from the png tiles. Read the sqlite database to create the nodes. – zed Apr 25 '14 at 09:09