Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openandromaps mapsforge map not working. #327

Closed
RW-gis opened this issue May 31, 2016 · 12 comments
Closed

Openandromaps mapsforge map not working. #327

RW-gis opened this issue May 31, 2016 · 12 comments
Assignees
Labels
Milestone

Comments

@RW-gis
Copy link

RW-gis commented May 31, 2016

I set Geopaparazzi up to use an Openandromaps map for the first time a week or two ago. This worked fine. Then a few days ago it stopped working. I've tested this on a separate device (Samsung Galaxy Tab tablet vs Moto G android smartphone) with a new installation of Geopaparazzi and the Openandromaps map. It failed on the new installation too.

The Openandromaps map is installed in a subfolder of the Oruxmaps folder on my device, with a mapsforge style (xml file) with the same name in the same folder.

I'm using the version of Geopaparazzi from Google Play.

@moovida
Copy link
Member

moovida commented May 31, 2016

Outch, I was wondering if that would ever happen. Is it possible that the styles changed? I think there were problems with internal references to the connected image files.

I am not able to check now, but am sure interested to have that working, since those maps are great.

Can you try the maps removing the style folder? It should appear similar to the "normal" map files. If that works, then it is indeed the styles files. In which case we could adapt them to work with geopap and make them available for everyone here?

@RW-gis
Copy link
Author

RW-gis commented May 31, 2016

Tested this. Removing the style xml file makes the map visible again - so it is the map style files which are not working.

To test this I changed the style file name so that it did not match the Openandromaps .map file name. The map became visible. I changed the name so that it did match the .map file name. The map vanished. I changed the name again, and added a new different style file with a filename which matched the .map file name. The map vanished. I changed the name of the map style file and the map reappeared. During this process I did a full exit of Geopaparazzi often.

These are map style files (.xml) which I use currently in Oruxmaps. I tested them again today and they are working in Oruxmaps. I believe that previously they were working in Geopaparazzi too, but I didn't use Geopaparazzi properly yet so I may be mistaken.

@moovida
Copy link
Member

moovida commented May 31, 2016

Yes, it is the themes that changed at some point I think. And Oruxmaps resolved some internal paths differently than mapsforge (on which geopap is based) does. I now remember I adapted the first changed version of the tiramisu theme and placed it here:

https://drive.google.com/open?id=0B3mhEzI1NTTbb18xYVVUOFUxamc

I was planning to do so with each new release, but then had no time and it all faded...

I don't remember right now, but I am quite sure the trick lies all in the path to the images. Some thing like changing file:/ into ./. But I will have to check. If you happen to have a look, please let me know, so I document it. I will try to find some time also in the next days.

@MB1965
Copy link

MB1965 commented Nov 6, 2016

I have another problem with Openandromaps maps. The current versions of the maps don't work anymore with Geopaparazzi. There is a strange behaviour: some tiles load correctly, also over several zoom levels while others stay gray.

I don't use a style file, just the internal render theme.

patchy

I first noticed this in September 2016 and it seems that the problem remains. I tested with several maps from Europe, which I downloaded from here: http://www.openandromaps.org/en/downloads/europe.

I suppose it has something to do with the style theme. Maybe on some tiles there are icons or items that are not compatible anymore with the internal rendertheme (these tiles stay gray), while on other tiles there are none of these (so they load)?

It's probably a lot of work, but it would be really nice to upgrade to mapsforge version 0.6. I believe that this problem will go away then and we could also use the modern Elevate theme.

@RW-gis
Copy link
Author

RW-gis commented Nov 7, 2016

Looking at the adapted style that you link to @moovida , and comparing this to two I have on my phone for use with Oruxmaps, I can see the following:

Excerpt from your adapted tiramisu style:
<area src="file:./Tiramisu/p_wood-mixed.png" />
or
<symbol src="file:./Tiramisu/s_via_ferrata.png" />

Whereas in my copy of the Elements.xml file I have:
<area src="file:ele_res/p_wood-coniferous.png" />
and
<area src="file:ele_res/p_cemetery.png" stroke="#E4E4E4" stroke-width="0.15" />

And in my copy of the Elevate.xml style file something similar:
<area src="file:ele_res/p_wood-coniferous.png" />
and
<area src="file:ele_res/p_pedestrian.png" />

This suggests that you may be correct in that after the word "file:" there is an extra
./
I may try to adapt one of my styles myself to see if this solves the problem.

@RW-gis
Copy link
Author

RW-gis commented Nov 7, 2016

