Mapsforge currently uses a home-spun format for map data. Overall, this format has served mapsforge well, so any move away from it has to be considered carefully: it is always easy to think of benefits in the new and problems in the old, but redesigning the format requires work that could be spent on something else and will, at least for an initial period, introduce its own problems.
The GEOS WKB is not very compact and leads to very large map files.
The current map file format is pretty compact, but it requires duplication for different zoom level ranges (different simplification factors).
Google uses a start point + offset model similar to the current map file format, but with the option to encode simplification information (points only required at certain zoom levels). I am very much in favour of reusing tried and tested approaches and there is no shame in copying what Google has done (particularly as it comes as open source).
Using a standard database format gives a free retrieval engine, extensibility at compile time (add columns, tables), extensibility at run time (user can add data to DB), multi-threading support, support for search operations and a tried and tested code base on multiple platforms.
My personal preference at the moment is Sqlite3 (or 4, the difference is not that great from a development point) with a custom compressed geo-data representation.
I have in the past experimented with a format where the data for a tile was encapsulated in an SQlite3 table, the table name encoding the tile and geo-data within a table encoded so that only offsets from the tile origin need to be stored. (At that time I did not implement a geodata compression mechanism, so I ended up with very large map dababases). To retrieve data for a tile, it was simply required to calculate the table name, so retrieval operations were pretty fast as they operated on a geographically restricted data set. The encoding I had also allowed an geographic indexing based on a string prefix (so data for the same smaller area was encoded with the same string, neighbouring areas only varying at the end of the string).
Adding new geographic areas was then as easy as downloading a new tile-table and adding it to the DB. I thought that this would allow to implement a ‘vector-data tile server’.
For the support of OSM data we can continue to use Osmosis, but I think it would be much better to base the Map Writer on the Osmium framework, a C++ library that supports area construction (so we a proper 2D geometry out of OSM data), is fast and has a small memory footprint (Osmium can operate on an entire planet file!). (There is also a newer version, but it does not yet support relations, a big show-stopper). Once one understands the concept, writing code with Osmium is very fast.
The current interface for map data retrieval defined in the MapReader is primitive and should be more fine-grained, but we should, for ease of transition and testing, support the old interface on top of a new, more fine-grained access API. That would allow us to swap out the storage without disrupting the rest of Mapsforge.
I would also be in favour of making the format, a new writer and a new reader library available under a very liberal open source license to remove any uncertainties about licensing.
This is nothing I want to do in a hurry and certainly not if we cannot find a broad consensus.
I would also be in favour of making the format, a new writer and a new reader library available under a very liberal open source license to remove any uncertainties about licensing.
I would also be in favour of making the format, a new writer and a new reader library available under a very liberal open source license to remove any uncertainties about licensing.
Ludwig can you explain more what you're meaning here?
Hi,
This actually corresponds to what I find as well.
I do not wish to speak against it, but I think SQLite is too slow and not so compact. At least that my previous (unpublished) tests showed.
For the writer with Osmium I very much agree that I had set myself on the todo list for the writer, but had not yet mentioned in my post to the writer, because I had not even try.
I think just multithreading and speed (by Native C ++) is an important point for the writer.
+1, +1, +1000 For the statement {yes multi-platform is essential}
Greetings from Berlin, Andre
I think just multithreading and speed (by Native C ++) is an important point for the writer.
Or equal to Native code in Java.
In the OpenGL library used by me there is a sub-project, with which one native code in Java (as c ++) can be compiled so that one obtains a * .jar, which runs on Windows, Linux, Android, iOS and Mac.
https://github.com/libgdx/libgdx/wiki/jnigen
I had tried this once with Windows and was very surprised how well that works. The only hack if you want to create for Mac and iOS, you need a Mac compile system.
Now that I have a Mac, I have not tried it yet, but this would make up.
Greetings Andre
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/66e989c0-d19f-4afd-874a-18cd1135e079%40googlegroups.com.
Multi-lingual support is one thing I forgot.
On the online/offline front I think that offline functionality is absolutely essential despite all the online hype...by companies that make money with advertising and harvesting personal data.On the online front we will never be better than Google, but as a free and open source project we can and should provide in areas commercially uninteresting for the big players. Ability to work off-the-grid is essential for that. That does not preclude support for a mix of online-offline and I found the idea of map-diffs interesting.
- Lack of interaction
- Speed
Finally, ease of management is probably the worst offender for the end user. Files are big and monolithic, they generally come zipped, so must be uncompressed and moved around manually;
For example one could set up an app that downloads only a user-chosen area from a tile server and assembles the map file on the fly. Could that be done in an efficient way?
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/312007c9-382d-4644-9c0d-716a65aa3584%40googlegroups.com.
That could be solved very easily with an automated unzipper.Finally, ease of management is probably the worst offender for the end user. Files are big and monolithic, they generally come zipped, so must be uncompressed and moved around manually;
For example one could set up an app that downloads only a user-chosen area from a tile server and assembles the map file on the fly. Could that be done in an efficient way?
I just mention the current situation on map writer. On big / complex areas we need very large memory and/or sdd hd cache (not suitable for the wide range of mobile devices).
As for different things in the map – if I understand that correctly, Freizeitkarte and OpenAndroMaps use the Mapsforge format but have some extra objects/attributes which are not included in the maps available for download from Mapsforge. Which means that maps are interchangeable between apps, albeit with some limitations – for example, OpenAndroMaps with original Mapsforge maps would not display elevation because the map file doesn't have that data.
Or I could take this one step further and build my own map file, with a superset of all the data contained in Mapsforge default OSM, OpenAndroMaps and Freizeitkarte, and use it across all Mapsforge apps.
Geofabrik already has map downloads in various formats, so why wouldn't they add another format if it's sufficiently widespread?
On 08/01/2015 06:26 μμ, mic...@vonglasow.com wrote:
As for different things in the map – if I understand that correctly, Freizeitkarte and OpenAndroMaps use the Mapsforge format but have some extra objects/attributes which are not included in the maps available for download from Mapsforge. Which means that maps are interchangeable between apps, albeit with some limitations – for example, OpenAndroMaps with original Mapsforge maps would not display elevation because the map file doesn't have that data.
Exactly, e.g. OpenAndroMaps have additional elevation contours, outdoor elements etc.
You could download some maps and compare - they are bigger than default ones and accompanied with their themes too.
Or I could take this one step further and build my own map file, with a superset of all the data contained in Mapsforge default OSM, OpenAndroMaps and Freizeitkarte, and use it across all Mapsforge apps.
You could do that too, or even go beyond that and build your own entirely custom map.
I often build many different maps from open or proprietary licensed data, both land and marine maps for various cases.
Geofabrik already has map downloads in various formats, so why wouldn't they add another format if it's sufficiently widespread?
Geofabrik provides vector data in some GIS formats like osm/pbf or shp.
These are suitable for direct processing inside GIS programs like QGIS, Osmosis etc.
More work is needed on top in order to transform them into properly optimized custom formats for use inside other readers like Mapsforge, GraphHopper, OsmAnd, OSRM etc.
As for different things in the map – if I understand that correctly, Freizeitkarte and OpenAndroMaps use the Mapsforge format but have some extra objects/attributes which are not included in the maps available for download from Mapsforge. Which means that maps are interchangeable between apps, albeit with some limitations – for example, OpenAndroMaps with original Mapsforge maps would not display elevation because the map file doesn't have that data.
one little wish that should hopefully not be rocket science - would it be possible to have some things - mainly elevation contours which tend to change very rarely in an extra overlay map? This would hopefully save map producers some KW of electricity, make the downloads smaller and possibly allow combination of data which could otherwise not be combined in a single map for license reasons. I know it is possible in theory but apparently not good enough in practice?
as the main author of the currently used map file format and mapreader software I would like to join the discussion and add my point of view.
It has too many limitations, most notably the lack of supporting arbitrary (wildcard) tags
A single standard map file format across different OSM projects (e.g. Navit) is an unrealistic goal, as different projects have also different scopes, requirements and use cases. Having concurrent formats and competing projects is a pretty normal and healthy thing. Let the users decide which of them is better, that's called "evolution".
Storing additional resource files such as render themes, icon sets, etc. in them map file might sound tempting. However, I would vote against that as it mixes up different concerns and makes both, the map file format and the software to read and write it more complex. I suggest to use existing containers for that purpose, such as ZIP or TAR.
I doubt that embedded databases such as SQLite would meet all these requirements. As general purpose tools they will neither be fast nor compact or RAM efficient enough, given todays smart phone hardware.
I still think that the focus of the mapsforge project should be solely on the offline capabilities. Ludwig is right, we will never be able to compete with online services. A more user-friendly web service for downloading arbitrary regions would of course be desirable. But this is "nice to have", first the underlaying basics need to be right.
... A more user-friendly web service for downloading arbitrary regions would of course be desirable. But this is
"nice to have", first the underlaying basics need to be right. ...
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/c7b67aa6-fd29-4ce1-a345-0177858f89bc%40googlegroups.com.
Would you distribute your own copy of the sqlite with the project?
SQLite, on the other hand, strives to provide local data storage for individual applications and devices. SQLite emphasizes economy, efficiency, reliability, independence, and simplicity.
SQLite is not designed to compete with Oracle. SQLite is designed to compete with fopen().
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/20150115151926.GB14953%40rz.localhost.localdomain.
It is always easy to unfavourably compare a solution that exists with an ideal solution: that ideal solution however has the real disadvantage that it does not exist and any implementation of it will fall well short of the ideal. (The current map file format is just one example of this fallacy.)
The question IMHO is not if sqlite is perfect, the question is more: would we be able to do better? or stronger given limited developer time: would be be able to do better given the resources we have?
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/54B7FEF3.4010003%40gmail.com.
> <mailto:mapsforge-dev+unsub...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mapsforge-dev/54B7FEF3.4010003%40gmail.com
> <https://groups.google.com/d/msgid/mapsforge-dev/54B7FEF3.4010003%40gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "mapsforge-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mapsforge-de...@googlegroups.com
> <mailto:mapsforge-dev+unsub...@googlegroups.com>.
The question is not whether a well designed and implemented custom
solution is faster than SQLite (it certainly is) but whether the SQLite
performance is still "good enough".
but still shows that getting the data from the DB isn't currently the bottleneck, rendering is.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/5dc3e2c5-056f-417c-9b85-6bcfc99b1bff%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/5f1995d2-055e-47f7-8b57-1d30b3f56756%40googlegroups.com.
What could a better format for map data look like?
Mapsforge currently uses a home-spun format for map data. Overall, this format has served mapsforge well, so any move away from it has to be considered carefully: it is always easy to think of benefits in the new and problems in the old, but redesigning the format requires work that could be spent on something else and will, at least for an initial period, introduce its own problems.
Overall Requirements (and Non-requirements)
- Mapsforge wants to render maps quickly from a compact storage format.
- Mapsforge does not want to be a general GIS system nor provide yet another general GIS storage format.
Deficits of the current format
- Flawed support for complex geometries, e.g. complex multi-polygons, and artifacts introduced through the tiling mechanism (area labels, area boundaries at tile labels).
- Not extensible at compile time: it is impossible to add custom data when creating a map file.
- Not extensible at run time: once created, it is impossible to add or remove data.
- Not searchable or routable, so data gets duplicated in user-specific formats.
- Support of non-OSM data only via faking OSM format.
- Complexity and lack of tool support. It is difficult understand the format and there is no way to read the data apart from displaying it as a map.
Requirements for a new format
- Support for arbitrary geometries.
- Compressed format fast for rendering retrieval.
- Extensibility at compile time: it must be possible to extend the core format to support custom data without breaking applications that do not know about the custom extensions.
- Extensibility at run time: it should be possible to add and update data at runtime. This includes support for loading additional geographic areas (e.g. a user panning to a new area could trigger a download operation where the new data area is retrieved and transparently added to the data store) as well as user additions (e.g. waypoints).
- Searchable/routable: I do not think that mapsforge should directly support routing (we should not be duplicating other project’s efforts), but the format should allow retrieval of information to assist routing (e.g. the road names, path information for route display).
- Support for generating map files from non-OSM data.
- Tool support for debugging and manipulating data.
Implementation Considerations
Geo-data format
The GEOS WKB is not very compact and leads to very large map files.
The current map file format is pretty compact, but it requires duplication for different zoom level ranges (different simplification factors).
Google uses a start point + offset model similar to the current map file format, but with the option to encode simplification information (points only required at certain zoom levels). I am very much in favour of reusing tried and tested approaches and there is no shame in copying what Google has done (particularly as it comes as open source).
Database format
Using a standard database format gives a free retrieval engine, extensibility at compile time (add columns, tables), extensibility at run time (user can add data to DB), multi-threading support, support for search operations and a tried and tested code base on multiple platforms.
- Sqlite3: Ubiquitous, license-free format, supported everywhere, plenty of tool-support, light-weight, but of course without built-in geometry operations.
- Sqlite4:A modernized format of Sqlite3, which might be worth investigating as it could improve storage space required and provide better primary key retrieval. What about the number format?
- Spatialite: Sqlite3 + geometry, but with a very heavy footprint and somewhat complex to support on different platforms. The storage format for geo-data is not very compact.
- NoSQL Databases: I do not really have much experience with them, my impression is that they are good for single-purpose data storage, but are poor when it comes to support different usage scenarios and for distribution to heterogenous platforms. This model would probably require us to implement relational retrieval operations on top (complex, error-prone).
My personal preference at the moment is Sqlite3 (or 4, the difference is not that great from a development point) with a custom compressed geo-data representation.
Data “Pods”
I have in the past experimented with a format where the data for a tile was encapsulated in an SQlite3 table, the table name encoding the tile and geo-data within a table encoded so that only offsets from the tile origin need to be stored. (At that time I did not implement a geodata compression mechanism, so I ended up with very large map dababases). To retrieve data for a tile, it was simply required to calculate the table name, so retrieval operations were pretty fast as they operated on a geographically restricted data set. The encoding I had also allowed an geographic indexing based on a string prefix (so data for the same smaller area was encoded with the same string, neighbouring areas only varying at the end of the string).
Adding new geographic areas was then as easy as downloading a new tile-table and adding it to the DB. I thought that this would allow to implement a ‘vector-data tile server’.
Map Writer
For the support of OSM data we can continue to use Osmosis, but I think it would be much better to base the Map Writer on the Osmium framework, a C++ library that supports area construction (so we a proper 2D geometry out of OSM data), is fast and has a small memory footprint (Osmium can operate on an entire planet file!). (There is also a newer version, but it does not yet support relations, a big show-stopper). Once one understands the concept, writing code with Osmium is very fast.
Interface operations
The current interface for map data retrieval defined in the MapReader is primitive and should be more fine-grained, but we should, for ease of transition and testing, support the old interface on top of a new, more fine-grained access API. That would allow us to swap out the storage without disrupting the rest of Mapsforge.
I would also be in favour of making the format, a new writer and a new reader library available under a very liberal open source license to remove any uncertainties about licensing.
This is nothing I want to do in a hurry and certainly not if we cannot find a broad consensus.
Ludwig
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/cdd55746-8367-4052-9051-809bea3d683d%40googlegroups.com.
(1) Mapsforge file format was created with main purpose the fast offline rendering of vector data. Unfortunately not with also search in mind.
(2) Well I use extensively GraphHopper too and I understand your concerns.
It would be good if we could have only one file format that would have them all (map + routing + search). But that's impossible unless we build something from the start.
i.e. we cannot mix Mapsforge + GraphHopper code together, they are two different projects managed independently.
Besides I don't know how Peter would feel about that :-)
(3) Web Mercator (EPSG:3857) projected coordinate system is the de facto standard for web mapping applications for visualizing earth on 2D space.
All mobile implementations like ours (not being 3D ellipsoids) are just expressions of it.
The underlying coordinates are defined using the WGS84 ellipsoidal datum as is the common rule.
(4) I would depend that in the implementation. And I'd expect access time to be DB like.
Text scale is configurable by the user. It maybe not have many uses on desktop (except 4K), but on mobile with the many screen densities we certainly can use it - along with the important variable tile size.
Mapsforge began on Android and along the way it was moved also on Java (due to common base).
BTW Android supports some classes of NIO packages and even them not fully.
We are currently two people (Ludwig and me) who manage Mapsforge.
Our resources are limited and there are a lot that we can add / improve.
In my list are always native map rotation, hardware acceleration, steplessly variable zoom levels, etc. Not particularly in that order.
At least I'm happy for the refactored Android gesture system in 0.5.2 - it was something that always bothered me.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/bbd90fb4-7c07-4916-849d-92ea6c23ab77%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/48bddf20-7975-4a5a-9e65-d2afb69dc231%40googlegroups.com.
I tried to create a map file on my Linux box for Germany. My main memory of 8 GiB is too small for the RAM based method, so I tried the HD based method. I broke it off after around 7 hours of maltreating my hard drive :(
That was not the point of my post, but since you mentioned it: I don't know of any particular forum to discuss map-writer issues. Could you give me a link to the right forum?
For much faster processing of OSM data I would start from Jochen Topf's Osmium Tool http://osmcode.org/osmium/ . This has the added advantage of having solved lots of problems with relations in OSM.
Custom formats can be fine, but they need to be maintained. I think that is the strongest argument against them for a project with such little resources.
Can you give me a link to the problems, that have been solved with osmium?
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/7a3b144a-ca16-4a5b-96da-9dfd3c1a186c%40googlegroups.com.