Update Locus to new version of vector map library mapsforge 0.3.0

tommi shared this idea 7 years ago
Completed

The mapsforge project recently released their new library 0.3.0.


Locus uses this library heavily in the context of vector maps.


Locus should use this new version of mapsforge as it promises a lot of improvements and ... the possibility to configure the rendering style.


Changing the rendering style seems to be very interesting as many users complain about the relatively poor distinction between different kind of roads, e.g. asphaltic roads and dirt tracks in Locus/mapsforge.


There will be at least few additional ideas once Locus moved to mapsforge 0.3.0, e.g. different renderstyles, a renderstyle editor, ...

Comments (39)

photo
0

?


climb down Tom - u know Menion is working on this project..

photo
0

I know, he confirmed this to me already yesterday.


I just made it to provide some input for his changelog and to justify that


work on other features may be shortened in the next days or weeks.

photo
0

So,


good news. System is added. Thanks to changes in library, it was less work then before with older version. I started to generate whole Earth maps but it take on my server around four days so on weekend will be maps ready for download. I also change system on server so for new (and testing) version, server will distribute new maps so I hope, you`ll help me test it then ;)


for those, who have access to dropbox, I`ll also put some testing version there today. Maps of Africa are already done, Maps for America just started, so if you`ll want any of them tell me and I`ll upload them also to dropbox (download from server is possible just after all maps are generated)

photo
0

wow, that was really fast.


I`m eager to get it. Some maps from America or even better Germany appreciated.

photo
0

that`s what I expected - but Europe is almost last (Oceania is last) so it will be ready probably in .. I think Thursday, Friday :).


I`m only worried that people that are currently downloading maps with purchased credit in Locus shop, will be forced to download new maps immediately. I`ll provide some easy way to downgrade app to current version. Fortunately Locus now needs new Vibrate permission, so it will force people to read more carefully update info before update


ah and testing version is uploading on dropbox ;)

photo
0

Downloaded and it is working. Currently testing with Berlin sample map from mapsforge.


I also installed their Advanced Mapviewer (already on Sunday) and there is a menu item "Render-Theme" which would allow to select a render xml file but unfortunately I don`t have one.


Does Locus already use such a xml file or only mapsforge built-in rules?

photo
0

I use build-in theme with some small modifications (just to work correctly in locus). I`m also looking for some theme to add support for this excellent feature but cannot find any :) ... at least I added support for setting font size

photo
0

http://code.google.com/p/mapsforge/so...


This lists some osmarender.xml from the mapsforge project but I don`t know which one is right!?

photo
0

this is all the same. I`ll just change some colors in this theme and try to add support for this ...


little bit tired today, but if you`ll see new version on dropbox today, it will contain this new feature together with some description .. so back to work :)

photo
0

@menion: If you are worried about their reaction, maybe you could offer those who downloaded maps recently (say in last two weeks) some free credit?


I suppose there is no simple way how to covert the 0.2.4 maps to 0.3.0 nor a "compatibility mode" in the library?

photo
0

I checked now in more detail. It`s 3 files, the first two of them differ only minimal but between 1,2 and 3 the pathes to symbols differ (example):


I don`t know if this is relevant

photo
0

thanks for info Tommi, but it`s not necessary. Task done and custom styles works now. Only weird thing is that in file are defined absolute paths to files. So I did small improvements and added possibility to define relative paths. I`m going to change a little bit generating process of maps. So priority for testing is Czech and Germany, correct? Probably tomorrow morning will be on dropbox version with maps ... good evening for now

photo
0

Thanks a lot for your sedulous effort.


Hope you can sleep well if you`re tired but excited ;-)

photo
0

@Menion I have a czech map (directly from mapsforge authors), but it has ~160MB. I could upload it for Dropbox testers to the temporary folder, but did not so yet. So if it`s OK with you, I will.


I tested the map on my way home from work (the map seemed to be 50m off, but it was in fact GPS issue and resetting AGPS data helped). Street numbers in Ostrava are not missing in some places anymore, the tile rendering seems to be marginally slower than in original library.


Pitty they did not offer the old library in a separate namespace for backwards compatibility.

photo
0

thanks Paul!


I`ve Czech Republic partially generated so leave it, I put tomorrow links on my server with generated maps so everyone will download only what he needs.