OK - this works - I have a working map. I'm not sure if the problem was the missing "./" in the file references or the fact that I hadn't changed the file references to match the locations of the map symbols. I hadn't entirely appreciated that the style files referenced symbols which I'd not moved from their original location.

Here's what people need to know - I suggest the following addition to this section of this page: http://geopaparazzi.github.io/geopaparazzi/maps.html#apply-a-render-theme

Apply a render theme
When rendering mapforge tiles locally Geopaparazzi is able to apply a render theme. The theme xml file needs to have the same name as the map file and to be in the same folder as the map file. For example the above cycle map example has a map:
italy_cycle.map
and a render theme:
italy_cycle.xml
which in the same folder as the map file.
Note that Mapsforge render theme xml files contain references to the symbols which are used on the map. You need to ensure that file references in the xml file are to the correct location for where the symbols are stored (this may be a problem if copying render themes from elsewhere). For example you may need to use find & replace to change lines in the file like:
file:ele_res/p_wood-mixed.png
to be lines like this
file:../../mapstyles/ele_res/p_wood-mixed.png
or
file:./ele_res/p_wood-mixed.png
Note the "./" may be important (some styles omit this). It means start in this folder and work downward - whereas "../" means go up a folder level or "../../" means go up two folder levels

@MB1965
Copy link

MB1965 commented Nov 7, 2016

@RW-gis
I am not sure if I understood you correctly.

I tried the Tiramisu_HR style from the link above, together with a map from Openandromaps (from 05.11.2016), and while I could see on the water and coast tiles that were loaded correctly, that the Tiramisu style was in use, most land tiles were not rendered. The xml file was renamed like the map and put in the mapsfolder.

I also tried to replace "file:./Tiramisu_HR" with "file:Tiramisu_HR", but the result was the same.

Can you please upload your working xml file with png folder, that is confirmed to work with current Openandromaps maps, so I can try it on my device?

@moovida
Copy link
Member

moovida commented Nov 8, 2016

@RW-gis sorry to chime in late, I confirm that at some point the changes in mapsforge/tiramisu there required the above change you mention. At the veri begin I made the theme available here: https://drive.google.com/open?id=1NFxfzQXg98kZmkjovrKrjv9YVpwbL2xiSD_5aszK9zU
But then was not able to maintain it.

It would be nice to share the complete theme, we could put it somewhere to download. We could even create under the geopaparazzi umbrella a theme project, in which we place the working ones.

@MB1965
Copy link

MB1965 commented Feb 12, 2017

Any news here?

The maps from http://www.openandromaps.org/en/downloads/europe don't work with Geopaparazzi anymore.
The maps from http://download.mapsforge.org/maps/europe work.

This does not seem to be a problem of the rendertheme, but rather an incompatibility of the OAM mapfiles and the mapsforge version used in Geopaparazzi.

Or maybe a problem of resources (cache size, ...) due to more details in the OAM maps?

@moovida Do you plan to update the mapsforge version, which is at 0.7.0 now (while Geopaparazzi is still on 0.3.0 from 2014 I believe)? This would probably solve this issue and also support the modern Elevate themes.

@moovida
Copy link
Member

moovida commented Feb 14, 2017

This comes in timely, I just wrote a post about possible updates right here:
http://jgrasstechtips.blogspot.it/2017/02/wrap-up-of-geopaparazzi-code-sprint-in.html

At the moment an upgrade is difficult to support, being lots of work.

@gvghia
Copy link

gvghia commented Apr 26, 2017

As parts of the map are not showed, this is due to an error during generating and applying the style xml of that location.
Is there a way to inspect some error log in order to find and easier fix the problems?

In the style file I was using, are references like:
jar:/org/mapsforge/android/maps/rendertheme/osmarender/patterns/military.png
Where are they pointing to?
Is there somewhere a list of the available icons? (Was trying to add wayside shrine)

If there is no xml file with the .map file, there is some default style used.
Where is this located?
(I have some andro maps who don't work without dedicated style file either and generate only a few tiles on some scales)

Other problem with some downloaded maps is that they have not good naming inside and show all the same. One solution should be to display the filename in the map selection menu.

Also it is not easy to see which map is actually selected.

@moovida moovida self-assigned this Jun 9, 2017
@moovida moovida added the bug label Jun 9, 2017
@moovida moovida added this to the 5.X milestone Jun 9, 2017
@moovida
Copy link
Member

moovida commented Jun 9, 2017

We are now finding a solution to this problem.
Updating in issue #406 and closing here.

@moovida moovida closed this as completed Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants