PDA

View Full Version : Improved Member Map



Hai-Etlik
09-11-2011, 09:04 PM
It seems to me the Member Map (http://www.cartographersguild.com/utilities/cgi-bin/WhereInTheWorld.pl) could do with a bit of an overhaul. Whenever there are two users in close proximity, it becomes rather difficult to distinguish them. If we switched to a zoomable slippy map like OpenLayers, this problem would be solved.

All it would really take is to switch the script that produces positioned marker images to one that produces GeoJSON, KML, GML, or whatever.

I slapped together a quick mockup (http://draconic.ca/foo3.html) using OpenLayers and OpenStreetMap.

Hugo Solis
09-12-2011, 06:18 PM
It does look better

RobA
09-12-2011, 06:20 PM
I did one a while back with a static dump using googlemaps:
http://ffaat.pointclark.net/gmtest/cgmembers.php

-Ro A>

Hai-Etlik
09-12-2011, 06:37 PM
I did one a while back with a static dump using googlemaps:
http://ffaat.pointclark.net/gmtest/cgmembers.php

-Ro A>

Unfortunately that's Windows and MacOS only since it uses a plugin.

Hai-Etlik
09-12-2011, 08:25 PM
I've extracted the coordinates from the original map and converted them to GeoJSON. No avatars this time as I don't know of an easy way to figure out avatar URIs from usernames. http://draconic.ca/foo4.html

Ascension
09-13-2011, 02:29 AM
I don't know if it holds for others but my coordinates on this are off by about 75 miles south, putting me in the middle of some farmland west of Farmington.

Hai-Etlik
09-13-2011, 04:14 AM
I don't know if it holds for others but my coordinates on this are off by about 75 miles south, putting me in the middle of some farmland west of Farmington.

Sorry, it's rather hard to calibrate and the resolution is only as good as the existing member map, about 3.3 degrees. It's just a proof of concept thing. Assuming the existing member map script stores its data in degrees rather than the pixel coordinates, it should be trivial to switch over, it's just a matter of replacing all those positioned div elements with an array of GeoJSON features and passing the coordinates through unchanged rather than converting them to pixels. At that point everything should be positioned correctly.

Of course if the current map script stores the pixel coordinates and not the geographic ones, it'd pretty much mean starting over.

Clercon
09-13-2011, 04:21 AM
I don't know if it holds for others but my coordinates on this are off by about 75 miles south, putting me in the middle of some farmland west of Farmington.

Well you better start moving then ;)

Redrobes
09-13-2011, 06:44 AM
The current map does have a few zooms. There is Europe and UK as well as US and Washington area. The idea was that we were going to add more as we get hot spots. The zoomable map and open layers thing is a great idea but its not working very well for me. I zoom in and the page turns all white after a few zooms. But then thats more zoom than the current map. Can you make the markers for the zoomed out very small so that the map isn't all yellow to start with.

We have the members locations stored as decimal degrees to whatever accuracy the user entered it and the pixel coords are derived from the map extents using a script. So in theory if you get it all working then it could be made accurate.

Hai-Etlik
09-13-2011, 09:26 AM
The current map does have a few zooms. There is Europe and UK as well as US and Washington area. The idea was that we were going to add more as we get hot spots. The zoomable map and open layers thing is a great idea but its not working very well for me. I zoom in and the page turns all white after a few zooms. But then thats more zoom than the current map. Can you make the markers for the zoomed out very small so that the map isn't all yellow to start with.

I've adjusted the symbolization so the points are smaller.

As for the white out, my first thought is you might have been using it while the OSM map server was overloaded. Is it working now? Were the points still visible? If it's still happening, does the same thing happen at http://www.openstreetmap.org/

tilt
09-13-2011, 09:53 AM
yeay... it got my position right... I DO live on a small dingy in the middle of the ocean between denmark and sweden - cool *lol* ... but love the zoom action, and adding member avatars would be COOL. Actually, it would be REALLY cool, if we could put a pin in a map when we register (and on our profile) to show where we live and those coordinates transfer to the official map :)

Redrobes
09-13-2011, 04:18 PM
Its a lot zippier now. Maybe it was just overloaded. But that does bring up a good point. The existing maps are all Guild internal. Would we want to have 3rd party web site stuff on the members map.

Although I too am way off of the right location I assume that this is something that can be fixed if Hai was given the lat long coords instead of ripping the pixel positions off the old map.

With the few zoom levels on the old map I didn't think there was much call to have it any more accurate but if this is something that people want then this is a neat solution. Maybe we should leave this link around for a while then put up a voting thread for leave old or go with new.

I guess we should also know something else, we have a form based web page to ask the user for their ID and location coord and store that on the guild site. How would we enter new members coords into the new system. Do we format up a new text file when a new member adds and the new map page will look to that file and put all the pins in as required. Whats the process that the OpenLayers needs / Are you able to post a sample GeoJSON file with two peoples locations put in and I'll see if I can get the old script to make one of them up for you. Then we can have both types of members map at the same time.

Hai-Etlik
09-13-2011, 05:07 PM
Its a lot zippier now. Maybe it was just overloaded. But that does bring up a good point. The existing maps are all Guild internal. Would we want to have 3rd party web site stuff on the members map.

Well, it's possible to run a map service that could be used in place of the OSM Mapnik layer using software like GeoServer or MapServer, and there are various alternatives like Tiles@home, Cloud Made, Bing, and Google. You can even have several and let the user pick. Cloud Made, Bing, and Google all require signing up for API keys, which is why I've stuck to the OSM Mapnik layer so far.


I guess we should also know something else, we have a form based web page to ask the user for their ID and location coord and store that on the guild site. How would we enter new members coords into the new system. Do we format up a new text file when a new member adds and the new map page will look to that file and put all the pins in as required. Whats the process that the OpenLayers needs / Are you able to post a sample GeoJSON file with two peoples locations put in and I'll see if I can get the old script to make one of them up for you. Then we can have both types of members map at the same time.

GeoJSON is pretty simple, this is what I used for the first example.



{ "type": "FeatureCollection",
"features": [
{"type":"Feature", "geometry": {"type":"Point", "coordinates":[-79.1, 43.1]}, "properties":{"username":"RobA", "avatar":"http://www.cartographersguild.com/customavatars/avatar768_40.gif"}},
{"type":"Feature", "geometry": {"type":"Point", "coordinates":[-123.66, 48.784]}, "properties":{"username":"Hai-Etlik", "avatar":"http://www.cartographersguild.com/customavatars/thumbs/avatar9958_2.gif"}},
{"type":"Feature", "geometry": {"type":"Point", "coordinates":[0, 51.51]}, "properties":{"username":"ravells"}}
]
};

It's really just a nested set of javascript hash tables with a bunch of constraints on how they are arranged.

It can either be embedded directly in the page with the map (as I've done with my demos), or loaded via AJAX. The properties section is pretty much freeform tagged data. I've got "username" and "avatar" but it could be any data the generating script can provide. I've dropped the avatar property from ravells' entry to demonstrate.

RobA
09-13-2011, 05:12 PM
Unfortunately that's Windows and MacOS only since it uses a plugin.


grumble grumble - api changes...
Updated it and it should not try and start google earth - no plugins required...
http://ffaat.pointclark.net/gmtest/cgmembers.php

-Rob A>

Redrobes
09-13-2011, 05:53 PM
Our location data doesn't have the avatar in there directly so if we drop that then making that JSON file is a doddle. If you can load it from the guild via an http request then its not an issue.

So we could do that if people don't mind their location being given out more accurately than it has been done so before. I think we need to have a discussion about that aspect and whether its worth proceeding to this kind of map. My sig has the current one link in it so there are 3 links to 3 types of map in this thread. Lets have some opinions from people.

Rob, your map is pretty cool too. It seems as tho we have many more members since you must have generated that last location list tho.

Hai-Etlik
09-13-2011, 07:28 PM
Our location data doesn't have the avatar in there directly so if we drop that then making that JSON file is a doddle. If you can load it from the guild via an http request then its not an issue.

Well, I was hoping the script running on the guild's host would have access to that, and maybe the URI for the user's profile page, but in its absence, just leave it out of the properties and the script degrades gracefully. Doing it from OpenLayers would seem to require using AJAX, traversing a redirect, and then screen scraping.


So we could do that if people don't mind their location being given out more accurately than it has been done so before. I think we need to have a discussion about that aspect and whether its worth proceeding to this kind of map. My sig has the current one link in it so there are 3 links to 3 types of map in this thread. Lets have some opinions from people.

Well, the script generating the GeoJSON could round to any desired precision, and/or add a random jitter. The zoom levels can also be constrained to avoid implying false precision if this were done.

Hai-Etlik
09-13-2011, 09:24 PM
OK, here it is with the data in an external JSON file:

http://draconic.ca/foo5.html
http://draconic.ca/guildmembers.json

RobA
09-13-2011, 09:53 PM
Well, I was hoping the script running on the guild's host would have access to that, and maybe the URI for the user's profile page, but in its absence, just leave it out of the properties and the script degrades gracefully. Doing it from OpenLayers would seem to require using AJAX, traversing a redirect, and then screen scraping.

Well, the script generating the GeoJSON could round to any desired precision, and/or add a random jitter. The zoom levels can also be constrained to avoid implying false precision if this were done.

We have collected the user data using a separate script that has it in csv format. That is the file I downloaded to my server and now have driving the googlemap api demo at http://ffaat.pointclark.net/gmtest/cgmembers.php

If I write a php module inside the vbulletin framework I can directly access the database and pull (for example) use avatars.

There is a location field in the user profiles. I could alternately try accessing/geolocating that. Does openstreetmaps have a geolocate API? I know googlemaps now does.

-Rob A>

Hai-Etlik
09-13-2011, 11:37 PM
There is a location field in the user profiles. I could alternately try accessing/geolocating that. Does openstreetmaps have a geolocate API? I know googlemaps now does.

Yes, it's called Nominatim: http://wiki.openstreetmap.org/wiki/Nominatim

I'm not sure I'd trust a geocoder with a field that gets used in such freeform ways. There are a lot of entries that aren't conventional place names but might get 'recognized' in interesting ways. For instance, "Over There" produces a match in Nominatim for "Down Over There Avenue, Wickenburg, Arizona".

Yandor
09-14-2011, 12:22 AM
OK, here it is with the data in an external JSON file:

http://ffaat.pointclark.net/gmtest/cgmembers.php

So I donno about you guys but this is freakishly close to where i live haha nice job, its interesting to see where this has been going!

Coyotemax
09-14-2011, 02:29 AM
... did i *really* put my actual street address in there or something? This thing nailed me right to my front lawn ;)

tilt
09-14-2011, 03:28 AM
I no problem with showing where I live, a search on google would show that anyways :) ... but people that don't want that would probably not enter their address anyway. I like the google map best, it supports my swipe-pad on the MacBook, the openstreetmap f*cks that up ;)

Redrobes
09-14-2011, 06:31 AM
My map and Robs just the use data that was given in the web form page. There is no scraping of user location data from such things as IP addresses or whatever. There is no compulsion to enter a correct or accurate location coord in the box. All I ask for when requesting members to fill it out is some general idea of where they are so that we can highlight some conventions, astronomical phenomena like eclipses, the New York art show featuring this guilds work etc as well as sometimes to request piccies of local places of real interest. Its also good to know when people speak a native non english so we can cut down on the LOLs, AFAIK, IANAL, and local slangs. But if we got your front lawn then its because you told us it. And with this months lite challenge you can now map that out to mm accuracy :D

Coyotemax
09-14-2011, 11:23 AM
lol

I wasn't complaining, sorry if I came across that way. I typically don't give out my address, but i recall thinking at the time that I'd done a KMZ (?) file for google earth with a 3d model of my house (including garage, deck and pool!) and put it up (sketchup thread i think).. so anyone who really wanted to find me would be able to anyhow ;)

I just forgot I'd done that till I thought about it, and was being surprised at the accuracy.

RobA
09-14-2011, 01:05 PM
lol
...
I just forgot I'd done that till I thought about it, and was being surprised at the accuracy.

oops - the data was supposed to be fuzzed by a 10th of a degree random function (6 miles at the equator, less as you head to the poles)...but that was disabled.. now it isn't. disabled, that is. I mean, it is being fuzzed now ...

-Rob A>

Hai-Etlik
09-14-2011, 05:50 PM
oops - the data was supposed to be fuzzed by a 10th of a degree random function (6 miles at the equator, less as you head to the poles)...but that was disabled.. now it isn't. disabled, that is. I mean, it is being fuzzed now ...

-Rob A>

Scale the jitter in the longitude by 1/cos(lat). That'll make east west and north south jitter equal for all latitudes, or at least pretty close as it treats the Earth as a perfect sphere.