I was thinking about what you told before, about offer to users for some extra credit but it should be quite a lot of work. Library have same package but I use little bit customized version in Locus so I`ll try tomorrow refractor package and put it also in Locus :)

photo
0

Hmm.. Once the First Fix is achieved. and the Locus Sat Dish icon turns green, isn`t AGPS data now disregarded, no longer part of the position solution?

photo
0

I think you are mixing the two AGPSes ;-)


The AGPS (assisted GPS) I meant is the original pre-Apple meaning - i.e. data used for fast GPS fix (some GPS satellite info obtained through network instead of directly from GPS satellites). So typically ephemeris data. but also some correction factors for signal propagation.

photo
0

How about some good maps of Colombia and South America? I will be here for a few months.

photo
0

@Menion:


I`m just testing the dropbox version with your "Rio tinto" design.


Great that you managed to include both mapsforge 0.2.4 and 0.3.0! I didn`t dare to hope that this is possible


But now back to the 0.3.0 part. Works fine so far. But for the moment just one thing which catches my eye: If I zoom the map I can see single tiles getting updated.


On a SGS II this is still quite fast but it doesn`t look nice.


To be honest I only point on this as I see that it is possible to do it better: Compare with AdvancedMapViewer (from http://code.google.com/p/mapsforge/do....


Seems it first stretches/shrints the display of the current zoom level and later changes to the new zoom level. This looks much smoother. Is Locus behaviour maybe a result of older optimizations (cache rendered tiles)?

photo
0

"...this looks much smoother.."


agree! looks very nice.


and btw. the "bloody lake" theme works for me too.

photo
0

animated zoom is next idea, it do not belong here. I tried to make similar behavior around a half year if I remember correctly, but it wasn`t working best so I never published it. In this topic is priority new MapsForge library and seems to work correctly, that`s what matters for me now :)

photo
0

Accepted.


In general I think the osmarender theme delivered by mapsforge 0.3.0 is a big step in the right direction. Display especially in rural regions (distinction of paved ways from several kind of dirt ways) is much better know. And everybody can now make little changes in the xml file and adapt it to his needs (or mood, see the bright red rivers ;-)).


Maybe also a collection at mapsforge site will arise.

photo
0

fine ... I think that from applications that use MapsForge library is Locus biggest and also with biggest community (and thanks to few people also very active community) so I hope that some nice themes that will then be shared will come just from you (community, not just from you Tommi) :)

photo
0

Menion, just one comment regarding relative paths fo rrendering styles.


Seems that you hardcoded the name of the theme directory, the osmarender test.xml contains this relative path (example):


symbol src="fileRel:/testing_style/symbols/theatre.png"


This seems to be one cannot rename the directory from testing_style to e.g. testing_style_from_menion.


I also tried to add an alternative "osmarender test tommi.xml" in the same folder but this resulted in unexpected behaviour, too: only the builtin render style is available from the menu then.


So, without changing the relative path in the xml file (which makes the idea of the relative path quite useless here) I can`t add a modification of your style.


Maybe you already changed the code inbetween to make this more flexible and my complaint is outdated.

photo
0

ah damn, I just wrote in another topic that my mind works, but seems .. not! damn


thanks Tommi! I`m going to fix and then I place version on dropbox

photo
0

Thanks, I`ll be going to test it

photo
0

Just a few hints for those of you who change the style of the "osmarender test.xml".


The original can be found here (with blue instead of red water):


http://mapsforge.googlecode.com/svn/t...


1)


To work in current Locus test version 2.1.1.4 all occurrences of this string


jar:/org/mapsforge/android/maps/rendertheme/osmarender


must be replaced with


fileRel:/testing_style


However I think this is a subject to be changed soon, see my previous comment.


2)


File must be stored in UNIX file format (no carriage return), otherwise Locus/mapsforge library fail to process the file.


3)


Used colors seem to be derived from the Cynthia Brower scheme.

photo
0

Perfect Tommi, thanks


