User talk:Para/2009-09-09: Difference between revisions

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Content deleted Content added
No edit summary
GeoGroupTemplate: proof of concept code
Line 413: Line 413:


::I started a discussion at [[Commons_talk:Geocoding#Geocoding tool addition to Special:Gadgets]]. -- User:Docu
::I started a discussion at [[Commons_talk:Geocoding#Geocoding tool addition to Special:Gadgets]]. -- User:Docu

:::Okay, let's see what people think. I think I may be a bit shy to introduce my own tools to the Commons interface. :) Meanwhile, I wrote a [[w:Greasemonkey|Greasemonkey]] script to hide geocoded images from categories and link to the "round tour" tool:
{{hidden|Geocodedinfo.user.js|
<source lang="Javascript">
// ==UserScript==
// @name Hides geocoded files from Wikimedia Commons categories and adds a panorama link
// @namespace commons
// @include http://commons.wikimedia.org/wiki/Category:*
// ==/UserScript==


//var title = unsafeWindow.wgTitle;
var title = document.title.match(/^Category:(.*) - Wikimedia Commons$/);

if (title.length>1) {
title = title[1].replace(/ /g, '+');

// Hide geocoded images
getURL('/proxy/http://toolserver.org/~daniel/WikiSense/CategoryIntersect.php?wikifam=commons.wikimedia.org&basecat='+encodeURIComponent(title)+'&basedeep=1&mode=cs&tagcat=Media+with+locations&tagdeep=1&go=Scan&format=csv&userlang=en', processCatScan);
// Link to proximityrama
var iwlis = document.getElementById('p-lang').getElementsByTagName('li');
var enlink;
for (var i in iwlis) {
if (iwlis[i].className == 'interwiki-en') {
enlink = iwlis[i].firstChild.href;
break;
}
}
if (enlink) {
enlink = enlink.replace('/proxy/http://en.wikipedia.org/wiki/', '');
getURL('/proxy/http://en.wikipedia.org/w/api.php?action=query&prop=extlinks&format=json&titles='+enlink, processGeolink);
}
}

function processGeolink(responseDetails) {
if (responseDetails.status == 200) {
var api = eval('(' + responseDetails.responseText + ')');
for (var p in api.query.pages) {
var els = api.query.pages[p].extlinks;
for (var l in els) {
var link = els[l].*;
if (link.indexOf('/proxy/http://stable.toolserver.org/geohack/geohack.php') == 0) {
var params = link.match(/http:\/\/stable.toolserver.org\/geohack\/geohack.php.*params=([-\d._NSEW]+)/)[1];
//unsafeWindow.global_append_tab('/proxy/http://toolserver.org/~para/GeoCommons/proximityrama?params='+params, 'proximityrama', 'ca-proximityrama');
location.href = "javascript:void(global_append_tab('/proxy/http://toolserver.org/~para/GeoCommons/proximityrama?params="+params+"', 'proximityrama', 'ca-proximityrama'))";
}
}
}
}
}

function processCatScan(responseDetails) {
if (responseDetails.status == 200) {
var geocodedfiles = new Object;
var rows = responseDetails.responseText.split(/\n/);

for (var i in rows) {
var cols = rows[i].split(/\t/);
if (cols.length>1) {
var file = cols[1];
file = file.replace(/^File:/, '');
file = file.replace(/_/g, ' ');
file = file.replace(/"/g, '\\"');
geocodedfiles[file] = 1;
}
}

var tables = document.getElementsByTagName('table');
var gallery;
for (var i in tables) {
if(tables[i].className.match(/gallery/)) {
gallery = tables[i];
break;
}
}

var deletequeue = new Array;
if (gallery) {
for (var i in gallery.rows) {

for (var j in gallery.rows[i].cells) {
var cell = gallery.rows[i].cells[j];
var file = cell.getElementsByTagName('a')[0].title;
file = file.replace(/"/g, '\\"');
if (geocodedfiles[file]) {
deletequeue.push(cell);
}
}
}

if (deletequeue.length >0) {
var pmedia = document.getElementById('mw-category-media').getElementsByTagName('p');
pmedia[0].innerHTML += ' '+deletequeue.length+' <a href="/proxy/https://commons.wikimedia.org/wiki/Commons:Geocoding?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FCommons%3AGeocoding">geocoded</a> files have been hidden from the view.';
while (deletequeue.length > 0) {
var file = deletequeue.pop();
file.style.display = 'none';
//file.parentNode.removeChild(file);
}
}
}
} else {
GM_log("CategoryIntersect returned "+responseDetails.status);
}
}

function getURL(url, fnCallback, fnCallbackArg) {
new GM_xmlhttpRequest({
method: 'GET',
url: url,
onload: function(responseDetails) {
if (fnCallbackArg) {
fnCallback(responseDetails, fnCallbackArg);
} else {
fnCallback(responseDetails);
}
}
});
}
</source>
}}
:::Ideally, the hiding of images would allow jumping back and forth between the original and filtered view, and wouldn't have the deletion issues I mentioned above. Other than that, I like the embedding of the functionality into the Commons interface, instead of visibly linking to external tools. The same approach would be nice for the proximityrama thing, too. The view is slightly different of course, but I think that should be a gadget choice as well. I have [[tools:~para/Commons:Special:NewFiles]] with a very compact image presentation, while the geocodingtodo is somewhere between that and the default Commons display. Users should be able to choose what they like to see and not depend on developers' choices. Short term might be different though ... I'm not a big fan of trying to write portable Javascript that works on all browsers, that's why Greasemonkey things are so nice. --[[User:Para|Para]] ([[User talk:Para#top|<span class="signature-talk">talk</span>]]) 18:48, 16 June 2009 (UTC)

Revision as of 18:48, 16 June 2009

User talk:Para/2009-09-09/header

KML tool doesn't work for me

I tried using your Convert coordinates from a KML file for geocoding on Wikimedia Commons with the KML object shown below. When I clicked Submit, the page just reloaded itself and sat there.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<GroundOverlay>
	<name>Overlay as of 2006</name>
	<visibility>0</visibility>
	<LookAt>
		<longitude>-1.374477830735046</longitude>
		<latitude>52.82993383165749</latitude>
		<altitude>0</altitude>
		<range>1169.537529968381</range>
		<tilt>0</tilt>
		<heading>33.48200890118949</heading>
	</LookAt>
	<Icon>
		<href>D:/Images/Race Tracks/Donington as of 2006.png</href>
		<viewBoundScale>0.75</viewBoundScale>
	</Icon>
	<LatLonBox>
		<north>52.83411307304034</north>
		<south>52.82616733472095</south>
		<east>-1.365286620382797</east>
		<west>-1.384215025052138</west>
		<rotation>-33.49505644444577</rotation>
	</LatLonBox>
</GroundOverlay>
</kml>

Will (Talk - contribs) 06:00, 3 September 2008 (UTC)[reply]

Thanks for the report, I just added an error message so that the tool always shows something. Currently it only looks for placemarks and I haven't considered converting overlays before now. I could add support for that (center of the overlay, or the lookat point?), or would Commons:Geocoding/Overlay be a better way to geocode the image? --Para (talk) 10:02, 17 September 2008 (UTC)[reply]

GeoCommons

http://toolserver.org/~para/GeoCommons/ free as in beer or speech? thats the question!�;) By the way, maybe Marble (KDE-Project) want to support you with GeoCommons?�:) 87.78.20.133

Neither for now; it's running solely on the toolserver and only the output is distributed. That may however change if an application to improve Commons visibility requires more freedom.�:) User:EugeneZelenko has been in talks with KDE people [1], but I'm not sure if there has been any progress lately. If KML output isn't sufficient for some reuse purposes, others can be added... --Para (talk) 10:07, 17 September 2008 (UTC)[reply]

Globe

Good catch at Commons:Deletion requests/Image:Jordglob.jpg. Cheers, -- Infrogmation (talk) 00:26, 18 September 2008 (UTC)[reply]

Geo coded images

Hi Para, I would like to ask you if you could update the graph of geocoded images on Commons Image:Commons geocoding graph.svg. Or perhaps you could tell me how many images have coordinates in Commons atm? I added coordinates to Categories Gie�en and Marburg the past days. Gie�en Thanks in advance, Longbow4u (talk) 16:38, 28 September 2008 (UTC)[reply]

Good work! I updated the graph now and looks like others have been busy geocoding lately too. You can always see the current number of geocoded images from the Google Earth link on images pages, or with a browser from http://toolserver.org/~para/GeoCommons/info.php. --Para (talk) 17:09, 1 October 2008 (UTC)[reply]
Thank you! Nice to see that the amount of geocoded images nearly doubled within 5 months. Thanks for the hint to the toolserver address. Longbow4u (talk) 18:44, 4 October 2008 (UTC)[reply]

Hello Para, I want to invite you to the Berlin Workshop 2009. Together with Dschwen it could be a good geocoding meeting for future developments. But also for photograph, it could be nice meeting. Berlin is fascinating and to see the spirit of commons live will be very interesting. It can also be that you can take a part of your travel together with user:Cecil, because she live in the moment in the same part of europe. So you can think about it.

To the future developments: I believe you know query-to-map in the meantime, new could be that the integration into mediawiki is in work.
In the moment I'm absolutely fascinating from http://gigapan.org and I want such a bot and such a viewer for commons�;-).

Greetings Kolossos (talk) 19:19, 30 September 2008 (UTC)[reply]

Here my first results: http://www.gigapan.org/viewProfile.php?userid=7076
If I reduce the resolution I can also upload some smaller panoramas to Commons. The pixel quality is than very nice, you can see it on my user page. --Kolossos (talk) 08:55, 30 October 2008 (UTC)[reply]

Did you see Image talk:BD-propagande-2 (en).jpg? AnonMoos (talk) 17:46, 25 October 2008 (UTC)[reply]

I did now, hmm. The text is written by the artist, whose English seems fluent to me. I'm not sure which he wanted to go with, entire publishing houses or their individual editors making the choice... maybe ask User:Rama then? --Para (talk) 10:47, 26 October 2008 (UTC)[reply]

Geocoding

Hi. The KML tool for google earth which shows commons photos seems to be bugged - replag is 0, but images geotagged over 24hrs ago aren't showing up on the map. Older ones are. -mattbuck (Talk) 11:25, 26 October 2008 (UTC)[reply]

Thanks for the note, I had done some quick patching when the most up to date commons database on the toolserver went down, and forgot to switch it back when it started working again. Fixed now! --Para (talk) 11:39, 26 October 2008 (UTC)[reply]
Great job, thanks very much! -mattbuck (Talk) 11:44, 26 October 2008 (UTC)[reply]
I think that the Geocoding to do tool may be suffering the same problem - it claims that Category:Council Wards of Bristol doesn't exist.[2] Also, looking at Bristol, it has several images there (the church with the dark blue sky for example) which aren't even in the category. -mattbuck (Talk) 13:33, 26 October 2008 (UTC)[reply]
Fixed too! Though this time it's the toolserver admins who forgot to change things. The church image is still in the list because it's in the category through the Bristol article. I'll have to think of similar ways to flatten categories a bit, it's a pain to have to click so many times just to find things to geocode. How to keep it meaningful though, hmm... --Para (talk) 14:16, 26 October 2008 (UTC)[reply]
Well, catscan allows you to find category intersections. All geocoded stuff is in Category:Media with locations, so if you can make it search X levels down for stuff NOT in media with locations, where X is default 1 but changeable if you want, that would work. Just would need a complete list of all categories that it would then be listing, and any direct subcats not listed. -mattbuck (Talk) 02:55, 30 October 2008 (UTC)[reply]

To make the categories flat it could be good to think about the The Nested Set Model [3]. Also if it is to usable for real time solution it could be good for many applications and all projects, if the values would be stored on a central toolserver database. Offcourse there would be many duplication, because we have a polyhierarchical category structure. And we have bugs and circles in our category system, so the challenge is not trivial. --Kolossos (talk) 08:43, 30 October 2008 (UTC)[reply]

RE : Strawberry milkshake Photo

Hi Para,

Could you tell me whether the following statement corresponds to your expectations for a publication in my next book in French-speaking countries, such as France, Switzerland, Belgium, Canada, Morocco, or if it lacks an element declaration :

“ Photo by NickSS, Strawberry milkshake.jpg. Source http://commons.wikimedia.org/wiki/Image:Strawberry_milkshake.jpg. Reproduced under license cc-by-2.0 - http://creativecommons.org/licenses/by/2.0/.

And do you prefer I use the " new version of this license which is available : Attribution 3.0 Unported " ?


I thank you in advance, ARE

It's not my image, but your plan seems to me like it's compliant with Commons:Reusing content outside Wikimedia#CC-BY. I don't think you can use a newer Creative Commons license without asking the author, since the license doesn't have any "this or any later version" clauses in it. If you want to contact the photographer and have noticed that he's no longer on Flickr, his archived Flickr profile has a link to last.fm, where he's still around. Good luck with the book! --Para (talk) 17:52, 11 November 2008 (UTC)[reply]

I thank you very much for this accurate reply. ARE

Layer with category?

Is it possible to see all commons pictures on [4] that are in a certain category? I want to have a map of all sundials on the world: Category:Sundials. Thanks for help. I already asked at de:Wikipedia Diskussion:WikiProjekt Georeferenzierung/Wikipedia-World, I will check back here, but I am more frequently on the german wikipdeia at de:User:Thire. --Thire (talk) 21:27, 10 November 2008 (UTC)[reply]

On the English Wikipedia I have a tool that makes a map of a category and its subcategories, see for example a map of en:Category:Clocks. I can generalise the tool a bit and make it work similarly for Commons too. I'll let you know on the German Wikipedia when it's working. --Para (talk) 17:31, 11 November 2008 (UTC)[reply]

Great, thank you very much. de:Benutzer:Thire, --Thire (talk) 08:17, 12 November 2008 (UTC)[reply]

Any news on in this corner? --Thire (talk) 20:51, 1 December 2008 (UTC)[reply]
Sorry, I've been lazy^H^H^H^Hbusy. Here's a taste. Is it disappointing? I don't know, but I would imagine that many of the images in the category are not geocoded. User:Dschwen might be interested in making a category view for his WikiMiniAtlas as well. --Para (talk) 11:50, 4 December 2008 (UTC)[reply]
No, not disappointed at all! It look great, thanks a lot! Is this only a temporary solution or will it always be there? Yes there could be more geocoded and more sundial images, but it's growing... And I contacted him at de:Benutzer_Diskussion:Dschwen#Sonneuhratlas. --Thire (talk) 09:18, 6 December 2008 (UTC)[reply]

Thank you!

Hi Para, I saw you added geocodes to some of the images I uploaded. Thank you for sharing the work with me, it's not a bad job but a bit of a time-consuming one. I do try to get the location correct, but -see the discussion in the Village Pump- some people expect me to get it as exact as 0,01 second...;) Regards, MartinD (talk) 13:24, 19 November 2008 (UTC)[reply]

Hi, and thanks for participating, it gives others a nice way for some armchair traveling. I'd say that geocoding is good when it's about as precise as satellite images of the area are. In areas with many landmarks it's nice to have it accurately, but at the countryside where it might be difficult to find the exact location and the satellite imagery might not be reliably placed anyway, I don't think it matters that much. --Para (talk) 11:54, 20 November 2008 (UTC)[reply]
I agree. With most of the pics to which I've added geocoding I did manage to pinpoint them to an accuracy of, say, 20 to 30 meter, and I do think this is accurate enough for armchair travelling -lovely expression! Regards, MartinD (talk) 16:13, 20 November 2008 (UTC)[reply]
Ok, I have to comment on that, sorry, the I do think this is accurate enough approach is detrimental to the project! We want as accurate as possible. I agree with Para's statement about accuracy of the underlying satellite material (if that is you only way of geocoding, so be it. GPS receivers offer higher accuracy though). Justifying low accuracy with some arbitrary application of the geodata (here: armchair travelling) is a logical fallacy. I can always come up with an application that justifies a much higher accuracy. Nonetheless, thank you for participating in the geocoding effort. Let's just keep the quality of our dataset as high as possible. --Dschwen (talk) 16:44, 20 November 2008 (UTC)[reply]
True, true. Users like MartinD would no doubt be responsible enough to mention their 20-30m meh level with an accuracy parameter and that would more or less solve the damaging effect by marking it clearly, but would others bother to use it? To make such a parameter more used, we could add it to images imported with bots from sites like Flickr and Geograph, and have that average on images from there, until reviewed here? Though I suspect that the percentage of geocoding from external sources is quite small. Anyway, with an accuracy parameter people could splatter their images on the map with good conscience, knowing that others could see how accurately they did it, and without having them resort to implied accuracy from counting decimals. I guess all these parameter solutions come down to the problem of not having a good interface to easily fill them all in. --Para (talk) 23:14, 20 November 2008 (UTC)[reply]

Let's put it this way: with most of my pictures I can remember where I stood when I took them within the aforementioned 20 to 40 meter, and I try to pinpoint the geodata at that spot. This means that when somebody goes to that spot, directed by a GPS or a map, will be able to say, ah yes, this is where this picture on Wikipedia was made, I recognize this scene. If you stand on the spot where Image:ING House Amsterdam.JPG was made, you will see this building. Idem for Image:Plofsluis.jpg, Image:Lagrasse overview.jpg and other pics I made. If this isn't good enough for you gentleemen, please tell me and I will stop addding geodata. I had understood that it was appreciated if people supplied those data, but I not have the impression that I was mistaken. Regards, MartinD (talk) 09:44, 21 November 2008 (UTC)[reply]

Ok, ING House Amsterdam.JPG is off by about 200m. I sense a slight annoyance in your post and I'm sorry if I was the cause. Volunteering on Commons should be fun and relaxed. But at the same time we owe our users to uphold a certain quality standard. I guess this is one of the times where the two goals clash. Adding geodata is definitely appreciated, but all happy-clappy friendlieness aside, I'm not going to applaude geocoding which is that inaccurate. There is plenty of room to misunderstand my post, so let me try to be clear. I'm not telling you to stop geocoding! But I'd rather have a picture not geocoded than having it geocoded inaccurately. Why? Because if it is not geocoded then it is more likely that somebody else is going to add good geocoding. So while your efforts in general are certainly appreciated, they are kind of wasted if not done properly. --Dschwen (talk) 17:15, 21 November 2008 (UTC)[reply]
No offence taken.;) I'll look at the geocode for ING House, again, I agree with you that 200 metres difference is not quite what I'd like to see myself. But then again, it was the first pic I did and the tool I used required a bit of getting used to. At the first attempt, I located this building somewhere in Berlin.;) As to the fun-versus-quality issue: I quite agree with what you say. So, let's not get into differences, and just keep up building Wikipedia. Regards, MartinD (talk) 11:03, 22 November 2008 (UTC)[reply]
Just saw that you already fixed the geocoding for ING House, thx! MartinD (talk) 11:04, 22 November 2008 (UTC)[reply]

Geocoding of Bundesarchiv

Hello, what do you think about geocoding of the "Bundesarchiv" images like proposed Commons:Bundesarchiv/Todo#Georeferenzierung. Most of the images are propaganda for Nazi Germany or socialism. In our mashup it would be without a comment. Have we a chance to seperate these images? It's interessting to watch them but you need to be carefully. --Kolossos (talk) 21:24, 10 December 2008 (UTC)[reply]

Oh yes, absolutely, they should be geocoded wherever possible, and I have been geocoding some myself already. I do understand the desire to separate them from other photos though, and I remember commenting about it before, that when browsing images that are mostly from the present day, it can be surprising seeing something very different in exceptional circumstances. That would need the same filtering as browsing old images only. It would be technically possible to parse dates from the Information template and put them in the database, but flexible client side solutions for handling that information are a bit lacking. A separate layer with a date range in a parameter in the url would work of course, but being a bit of a hack, it's not that flexible and I'm not sure how much it would be used. Have to see if there's enough interest. --Para (talk) 23:46, 10 December 2008 (UTC)[reply]

Diner near Bear

Thanks for this! --InfantGorilla (talk) 14:37, 26 January 2009 (UTC)[reply]

You're welcome! Now if only we could pinpoint the location where it used to be... --Para (talk) 16:12, 26 January 2009 (UTC)[reply]

Hi, can you explain to me, what this list means? A number fo images from en:Taos pueblo were deleted because they are on this list. If I interpret your list correctly, these images were relicensed on Flickr but only from cc-by-2.0 to cc-by-2.5 and I can't see why that should not be a valid license. Kind greetings --h-stt !? 22:58, 5 February 2009 (UTC)[reply]

You probably missed that the list scrolls right. The author of the Taos pueblo images changed their license from cc-by-2.0 to All rights reserved at the end of 2006. Creative Commons licenses are irrevocable, but mistakes can happen when people choose licenses on Flickr, and I can't guarantee that the images behind the ids my script recorded were the same as they are now. Back then we didn't have a bot or people reviewing Flickr licenses, and that's all that matters now really, not my old list. The images were deleted simply because no trusted user had confirmed that they used to be available with a compatible license before 2007. To keep them, you can still try to convince the photographer to change her mind and relicense. It often happens that people allow a more permissive cc license if they're just asked for it. For that Commons:Email templates and en:Wikipedia:Example requests for permission may provide some pointers. --Para (talk) 00:40, 6 February 2009 (UTC)[reply]
Thanks for the explanation, I did miss the total scope of the scrolling. And we do have enough decent images of the motive, just those were perfect in color, so I miss them a bit. Anyway, have a nice weekend. --h-stt !? 14:31, 7 February 2009 (UTC)[reply]

Thanks for the hint about the unlicensed use of my image. Is there any default behaviour for these cases? Andreas Tille (talk) 14:43, 9 February 2009 (UTC)[reply]

I don't think anyone has written instructions for it, but it would certainly make sense to have a page on Commons, seeing as most images are works by a single person and not by a bunch of people like Wikipedia articles. I remember the general guidance has been to do what stock photography agencies do; send an invoice. The discussions I remember or found with search are Commons talk:Licensing/Archive 8#No attribution, Commons:Village pump/Archive/2008Jan#a different kind of .22fish story.22, Commons:Village pump/Archive/2008Apr#Using GFDL images without attribution, Commons talk:Reusing content outside Wikimedia#Reuse abuse.3F, File talk:KeizersgrachtReguliersgrachtAmsterdam.jpg, Commons:Village pump/Archive/2008Dec#Images in Britannica and User talk:Lycaon#A funny story. Maybe for best results you should ask those others who have had this happen before? --Para (talk) 15:47, 9 February 2009 (UTC)[reply]

Duplicate file name problem

You've quite correctly found a higher quality version of File:2007 Niger soldiers.JPG Unfortunately the proposed replacement file File:Nigeria Army 322nd Parachute Regiment.jpg has a bad name which must be corrected. The people in question are from Niger not Nigeria, a rather major distinction. Please either correct the name of File:Nigeria Army 322nd Parachute Regiment.jpg or replace the lower quality image at File:2007 Niger soldiers.JPG with the higher quality image at File:Nigeria Army 322nd Parachute Regiment.jpg and delete the filename File:Nigeria Army 322nd Parachute Regiment.jpg. Thank you. T L Miles (talk) 18:02, 9 February 2009 (UTC)[reply]

I just went ahead and fixed this for you. The correct file name is File:Niger Army 322nd Parachute Regiment.jpg. Please go back and remove the universal replace for the Bad filename File:Nigeria_Army_322nd_Parachute_Regiment.jpg and delete that file. Thank you T L Miles (talk) 22:23, 9 February 2009 (UTC)[reply]
I marked a file with a badly formatted description page as a duplicate of the same file uploaded earlier, and had nothing to do with whatever may have happened after. MediaWiki does not support renaming files, and the hacks used for it lead exactly to these kinds of problems. I suggest you contact the people who control image replacement. --Para (talk) 14:59, 10 February 2009 (UTC)[reply]
Thanks for your useful response. en wikipedia, amongst other places, now links to a mis-identified file. Perhaps in the future you could proceed more carefully, as failing to do so creates more work for others, such as me, who have no involvement other than trying to make sure wikipedia has access to images with some appearance of accuracy. T L Miles (talk) 19:01, 10 February 2009 (UTC)[reply]

"Image cannot be modified"

OK. I do it. --M�dis �gnes Vadszederke (talk) 18:59, 11 February 2009 (UTC)[reply]

GeoCommons on Wikimedia Commons

Hi Para! I have a problem with the heading-function. In my GoogleEarth, the icon ever points to north. --Druffeler (talk) 13:46, 13 February 2009 (UTC)[reply]

Hmm. This problem seems to have appeared with the new Google Earth 5.0. It worked ok with the previous version, 4.3.something. I can't figure out whether the KML is malformed somehow or if it's a bug in the new GE version. Can you confirm what version you're using? --Para (talk) 15:47, 13 February 2009 (UTC)[reply]

This is bizarre. Here's what the server sends for File:2008-09-21,03b, St. Pius-Kirche Wiedenbr�ck.jpg:

Expand to see
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
 <Style id="Commons-logo">
  <IconStyle>
   <scale>0.5</scale>
    <Icon>
     <href>http://toolserver.org/%7Epara/GeoCommons/Commons-logo-centered.png</href>
    </Icon>
  </IconStyle>
  <LabelStyle>
   <scale>0</scale>
  </LabelStyle>
  <BalloonStyle>
   <text>$[description]</text>
  </BalloonStyle>
 </Style>
 <Style id="Commons-logo-highlight">
  <IconStyle>
   <scale>0.6</scale>
   <Icon>
     <href>http://toolserver.org/%7Epara/GeoCommons/Commons-logo-centered.png</href>
   </Icon>
  </IconStyle>
  <BalloonStyle>
   <text>$[description]</text>
  </BalloonStyle>
 </Style>
 <StyleMap id="Commons">
  <Pair>
   <key>normal</key>
   <styleUrl>#Commons-logo</styleUrl>
  </Pair>
  <Pair>
   <key>highlight</key>
   <styleUrl>#Commons-logo-highlight</styleUrl>
  </Pair>
 </StyleMap>
  <Placemark>
   <name>2008-09-21,03b, St  Pius-Kirche Wiedenbr�ck</name>
   <Snippet></Snippet>
   <description><![CDATA[<h2><a href="/proxy/https://commons.wikimedia.org/?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2F"><img src="/proxy/https://commons.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/20px-Commons-logo.svg.png?__proxy_cookies_to=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F4%2F4a%2FCommons-logo.svg%2F20px-Commons-logo.svg.png" width=20 height=27><img src="/proxy/http://toolserver.org/%7Epara/GeoCommons/Commons-logo-text.png" width=264 height=27></h2>
<center><a href="/proxy/https://commons.wikimedia.org/wiki/Image:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg"><img src="/proxy/https://commons.wikimedia.org/wikipedia/commons/thumb/c/c9/2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg/580px-2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fc%2Fc9%2F2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg%2F580px-2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg" width=580 height=439></a>
<h2><font color="#006499">2008-09-21,03b, St  Pius-Kirche Wiedenbr�ck</font></h2></center>
<table border=0 cellspacing=0 cellpadding=0 width="100%"><tr><td><a href="/proxy/https://commons.wikimedia.org/wiki/Image:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg">Details for this image on Commons</a> (anyone can edit!)</td><td align="right"><a href="/proxy/https://commons.wikimedia.org/wiki/Image_talk:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage_talk%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg">Discussion</a></td></tr></table>]]></description>
   <styleUrl>#Commons</styleUrl><Style><IconStyle><heading>180</heading></IconStyle></Style>   <Point>
    <coordinates>8.3033931804897,51.827914549578</coordinates>
   </Point>
  </Placemark>
 <Placemark>
  <Style>
   <IconStyle>
    <Icon>
    </Icon>
   </IconStyle>
  </Style>
  <Point>
   <coordinates>8.30339318049,51.8279145185</coordinates>
  </Point>
 </Placemark></Document>
</kml>

But when I copy the received placemark from GE, it gives a converted presentation:

Expand to see
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
	<name>KmlFile</name>
	<StyleMap id="Commons">
		<Pair>
			<key>normal</key>
			<styleUrl>#Commons-logo</styleUrl>
		</Pair>
		<Pair>
			<key>highlight</key>
			<styleUrl>#Commons-logo-highlight</styleUrl>
		</Pair>
	</StyleMap>
	<Style id="Commons-logo-highlight">
		<IconStyle>
			<scale>0.6</scale>
			<Icon>
				<href>http://toolserver.org/%7Epara/GeoCommons/Commons-logo-centered.png</href>
			</Icon>
		</IconStyle>
		<BalloonStyle>
			<text>$[description]</text>
		</BalloonStyle>
	</Style>
	<Style id="Commons-logo">
		<IconStyle>
			<scale>0.5</scale>
			<Icon>
				<href>http://toolserver.org/%7Epara/GeoCommons/Commons-logo-centered.png</href>
			</Icon>
		</IconStyle>
		<LabelStyle>
			<scale>0</scale>
		</LabelStyle>
		<BalloonStyle>
			<text>$[description]</text>
		</BalloonStyle>
	</Style>
	<Placemark>
		<name>2008-09-21,03b, St  Pius-Kirche Wiedenbr�ck</name>
		<Snippet maxLines="0"></Snippet>
		<description><![CDATA[<h2><a href="/proxy/https://commons.wikimedia.org/?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2F"><img src="/proxy/https://commons.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/20px-Commons-logo.svg.png?__proxy_cookies_to=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F4%2F4a%2FCommons-logo.svg%2F20px-Commons-logo.svg.png" width=20 height=27><img src="/proxy/http://toolserver.org/%7Epara/GeoCommons/Commons-logo-text.png" width=264 height=27></h2>
<center><a href="/proxy/https://commons.wikimedia.org/wiki/Image:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg"><img src="/proxy/https://commons.wikimedia.org/wikipedia/commons/thumb/c/c9/2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg/580px-2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fc%2Fc9%2F2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg%2F580px-2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg" width=580 height=439></a>
<h2><font color="#006499">2008-09-21,03b, St  Pius-Kirche Wiedenbr�ck</font></h2></center>
<table border=0 cellspacing=0 cellpadding=0 width="100%"><tr><td><a href="/proxy/https://commons.wikimedia.org/wiki/Image:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg">Details for this image on Commons</a> (anyone can edit!)</td><td align="right"><a href="/proxy/https://commons.wikimedia.org/wiki/Image_talk:2008-09-21,03b,_St._Pius-Kirche_Wiedenbr�ck.jpg?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage_talk%3A2008-09-21%2C03b%2C_St._Pius-Kirche_Wiedenbr%EF%BF%BDck.jpg">Discussion</a></td></tr></table>]]></description>
		<styleUrl>#Commons</styleUrl>
		<Style>
			<IconStyle>
				<heading>180</heading>
			</IconStyle>
		</Style>
		<Point>
			<coordinates>8.303393180489699,51.827914549578,0</coordinates>
		</Point>
	</Placemark>
</Document>
</kml>

Yet when I paste either one back to Google Earth, or save it to a file and then open the file, both work fine!! Or if I create a NetworkLink that points to that file on a web server, it still works. I can't figure out what's going on. Will have to simplify the output to spot the problem... --Para (talk) 16:10, 13 February 2009 (UTC)[reply]


My Google Earth-Version is 5.0.11337.1968 (beta). I have copied the first one in a new file and opened it with GE - it works! I wish you a nice weekend!--Druffeler (talk) 18:08, 13 February 2009 (UTC)[reply]

Don't misunderstood: Only the one file works, all other icons point to north!--Druffeler (talk) 14:38, 17 February 2009 (UTC)[reply]
Right, I think it's a bug in the new Google Earth version, but it's too much work for me to reproduce, simplify and post a bug report, so I'll leave that to someone else.�:) Meanwhile, I changed it to use pre-rotated icons, which were used with Google Maps already. 32 different headings ought to be enough with our wonky Commons icon. --Para (talk) 15:53, 17 February 2009 (UTC)[reply]
Now it works on every picture! Thanks!--Druffeler (talk) 16:37, 17 February 2009 (UTC)[reply]

imgSeek

You probably won't notice my reply to that old VP topic. So here it is:

That was an excellent suggestion. I didn't know of imgSeek before. I generated a few test searches in a set of 22000 commons images (not very many) starting at http://toolserver.org/~dschwen/woodeye/imgseek01.html . I'm sure results improve with more indexed images. --Dschwen (talk) 22:08, 18 February 2009 (UTC)[reply]

Looks good, I suppose (would have to know some of the best matches to see if it finds them!). I think Gmaxwell had copies of all Commons images, so he might be able to help generate a complete database once you find a good algorithm. Or maybe even have it running on the Wikimedia servers? --Para (talk) 02:50, 21 February 2009 (UTC)[reply]
Running an indexer on the toolsever right now, to index the pictures of the last 100 days. This is going to take a long time. It would be great to make a torrent of all 800px preview images... --Dschwen (talk) 02:52, 21 February 2009 (UTC)[reply]
It is interactive now and working with a database of 120000 images. [5] --Dschwen (talk) 05:58, 23 February 2009 (UTC)[reply]


Custom icons in kmlexport

Hey. We are testing out the great kmlexport-tool at Nynorsk Wikipedia (nn:Hovedside), hope that is OK.

We use it mostly on categories, here is an example of churces in Norway from the 12th century.

What would be cool would be if we could add an icon (in this case maybe a church). It seem to be possible with the Google API. One icon per map would be fine in most of our cases, so an icon parameter in the url would be nice.

On a side note, I know this tool is written for the English wikipedia, but: Right now the namespace prefix for categories has to be Category (not our localized Kategori) for it to work. We have made a workaround for this, but... --Bep (talk) 23:43, 10 March 2009 (UTC)[reply]

Done! Tools that just work for any page regardless of namespace are cool, and icons pretty.�:) Map of the Nynorsk Wikipedia Kategori:Norske kyrkjer fr� 1100-talet works now with the icon given in the url. de:Wikipedia:WikiProjekt Georeferenzierung/Wikipedia-World/en also uses icons in their Google Earth layer, and they might have some ideas on how to figure out an icon without pointing to one in every category, if you're interested in developing it to that direction. The last time I checked Google Maps, style references weren't supported with icons, but now it seems to be working fine. Odd that Live Search Maps shows a totally different icon even though it refers to the same icon url, but I guess the icon Google gives from that url isn't what Google Maps uses internally; it's just a reference to a church icon in their icon palette regardless of version. Anyway, good to see some icon working on both. --Para (talk) 17:57, 11 March 2009 (UTC)[reply]
Thanks a lot, that was fast! I will have a look at what they are doing over at de, but for now this is cool. --Bep (talk) 20:48, 11 March 2009 (UTC)[reply]

Graph update

Can you do it please?�:-) I have already written on the graph talk page. I would normally update it myself, but I am too lame to work with .svg graphics, so I simply want some help. Spending some time by adding coordinates, it would be nice to see a newly updated graph. --Aktron (talk) 22:51, 30 March 2009 (UTC)[reply]

Hahaa! I already did it today but forgot to add a note on the talk.�:) Good work geocoding the images! --Para (talk) 22:55, 30 March 2009 (UTC)[reply]

earth.php

Is the source available? If not, no problem. I am idly curious whether you are using this sort of syntax

 http://maps.google.com/maps?q=34,-110&z=10&output=kml 

to generate the google earth kmls. I am curious because I noted their pushpin kmls store timespans now eg: <gx:TimeSpan><begin>2002-07-19T23:59:59Z</begin><end>2002-07-23</end></gx:TimeSpan>. You set these values on the view tab. Is there a place where they document the api you are using- that is, what legally goes in a q, z, etc? -J JMesserly (talk) 08:22, 11 April 2009 (UTC)[reply]

It can be if you like, but it's not very interesting. It generates the KML file for the given parameters itself without using Google services, following http://code.google.com/apis/kml/documentation/kmlreference.html. The Google Maps site parameters aren't documented anywhere on their side that I know of, and the best documentation I've found is at http://mapki.com/wiki/Google_Map_Parameters. That's probably mostly reverse-engineered and doesn't mention what you're after, but I don't think time is covered in the "url api" anyway. Times can be used with KML's standard <TimeStamp> and <TimeSpan>, but there we'd go further than geocoding, and the information is not available to GeoHack without establishing some kind of callback feature. There'd have to be a tool that retrieves a wiki article and parses it for coordinates and times, but first you'd need to find a way to link the two together somehow for cases with more than one pair. I suppose the people who craft microformat parsing tools could help with that. --Para (talk) 10:51, 11 April 2009 (UTC)[reply]
Thanks for the quick response, and that is good to know you are generating this yourself. I can imagine what you are doing in the code, but yeah I would like to understand the entire linkage so if you can add a ?code parameter that would be great. Re: time pairs- you mean something more that start/end pairs in a gxtimespan[6]? Re: templates, I have some preliminary event templates on en:WP and have been trudging through MOSNUM building consensus for a reasonable syntax that will be used in them. I was starting to roll my own here, but went there due to the larger audience of folks that understand time issues like Julian, timezone arcanery and microformat dtend adjustments. When the design is stable, the framework of those will be folded back into the work here. Anyway, Google Earth and the other visualizers are interested in time, and although Google uses the general term "historical imagery"[7] to refer to the use of this data[8], currently Earth only uses the slider to move back to earlier aerial photos. But as more kml layers become available it doesn't take genius to anticipate them introducing such a marker filter. So for instance the user could see all WP articles on events in Northern France in the 1940s. Dschwen or I could look at the scraper perl scripts and add this info to our kml files if and when any of these applications actually activate such a feature. Naturally, the templates have to be in place first or the scraping pass simply isn't going to work. Re using microformats- I am leary of that road because even if everyone had microformat aware browsers and crawlers, it currently is only being used on the browser side for the task of proceeding from known time/space information. This is good for information discovery only after search targets of unknown time/space coordinates is present. To illustrate what I mean, say I successfully passed the info to google earth using an Operator user script. Big deal, the user is still only doing that point by point, and it doesn't give them any new information. For instance, we have a commons picture of the Normandy Gold Beach landing, the user jumps over to google earth to see where that was, the marker has the correct time, but so what. They already know from the article what the date was. The key benefit for the user to made aware of other WP/Commons knowledge on events in that same time period nearby that location. So only if that additional unknown commons/wp information is available in the destination application is the microformat path an avenue for new information discovery. It would be swell if these guys were doing the crawling themselves and all we had to do is record the stuff in microformat html. We are emitting that information now, eg in USS Queen of the West, but they well may never use it just as html meta data tags were never used due to spamming abuse. I am supportive of the microformat guys making their initiative work, but they have to compete for our attention, and we need to serve our community with practical features. So anyway it seems to me the event templates and kml extraction are the crucial components that need to work well first.
Sure, it kind of goes beyond geocoding, but hey, it's the fourth dimension, and its in kml so what the heck. Anyway, I am focusing on the event specification portion of the problem (template wikitext) at this point, and it seems to me that the most frequently used interchange of this time metadata will use kml, not microformats both on the query and data mining side- at least in the near term. -J JMesserly (talk) 18:10, 11 April 2009 (UTC)[reply]
Ok, the source is at http://toolserver.org/~para/earth.phps. With pairs I ment camera or article coordinates paired with image recording timestamp or event timestamp/span. Most Commons image pages probably have only one of each and the page itself links the two together, but in other cases there can be multiple instances of all the components on a single page. The markup needs to link those together for any mass parser to understand the relations. --Para (talk) 22:03, 11 April 2009 (UTC)[reply]
The easiest thing at least for python and perl scripts to extract is a somewhat unique parameter name. Trying to grovel it from free text would be hopeless, and even the current templates are not much help. Eg. A date declared in {{information}} is usually the upload or photo date, not the date of the subject depicted- the time period for the map, the carbon date of the artifact, etc. Even photo timestamp is not accurate in all cases- for example the interesting timestamp for a museum photo of a painting of a battle is the date of the event depicted. So it seems like the subject matter date is what we are after, and it should be declared by the user in the same template so the mass parser will generate the highest quality results. Agreed? What's your opinion- Should that be an add on to {{location}}, or a distinct event or a generalized kml template? -J JMesserly (talk) 18:49, 12 April 2009 (UTC)[reply]
Yep, that's better than the microformat approach of trying to define non-overlapping containers, and is probably closer to the semantic wiki extensions. On Commons, being able to limit the case to images simplifies the problem. The date or location most people would give is based on the context visible for the main subject. A photo of a painting in a museum with some of its surroundings visible could well be coded to the painting's location at the time the photo was taken. A crop to just the painting wouldn't have that context anymore and the options would be the date the painting was made or the information about the depicted event. In geocoding discussions I have noticed that there are people who wish to use our projects for purposes most others are not interested of, and while they're reasonable yet edge use cases, we should find ways to let people code the information they want and only in the reuse cases filter the data. Again, on Commons the problem is simplified as users won't need to define their own events to attach dates and locations to, but the templates could allow a few predefined values for clarifying how the information applies to the image. I think some markup for the date field in the information template would be sufficient. --Para (talk) 14:05, 13 April 2009 (UTC)[reply]
It is a good choice for many reasons. Do you prefer unique parameter, or parameters polymorphic with respect to subtemplate containers? What do I mean by this. Ok for instance say we used prefix subject-mat... Hmmm. No. What prefix? Subject-matter-date or Topic-date or Event-date? Ok let's say "Topic-" as a prefix because it is short and covers artifacts and those extent of the empire of rome type maps that both aren't really events. Ok, say the choice was "topic" then for these two options we'd have:
  • unique parameters: topic-date, topic-lon, topic-lat. Optional: topic-date-end for timespans.
  • polymorphic: Within {{information}} user optionally inserts Template:Topic coordinates, and it simply has lat, lon, date, and optional date-end as parameters. This makes it tougher to parse but looks tidier/shorter/ more respectable if you run around in crowds that use words like polymorphic.
Personally, I could care less about the engineering ego trip scheme- I prefer unique parameters whose semantics are not implied by some spooky rules that users will never read about much less understand. Unless you have some objection or alternate scheme I'll do unique parameters in my sandbox version of {{information}} and put it up for proposed upgrade of the current information template. -J JMesserly (talk) 22:30, 13 April 2009 (UTC)[reply]

deleting of Geocoordinates

Hello Para, a other german user noticed that images keep in your geocoord-database weeks after the coordinates was deleted because they coords. were wrong. Here is the map and this is the Edit. Perhaps you can find the reason for this bug. Thanks.--Kolossos (talk) 21:28, 16 May 2009 (UTC)[reply]

I haven't implemented any removal of data yet, except the occasional reaction to deleted images. So far removal of geocoding from images has been a good sign of vandalism or other oddness. I periodically delete the removed data from the database as well and put the list of images up for review at User:Para/Un-geocoding (did it right now). Often when going through the images in that list, I can fix the geocoding of many of the images, but something automatic should probably be done. I just haven't found what exactly. In this case it seems to be bad data from Flickr, and I don't know how to spot that automatically. --Para (talk) 15:17, 17 May 2009 (UTC)[reply]
Ok, I believe it is the right way to copy the un-geocoding images to the wiki. So it should be also possible that other people helping you to the proving this images. A repaired image or an image that doesn't need coordinates could than delete from the page. Thank you. --Kolossos (talk) 16:45, 17 May 2009 (UTC)[reply]

Compact

As you have access to toolserver, can you run a re-index for the Mayflower search? There are some sources linked, but not available from meta:User:Tangotango/Mayflower/License -- User:Docu

Hmm .. looks like it finally works again. -- User:Docu
I've understood that the project is dead after Tangotango's continuing wikibreak and the database now years old. It was discussed a bit at Commons:Village pump/Archive/2008Nov#Mayflower. Most projects on the toolserver have only one maintainer, the one and only to have control over their tools. They're not required to release code, so when people disappear and changes happen somewhere, that's it for the tools. So even if I had read access to the code, I wouldn't be able to touch the database. The stable toolserver is an attempt at a solution with a group responsible for a project, but most people don't bother with all that. If only we had volunteers jumping in to revive dying but useful projects, they could contact the disappearing toolsmiths... --Para (talk) 10:19, 5 June 2009 (UTC)[reply]
As it draws some elements from live search, I thought it was updated. Reading the November thread, it looks like it takes some work to update the index. Maybe I should try to convince tangotango to let me update it. -- User:Docu
It's one feature rich search alright, and would be nice to keep around. Commons database dumps have become much more regular and reliable since he last updated his database, so maybe that would be good encouragement for reviving it? --Para (talk) 21:49, 13 June 2009 (UTC)[reply]

GeoGroupTemplate

I tried importing the above template. It might be worth having it here for categories such as this one. It probably needs some changes server side to work. Currently it seems to look for a wikipedia language "ommons". If you feel like look into it. -- User:Docu

Alright, someone just asked about it above too so I fixed it now. His category diving sundial map can't quite be done on demand though so there's still more work to be done, but at least simple categories and ones a few levels down should work. --Para (talk) 21:44, 13 June 2009 (UTC)[reply]

Thanks. As I'm a bit to lazy to add {{GeoGroupTemplate}} to all categories, I wonder if we should create a gadget with the following:

//* based on [[MediaWiki:Gadget-Tineye.js]]
importScript('MediaWiki:Extra-tabs.js');
 
addOnloadHook( function() {
 if (wgNamespaceNumber != 14) return;
 if( global_append_tab ) global_append_tab('/proxy/http://maps.google.com/maps?q=http%3A%2F%2Ftoolserver.org%2F%7Epara%2Fcgi-bin%2Fkmlexport%3Fproject%3DCommons%26article%3DCategory%253A' + encodeURIComponent (wgTitle.split(" ").join("_")), 'Map', 'ca-mapg');
});

I used just g as GeoGroupTemplate didn't work with "bing". We could make another one for viewing the images to geocode. -- User:Docu

I have a number of toolserver scripts that need some information copypasted from a wiki to start working, so running them as a gadget would probably make them somewhat easier to access. It might possibly even help people find them, though that corner of the preferences isn't exactly obvious to notice. I've never written gadgets yet, but if that and some MediaWiki-ns page updates are all it takes, it shouldn't be too difficult. I'll probably need to write a json interface for the geocodingtodo one then. "Bing" was blocked from the toolserver for a while because of misbehaviour and it affected map requests too, but it was changed to useragent filtering now and should work again. --Para (talk) 17:11, 14 June 2009 (UTC)[reply]

it:Special:Gadgets has an extended list of tools that can be enabled by users. My sample above seems to work. I wouldn't mind adding some of the geocoding tools in en.wp, if it's ok with the author of the tools. -- User:Docu

Magnus has a category intersect tool to get a list of geocoded images (for example of the Paris Arc de Triomphe), which a gadget could subtract from a category view. Problem is, with big categories people expect to see at least 200 images, so instead of subtracting, it would have to get a list of images that haven't been geocoded, recreate the category view and re-implement paging. I'd also like to see an ordering option, where categories that have an interwiki link to an article with coordinates (ie. categories for an object) are ordered by their orientation like my proximityrama tool shows. These might not necessarily need a tab at the top, but some other type of link on applicable pages to make them "geo-aware". Tool authors shouldn't mind unless every page visit calls the tool and overloads the server. --Para (talk) 23:07, 14 June 2009 (UTC)[reply]
CatScan should be able to some this too, but personally I like using tools:~para/GeoCommons/geocodingtodo.php. In the short term, we could add this all user contributions pages (MediaWiki:Extra-tabs.js). The map part should probably be only a gadget, at least, until we have OSM on site. We could suggest some of the other features to Aude for the OSM integration. BTW looks like I got the headings right on this one. -- User:Docu June 16
I started a discussion at Commons_talk:Geocoding#Geocoding tool addition to Special:Gadgets. -- User:Docu
Okay, let's see what people think. I think I may be a bit shy to introduce my own tools to the Commons interface.�:) Meanwhile, I wrote a Greasemonkey script to hide geocoded images from categories and link to the "round tour" tool:
Geocodedinfo.user.js
// ==UserScript==
// @name           Hides geocoded files from Wikimedia Commons categories and adds a panorama link
// @namespace      commons
// @include        http://commons.wikimedia.org/wiki/Category:*
// ==/UserScript==


//var title = unsafeWindow.wgTitle;
var title = document.title.match(/^Category:(.*) - Wikimedia Commons$/);

if (title.length>1) {
  title = title[1].replace(/ /g, '+');

  // Hide geocoded images
  getURL('/proxy/http://toolserver.org/~daniel/WikiSense/CategoryIntersect.php?wikifam=commons.wikimedia.org&basecat='+encodeURIComponent(title)+'&basedeep=1&mode=cs&tagcat=Media+with+locations&tagdeep=1&go=Scan&format=csv&userlang=en', processCatScan);
  
  // Link to proximityrama
  var iwlis = document.getElementById('p-lang').getElementsByTagName('li');
  var enlink;
  for (var i in iwlis) {
    if (iwlis[i].className == 'interwiki-en') {
      enlink = iwlis[i].firstChild.href;
      break;
    }
  }
  if (enlink) {
    enlink = enlink.replace('/proxy/http://en.wikipedia.org/wiki/', '');
    getURL('/proxy/http://en.wikipedia.org/w/api.php?action=query&prop=extlinks&format=json&titles='+enlink, processGeolink);
  }
}

function processGeolink(responseDetails) {
  if (responseDetails.status == 200) {
    var api = eval('(' + responseDetails.responseText + ')');
    for (var p in api.query.pages) {
      var els = api.query.pages[p].extlinks;
      for (var l in els) {
      	var link = els[l].*;
      	if (link.indexOf('/proxy/http://stable.toolserver.org/geohack/geohack.php') == 0) {
      	  var params = link.match(/http:\/\/stable.toolserver.org\/geohack\/geohack.php.*params=([-\d._NSEW]+)/)[1];
      	  //unsafeWindow.global_append_tab('/proxy/http://toolserver.org/~para/GeoCommons/proximityrama?params='+params, 'proximityrama', 'ca-proximityrama');
      	  location.href = "javascript:void(global_append_tab('/proxy/http://toolserver.org/~para/GeoCommons/proximityrama?params="+params+"', 'proximityrama', 'ca-proximityrama'))";
      	}
      }
    }
  }
}

function processCatScan(responseDetails) {
  if (responseDetails.status == 200) {
    var geocodedfiles = new Object;
    var rows = responseDetails.responseText.split(/\n/);

    for (var i in rows) {
      var cols = rows[i].split(/\t/);
      if (cols.length>1) {
        var file = cols[1];
        file = file.replace(/^File:/, '');
        file = file.replace(/_/g, ' ');
        file = file.replace(/"/g, '\\"');
        geocodedfiles[file] = 1;
      }
    }

    var tables = document.getElementsByTagName('table');
    var gallery;
    for (var i in tables) {
      if(tables[i].className.match(/gallery/)) {
        gallery = tables[i];
        break;
      }
    }

    var deletequeue = new Array;
    if (gallery) {
      for (var i in gallery.rows) {

        for (var j in gallery.rows[i].cells) {
          var cell = gallery.rows[i].cells[j];
          var file = cell.getElementsByTagName('a')[0].title;
          file = file.replace(/"/g, '\\"');
          if (geocodedfiles[file]) {
            deletequeue.push(cell);
          }
        }
      }

      if (deletequeue.length >0) {
        var pmedia = document.getElementById('mw-category-media').getElementsByTagName('p');
        pmedia[0].innerHTML += ' '+deletequeue.length+' <a href="/proxy/https://commons.wikimedia.org/wiki/Commons:Geocoding?__proxy_cookies_to=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FCommons%3AGeocoding">geocoded</a> files have been hidden from the view.';
      
        while (deletequeue.length > 0) {
          var file = deletequeue.pop();
          file.style.display = 'none';
          //file.parentNode.removeChild(file);
        }
      }
    }
  } else {
    GM_log("CategoryIntersect returned "+responseDetails.status);
  }
}

function getURL(url, fnCallback, fnCallbackArg) {
  new GM_xmlhttpRequest({
    method: 'GET',
    url: url,
    onload: function(responseDetails) {
      if (fnCallbackArg) {
        fnCallback(responseDetails, fnCallbackArg);
      } else {
        fnCallback(responseDetails);
      }
    }
  });
}
Ideally, the hiding of images would allow jumping back and forth between the original and filtered view, and wouldn't have the deletion issues I mentioned above. Other than that, I like the embedding of the functionality into the Commons interface, instead of visibly linking to external tools. The same approach would be nice for the proximityrama thing, too. The view is slightly different of course, but I think that should be a gadget choice as well. I have tools:~para/Commons:Special:NewFiles with a very compact image presentation, while the geocodingtodo is somewhere between that and the default Commons display. Users should be able to choose what they like to see and not depend on developers' choices. Short term might be different though ... I'm not a big fan of trying to write portable Javascript that works on all browsers, that's why Greasemonkey things are so nice. --Para (talk) 18:48, 16 June 2009 (UTC)[reply]