How to show this map as an overlay?

95 views
Skip to first unread message

Ryan Hughes

unread,
May 6, 2018, 12:06:54 AM5/6/18
to Osmand
Hi.  I downloaded a map of my city's voting wards and precincts from here
http://data.a2gov.org/feeds/GIS/AA%20Wards%20and%20Precincts/AA_Wards_and_Precincts.zip

I want to show the map in OsmAnd, so I know what ward I'm walking around in.

I used Markaartor to convert the shp file to an osm file.  Then I used OsmAndMapCreator to convert it into an obf file.  Then I copied the file to my Android device, at /data/media/0/Android/data/net.osmand.plus/files .

At this point, I can see the map in the list, if I go to "Download Maps" and go to the "Local" tab.  But the map of my town doesn't look any different.  There is no ward or precincts shown.

I notice that the obf file is only 315 bytes, so I think something might have gone wrong in the conversion process?  Or did it legit compress down super well and I just don't know how to make OsmAnd display the map?

I attached the zip file containing all the "shp"-related files, and the osm that I got from Merkaartor, and the obf file.

What has gone wrong here?

Thanks.
--Ryan
AA_Wards_and_Precincts.osm
AA_Wards_and_Precincts.zip
Aa_Wards_and_Precincts.obf

A Thompson

unread,
May 9, 2018, 8:48:08 PM5/9/18
to Osmand
Your .obf is empty because the .osm isn't tagged according the the OpenStreetMap system to say what things are. If you open the .osm in JOSM, select-all, and add the tags boundary=administrative and admin_level=* as described here, then OsmAndMapCreator successfully generates .obf from that. But doing it this way, OsmAnd just combines this new map data with what the main map files are telling it, and uses its rendering rules to decide how to display everything. Unfortunately, your new boundaries lie on city streets and it seems that whatever admin_level you set, the rendering rules will show the street not the boundary. You can see the new boundaries if you disable the main map file, but this is no use.

AFAIK, OsmAnd's "overlay" feature only works for tile maps (a hierarchy of folders containing small image files). There are free tools to generate those too. However, depending on your objectives, would it be acceptable just to have your boundaries as a .gpx track? JOSM, select-all, save as .gpx generates the attached file. Put in OsmAnd;s tracks folder, you can use OsmAnd's menus to turn it on and off, display it in various widths and colours on the map, eg:


BTW, if you load that .gpx into the excellent GPS Visualizer site, you can see that even though I just did "select-all" in JOSM, the .gpx preserves the individual areas:


AA_Wards_and_Precincts.gpx
Reply all
Reply to author
Forward
0 new messages