Tue Aug 16, 2016 10:15 am
I wonder if it is possible to get the address of a coordinate as a struct. Currently I am using the ReverseGeocodingRunnerManager which returns the address as a String. My problem is that I like to save the street number, city, country and more as separate variables.
I get this output after I tested five different coordinates in searchReverseGeoCoding(coordinates, 0.0, Marble::GeoDataCoordinates::Degree ) function
" 13.21288°E, 55.71320°N" is "Ole Römers väg, Ideon Pålsjö, Norr, Lund, Lund Municipality, Skåne, Götaland, 22370, Sweden"
" 13.34883°E, 55.71735°N" is "29a, Allégatan, Södra Sandby, Lund Municipality, Skåne, Götaland, 24731, Sweden"
" 12.15152°E, 55.65119°N" is "9, Holbækmotorvejen, Trekroner, Roskilde Municipality, Region Zealand, Denmark"
" 12.13853°E, 55.82131°N" is "Hagerupvej, Ølstykke, Egedal Municipality, Capital Region of Denmark, 3650, Denmark"
" 12.61169°E, 56.03595°N" is "30B, Sudergade, Elsinore, Helsingør Municipality, Capital Region of Denmark, 3000, Denmark"
My problem is that there seems to be no way to know where in the string the city is located. For example in the first row the city is located as the fourth to the left. On the second row as the third to the left. And the same problem if I try counting from the right.
Does anyone know if there is way to get the city, street number and country as a struct?
Sun Sep 04, 2016 5:27 pm
It's saved as KML extended data in the placemark. You can retrieve it using the extendedData() method, it's basically a key/value map of strings. The serialized version of such a placemark looks like this:
Update: Just realized there were some changes to that recently. The output for older Marble versions might look slightly different, but it has very similar data.