Summary: | Implement an Open Location Code Search Runner | ||
---|---|---|---|
Product: | [Applications] marble | Reporter: | Dennis Nienhüser <nienhueser> |
Component: | general | Assignee: | Constantin Mihalache <mihalache.c94> |
Status: | RESOLVED FIXED | ||
Severity: | task | CC: | mihalache.c94 |
Priority: | NOR | Keywords: | junior-jobs |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Implemented Open Location Code Search plugin.
Implemented Open Location Code Search plugin. |
Description
Dennis Nienhüser
2015-08-14 20:21:06 UTC
There is a C++ implementation that can be used as a base at https://gist.github.com/Steve132/ca2308a9cef0cd7e7127 Needs to be tested of course, but should provide a nice start to implement the open location code decoding. Created attachment 94342 [details]
Implemented Open Location Code Search plugin.
I've tested isValidOCL(QString) and decodeOCL(QString) separately and though about implementing a unit test in Marble for them, but I couldn't include the runner I implemented into a test. :)
Also, I can't think of a way to test if the plugin is working properly as a whole.
You can use the approach shown in https://techbase.kde.org/Projects/Marble/Runners/Search to access the plugin in a unit test without having to #include it directly. Regarding the implementation of OpenLocationCodeSearchRunner::search() I think it does a bit too much: It calculates the bounding box and then returns all placemarks from the internal database found inside. Instead I'd just create a single new placemark, give it a name equal to the search string (i.e. the OLC code) and set the bounding box as its geometry, then return that. Marble will probably not show its bounding box in the search result, but its center point. That's ok for now. Created attachment 94588 [details]
Implemented Open Location Code Search plugin.
On Open Street Map searching for an open location code displays a polygon on the map.
Git commit c802b43e5c63cb69400ba9fcec59d072bd4ee224 by Constantin Mihalache. Committed on 28/11/2015 at 20:18. Pushed by cmihalache into branch 'master'. Add open location code search plugin. REVIEW: 125377 M +1 -0 src/plugins/runner/CMakeLists.txt A +19 -0 src/plugins/runner/openlocation-code-search/CMakeLists.txt A +67 -0 src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchPlugin.cpp [License: LGPL] A +46 -0 src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchPlugin.h [License: LGPL] A +198 -0 src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.cpp [License: LGPL] A +57 -0 src/plugins/runner/openlocation-code-search/OpenLocationCodeSearchRunner.h [License: LGPL] http://commits.kde.org/marble/c802b43e5c63cb69400ba9fcec59d072bd4ee224 |