<div dir="ltr"><div class="gmail_quote">hi everyone ,<br><div dir="ltr">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i am&nbsp; working on improving wikipedia integration in Marble , now instead of showing wikipedia articles with respect to name (i.e <a href="http://en.wikipedia.org/wiki/NameOfCity" target="_blank">en.wikipedia.org/wiki/NameOfCity</a>
) ,&nbsp;&nbsp; my approach is to&nbsp; rather use &quot;Latitude Longitude&quot;&nbsp; of the place to get related articles from
the region using GeoNames API [available as cc by attribution from <a href="http://ws.geonames.org/" target="_blank">http://ws.geonames.org/</a> ] 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&nbsp; . i have not committed the code , yet :) &nbsp; <br>
The changes have been made to following files<br><br>Modified PlaceMarkInfodialog {.cpp}<br>Modified TinyWebBrowser {.h|.cpp}<br>Added JsonParser {.h|.cpp}<br><br>I have partially implemented feature &quot;city in
Placemark name should be given priroity&quot; example&nbsp; if clicked on Tehran , Wiki Article Poiting towards Tehran Must be the first article on display . The implementation was termed as partial&nbsp; because of following
fallacies in different approaches i undertook..<br><br>(1)Taking example of
Tehran , i added a simple sorting algorithm which basically sieved
parsed data into two categories of features &quot;city and other features&quot;
.. so if <span style="color: rgb(0, 102, 0);">QString citySummary </span>had data for city , <span style="color: rgb(0, 102, 0);">QString otherFeaturesSummary</span> had rest of the data ..so <span style="color: rgb(0, 102, 0);">contentHtml=citySummary + otherFeauturesSummary;</span><br>


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 ),
<br><br>(2)now coming to other approach i did apply simple distance sorting on all the data , i.e sorting all the cities(<span style="color: rgb(0, 102, 0);">QString citySummary</span>) according to their distances and the one one with <span style="color: rgb(0, 102, 0);">least distance</span> should be City that was clicked in placemark .<br>


like Tehran has 3 cities [according to Geonames API/Wiki ]near it with following distances from the lat lon i passed for tehran<br>distance 1.39767 &quot;Golestan Palace&quot; [least distance]<br>distance 1.91003 &quot;Park-e Shahr&quot;<br>

distance 1.91003 &quot;Tehran&quot; <br><br>this due to difference in deegre of precision in Wikipedia article [geonames api] and Marble ,<br>Marble says tehran to be&nbsp; at &quot;51.430E, 35.670N&quot;<br>Wikipedia says it be at &quot;51.423E , 35.6962N&quot; <br>


so my logic basically breaks down :(<br>[Not to mention this logic wont work for Continent and Conutries]<br><br>
This raises a very valid point that due to descrepancies in Data
present in Wiki itself , some Monument like &quot;Golestan Palace&quot; return
Features as City , which causes them to be sieved into <span style="color: rgb(0, 102, 0);">citySummary</span>
and as they have least distance due to difference in precision , the
article &quot;Golestan Palace&quot; comes before Tehran when&nbsp; placemark
Tehran is clicked.<br>

<br>any help as to what i can do ?<br><br>Regards<br><font color="#888888">Shashank Singh<br></font><br><br><br>P.S: on much lighter note I used the word Tehran so many times , thought i should clear it ;-) .. &quot;i am not from Tehran &quot; :D<br>


</div>
</div><br><br clear="all"><br>-- <br>Regards:<br>Shashank Singh<br>Google SoC Student <br>For Marble (KDE-Edu)<br>Blog :<a href="http://techfreaks4u.com/blog">http://techfreaks4u.com/blog</a><br>Marble : <a href="http://edu.kde.org/marble/">http://edu.kde.org/marble/</a><br>

</div>