Looks you`re interested in creating some improved version of Osmarender skin. I was already searching for some existing Mapnik scheme for Osmarender but seems that it not exist (I didn`t find any other theme in Osmarender system http://wiki.openstreetmap.org/wiki/Os..., too bad ...


I`ll just add more info to your first point. I changed system a little bit so:


MapsForge library currently support for file definiton


jar:/org/mapsforge/android/maps/rend.. (for internal location of resources)


file:/mnt/sdcard/locus/mapsVector/_themes/MyTheme/images/img.png (for absolute path to resources)


Locus now also support


file:/images/img.png (for RELATIVE path to resources)!!


I don`t know if MapsForge will come with any solution for this but till then use this system. If there will be any other official solution, I think that thanks to possibility to distribute themes by Locus Shop, it`s not a big deal to publish changed Theme system


I`m going to create version on DropBox, nice evening to all ...

photo
0

new MapFileWritter from MapsForge have some issues and many countries cannot be generated. For example now I`m generating some part of east Russia and quite small area is generating almost 10 hours. Have to contact MapsForge itself anyway I wanted to say, that thanks to fact that Locus can handle both file versions, I`ll release at start of week (Monday, Tuesday) new version because there`s also quite a lot of bugfixes and new maps will just have to wait a little bit ...

photo
0

issue posted http://code.google.com/p/mapsforge/is...


let`s wait what will say MapsForge creators ...

photo
0

Kinda problems like this I expected some month ago when I asked you how change to mapsforge 0.3.0 will be done in Locus. And I think it`s the best solution possible to support 0.2.4 and 0.3.0 in parallel. Otherwise Locus development would be blocked until solution from mapsforge is available or you would need to support old and new version in parallel (double work, not nice at all).


Well done, Menion!

photo
0

Hmm, strange I have no problems to change colors of rivers, houses, etc., every change in the xml file has the expected effect on the map.


But actually I want more change size of some text on the map as for housenumbers, street names as these appear to small for me. But no way, changes in the xml file have no effect.


Any idea?

photo
0

Made a little step forward now:


Got streetnumbers printed now in bigger size.


This worked only after changing and returning from a completely different map (e.g. want to see Bavaria, still has little streetnumbers, switch to Baden-Württemberg, switch back to Bavaria and now I see bigger streetnumbers).


Issue in Locus or in Mapsforge?


Still no success with street names.

photo
0

Hmm, the little improvement vanished now again. Cannot reproduce the behaviour and housenumbers are small again. Seems I only got it working with a very special sequence of actions.

photo
0

Tommi, may you please test this also on AdvancedMapViewer from mapsForge? To check if it`s Locus issue (so I should solve it) or issue of MapsForge lib, so we should report this on their sites ...

photo
0

Yes, I`d like to do this.


Can you give me a tip what I should do with the path?


I found this:


src="jar:/org/mapsforge/android/maps/rendertheme/osmarender/patterns/military.png"


And replaced it with


"/mnt/sdcard/AMV_Test/patterns/militar.png"


But I get this error from AMV when I select the file "/mnt/sdcard/AMV_Test/osmarender test amv.xml":


file does not exist: file:/patterns/military.png


What looks strange to me in the error msg is the "file:"

photo
0

Ähm, I just saw a new version 2.1.1.7 on dropbox. In the news.txt there is a statement "add: ability to set text size of the Vector maps". Isn`t this the beast I`m fighting with? Where can I set the text size?


Btw., you got a question from Thilo.

photo
0

Fixed another problem: AMV doesn`t like whitespace characters: Changed "osmarender test amv.xml" to osmarender_test_amv.xml results in different error: invalid bitmap source: /mnt/sdcard/AMV_Test/patterns/military.png.


I`m going to report this problem to mapsforge.


edit: done, see http://code.google.com/p/mapsforge/is...

photo
0

hello Tommi, I`ll on all what you wrote more precisely tommorow. But just quick note:


1. AMV needs absolute path that looks like


src="file:/mnt/sdcard/AMV_Test/military.png"


2. size of texts can be set in new Locus in settings > maps advanced but this value is just multiplier that affect values already set in your xml file