[Libosmscout-development] osmscout-server
Library for OpenStreetMap offline rendering and routing
Status: Beta
Brought to you by:
tteuling
|
From: rinigus <rin...@gm...> - 2016-09-19 14:13:56
|
Dear libosmscout developers: I'd like to introduce a small libosmscout-based server that, in future, can be used as a drop-in replacement for tile (and other relevant info) server by programs that require such servers. Rationale: We are missing a native application for offline navigation and map viewing/exploring in Sailfish. At present, there are several applications (at least 4) that are in part working to implement the functionality. Out of them, some have focused on GUI and getting the best support from online provided maps, and some have worked on all aspects (backend and frontend, OSM Scout for Sailfish). The amount of developers is very limited and through this server I would like to contribute by exposing libosmscout backend to the frontends that have been focused on GUI. What can it do: At present, the server registers a port and waits for HTTP requests on it. So far, it knows how to serve tiles using slippy map notation with small extensions. It can accept multiple requests simultaneously and process them in parallel. This is done by mutex-protecting calls to the database ( https://github.com/rinigus/osmscout-server/blob/master/src/dbmaster.cpp#L97) and drawing in parallel. On PC, it can load all CPUs without any problems when accessed via modRana. Haven't tested multithreading in Sailfish yet due to single-threaded access used in the app that I used for testing (Poor Maps). Even when accessed via single thread, the server can feed the tile images in PNG fomat with reasonable speed on mobile device. Through the extended slippy map URL scheme, I can increase served tile sizes to optimize for best performance. By using tile-oriented GUIs, all caching of generated images has been taking care of and reducing the load on CPU further. At present, the memory footprint was about 220-260MB RSS on mobile device. I presume that it would be higher when multiple pixmaps are generated in parallel. Implementation: Please consider current implementation as a proof of concept. As an HTTP server API, I used QtWebApp which, as suggested by the lib author, is incorporated into the code. This lib was selected since it is simple to perform multi-threaded processing and, as majority of Sailfish applications, it uses Qt. This choice can be altered if someone would like to use some other API that has similar properties. To compile, you need libosmscout libraries installed in the system. For Sailfish, I made a simple packaging scripts to install libosmscout (qt variant) and its development headers. That prevents distribution via official store, but allows simpler development. There are other channels that can be used for distribution and I intend to use them instead of the store. Further development: I plan to develop 2 interfaces - CLI and QML. QML interface should allow to alter configuration settings (port, bound interface, font size, ...) via GUI and simplify starting/stopping the server on mobile device. CLI would read settings from configuration file and run in terminal. That would allow using it for testing libosmscout on PC. License: LGPL URL: https://github.com/rinigus/osmscout-server As usual, everyone are welcome to join. Would be interesting to know whether such project is of any interest to this community before I put a lot of effort into it. Best, rinigus |