osmand_map_creation icon indicating copy to clipboard operation
osmand_map_creation copied to clipboard

Merging states

Open hockeymikey opened this issue 2 years ago • 7 comments

Is there anyway to merge some state files, like California for example? It's mostly cosmetic reasons, so OSMand shows the states I have as green. It only expects one file. I tried renaming it to the Us_state_(region_?)_northamerica format with no luck (did work for other states without subregion files).

hockeymikey avatar Dec 18 '22 18:12 hockeymikey

The docs I found suggest large files will cause issues so you don’t want to try to merge files.

You could try renaming one of the files Us_california.obf to see if that would trick Osmand into showing green for the whole state.

The real question is where does Osmand get the coverage information from?

pnoll1 avatar Dec 23 '22 04:12 pnoll1

@pnoll1 Interesting, I wonder why they serve big files themselves (like a 1gb+ CA file). I think that would work, I renamed one and all of CA lit up. Renaming one wouldn't cause issues of being picked up by OSMAnd, correct? I'm not sure, it must be custom. You can download custom sets like LA area or bakersfield in CA and it will only make green those respective areas. And it's purely based on the name/conventions.

hockeymikey avatar Dec 23 '22 16:12 hockeymikey

Doc said to avoid files over 2GB so it's probably fine.

Renaming one wouldn't cause issues of being picked up by OSMAnd, correct?

Probably not, if it seems weird just restart the app and/or reload the file.

I'm not sure, it must be custom. You can download custom sets like LA area or bakersfield in CA and it will only make green those respective areas. And it's purely based on the name/conventions.

Sure, it's just weird that they don't seem to pull that info from the map files or there's an undocumented map creator setting that needs to be turned on.

pnoll1 avatar Dec 24 '22 01:12 pnoll1

@pnoll1 Its must be contained in: https://github.com/osmandapp/OsmAnd-resources/blob/877490a6e76960557135c881b0a870cc51e286d5/countries-info/regions.ocbf How do I open it to view it to double check?

hockeymikey avatar Dec 24 '22 03:12 hockeymikey

No clue. Try it in a text editor and if it shows up in gibberish then it’s probably another custom binary format. If that’s the case there should be a program to compile/decompile it somewhere

pnoll1 avatar Dec 30 '22 01:12 pnoll1

Quote reaffirmed by Osmand dev: Oh I see, so the workaround is something like

osmium extract multiple smaller parts
foreach: MapCreator generate-obf
MapCreator merge-index --address --poi of all the small parts to get one .obf at the end

https://github.com/osmandapp/OsmAnd-tools/issues/687

Looks like this is not only possible, but the way OsmAnd builds the map files themselves.

pnoll1 avatar Mar 24 '24 19:03 pnoll1

Blocked by #74, likely means can't be done until #65 is finished

pnoll1 avatar Apr 27 '24 20:04 pnoll1