[Marble-devel] Wikipedia Integration in PlaceMarks

Shashank Singh shashank.personal at gmail.com
Thu Aug 21 05:10:41 CEST 2008

hi everyone ,
                  i am  working on improving wikipedia integration in Marble
, now instead of showing wikipedia articles with respect to name (i.e
en.wikipedia.org/wiki/NameOfCity ) ,   my approach is to  rather use
"Latitude Longitude"  of the place to get related articles from the region
using GeoNames API [available as cc by attribution from
http://ws.geonames.org/ ] hence apart from article linked to city itself we
also get links pointing to other wiki pages from city itself [like monuments
etc in 30 km radius , The radius could be speciifed in Geonames API ] , if
any  . i have not committed the code , yet :)
The changes have been made to following files

Modified PlaceMarkInfodialog {.cpp}
Modified TinyWebBrowser {.h|.cpp}
Added JsonParser {.h|.cpp}

I have partially implemented feature "city in Placemark name should be given
priroity" example  if clicked on Tehran , Wiki Article Poiting towards
Tehran Must be the first article on display . The implementation was termed
as partial  because of following fallacies in different approaches i

(1)Taking example of Tehran , i added a simple sorting algorithm which
basically sieved parsed data into two categories of features "city and other
features" .. so if QString citySummary had data for city , QString
otherFeaturesSummary had rest of the data ..so contentHtml=citySummary +
this resolved problem for most of the data :) where there was no other city
in 60 km radius (which i have now changed to 30 km in the query ),

(2)now coming to other approach i did apply simple distance sorting on all
the data , i.e sorting all the cities(QString citySummary) according to
their distances and the one one with least distance should be City that was
clicked in placemark .
like Tehran has 3 cities [according to Geonames API/Wiki ]near it with
following distances from the lat lon i passed for tehran
distance 1.39767 "Golestan Palace" [least distance]
distance 1.91003 "Park-e Shahr"
distance 1.91003 "Tehran"

this due to difference in deegre of precision in Wikipedia article [geonames
api] and Marble ,
Marble says tehran to be  at "51.430E, 35.670N"
Wikipedia says it be at "51.423E , 35.6962N"
so my logic basically breaks down :(
[Not to mention this logic wont work for Continent and Conutries]

This raises a very valid point that due to descrepancies in Data present in
Wiki itself , some Monument like "Golestan Palace" return Features as City ,
which causes them to be sieved into citySummary and as they have least
distance due to difference in precision , the article "Golestan Palace"
comes before Tehran when  placemark Tehran is clicked.

any help as to what i can do ?

Shashank Singh

P.S: on much lighter note I used the word Tehran so many times , thought i
should clear it ;-) .. "i am not from Tehran " :D

Shashank Singh
Google SoC Student
For Marble (KDE-Edu)
Blog :http://techfreaks4u.com/blog
Marble : http://edu.kde.org/marble/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WikipediaIntegration.diff
Type: text/x-patch
Size: 6340 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsonparser.cpp
Type: text/x-c++src
Size: 3024 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0003.cpp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsonparser.h
Type: text/x-chdr
Size: 1809 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0002.h 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PlaceMarkInfoDialog.cpp
Type: text/x-c++src
Size: 7187 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0004.cpp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TinyWebBrowser.cpp
Type: text/x-c++src
Size: 8696 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0005.cpp 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TinyWebBrowser.h
Type: text/x-chdr
Size: 1589 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080821/0baf2b71/attachment-0003.h 

More information about the Marble-devel mailing list