We discovered yesterday this great resource for data feeds (thanks to great link for the great lead) at JSON IP and GeoIP REST API (IP Geolocation) by Telize. In the course of discovering its usefulness we saw that it returned geolocation data for what the ISP determined is the geographical location of your visitor IP address for your session with that ISP. So we did this at Newtown here, and went out and about and did the same execution logged into some Telstra free Wi-Fi public connection arrangement.
So if this is the case, what do you think would improve the functionality of the software? Youโve probably guessed, and the scenario is awfully similar to the scenario of Yahoo YQL Nextbus JSON Primer Tutorial โฆ we compare โourโ geographical position with the ISPโs one.
Once you have two geographical positions and you wake up โฆ well, once (a few moons ago) โฆ as a Land Surveyor โฆ youโd be obliged โฆ well, youโd just have to โฆ for all intents and purposes โฆ in the fullness of time โฆ calculate an Earth Great Circle Distance โฆ or if you think we live in a wonderful worrrrrrld โฆ we calculate an Earrrrrrth Great Circle Distance โฆ believe it or not they calculate to be the same?! Hereโs some JavaScript code โฆ
function great_circle_distance(talis, gnolis, latis, longis) {
var ourdist=0.0;
var rgnol=eval((gnolis) * Math.PI / 180.0);
var rtal=eval((talis) * Math.PI / 180.0);
var rlong=eval((longis) * Math.PI / 180.0);
var rlat=eval((latis) * Math.PI / 180.0);
var deltalong = Math.abs(eval(((gnolis)-(longis)) * Math.PI / 180.0));
var acof = eval(Math.sin(rtal) * Math.sin(rlat)) + (Math.cos(rtal) * Math.cos(rlat) * Math.cos(deltalong)); // via //en.wikipedia.org/wiki/Great-circle_distance ... thanks
ourdist = eval(Math.round((Math.acos(acof) * 6371000.0) + 0.00001) * 100) / 100;
return ourdist;
}
So we calculate this in JavaScript and show you this along with three Google Chart Map Chart scenarios โฆ
- ISP IP address position
- Your position
- ISP IP address position and Your position (to see how far apart they are on a map)
โฆ if Magellan had had Google Maps Iโm sure heโd have done something similar.
Hopefully you will find something interesting with todayโs liverun, and you can download HTML programming source code you could call geoip
html, with changes to yesterday described in thislink.
Previous relevant Geolocation ISP IP Primer Tutorial is shown below.
Itโs good every now and then to see what is new in the world of data feeds on the internet, so that is how, via this great link, we got onto the wonderful Acronym lookup resource at NaCTeM (The National Centre for Text Mining) which resulted in Acronyms Lookup Follow Up Tutorial yesterday and the day before. Today we turn our attention to another great resource JSON IP and GeoIP REST API (IP Geolocation) by Telize, whose functionality we have really enjoyed, and been intrigued by.
Geolocation is about the โwhereโ in life. Arguably the best looked after concept out of โฆ
- where?
- how?
- when?
- who?
- why?
- what?
โฆ for web applications is โwhereโ โฆ and as a former Land Surveyor itโs a great and interesting I.T. worrrrrrld out there man person.
But to use that โlastโ questioning word โฆ โwhat is the geolocation showing?โ โฆ today it is not โyourโ position, but with the Telize functionality, it is what your ISP has determined is the publicly released position of the โvisitor IP addressโ of your session.
And so it came to pass that we created the HTML/JavaScript (jQuery) geoip.html โฆ nice looking โwordโ huh?! โฆ if you want the โwhatโ of geoip.html โฆ here it is here. Golly, woke up on the โawkward cussโ side of the bed โฆ didnโt we? โฆ eh, wot?! โฆ charley โฆ maaaate?
So took geoip.html on a field trip to one of those public Telstra Wi-Fi connections you get around some public phones sometimes (isnโt it great?) โฆ speaking of which, the public phone near Clemโs in Newtown, at Mardi Gras time got a creative makeover โฆ take a squizz here โฆ and geoip.html came up with this โฆ see how the latitude and longitude are rounded โhugelyโ โฆ which puts it right in the middle of the land mass of Australia โฆ guess this is for an inaccurately positionally defined visitor IP address, which I guess is defined by the ISP, in this case Telstra. And so I learn โฆ with the tutorial picture too, I donโt live at Kensington, where the execution here at Newtown got Kensington as the location of the IP address here, so this is a web application for โball parkโ usage, but intriguing in the information available none the less, and we link things off all these interesting data items for our live
run โฆ try it yourself? โฆ was intrigued by โcontinent codeโ and found a useful link that lists countries and their capital cities for a โcontinent codeโ โฆ pretty useful .. eh? wot? govโnor? โฆ see you at the Jasmine Allen in two shakes โฆ or see you for a Monte on the Bronte.
Below are linking-to (thank you) websites with derived information of great use โฆ
- Google Maps
- Who Is
- Geotags
- Wikipedia
- World Cities Database
- Data Center Map
- Time and Date Timezone
- Google Chart Map Chart
Hereโs the crux of the HTMLโs JavaScript (jQuery) that sets up the environment for the โonloadโ event logic which mainly involves JSON parsing and analysis โฆ
$(document).ready(function() {
$.getJSON("//www.telize.com/geoip?callback=?",
function(json) {
// start of JSON parsing logic
// ...
// end of JSON parsing logic
});
});
So maybe you will find something interesting with todayโs liverun, and hope to see you tomorrow with more functionality ideas.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
7 Responses to Geolocation ISP IP Follow Up Tutorial