Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




56 posts

Master Geek


#115837 8-Apr-2013 21:53
Send private message

FYI if you use Google maps API and are using "google.loader.ClientLocation" to convert IP to Longitude and Latitude google returns Null for Snaps IP range so make sure you trap for that scenario.

I just spent 1/2 an hour debugging my google map web page to find out why it broke after i moved to SNAP..


Create new topic

wjw

162 posts

Master Geek


  #795329 9-Apr-2013 06:38
Send private message

That will depend on which subnet your on.



56 posts

Master Geek


  #795357 9-Apr-2013 08:19
Send private message

wjw: That will depend on which subnet your on.


Agreed, so this is the subnet i have currently been assigned, that google cant geolocate.
111.69.195.x\x

 
 
 
 


1387 posts

Uber Geek


  #795379 9-Apr-2013 09:21
Send private message

redstorm:
wjw: That will depend on which subnet your on.


Agreed, so this is the subnet i have currently been assigned, that google cant geolocate.
111.69.195.x\x


On whois that's listed as:

inetnum: 111.69.192.0 - 111.69.223.255
netname: SNAPNET
descr: Dynamic
country: NZ

And Maxmind seems to have the /24 (.x\x) listed as Wellington.



wjw

162 posts

Master Geek


  #795380 9-Apr-2013 09:27
Send private message

Looking at the whois, I'd say the issue is the address fields in the contact record aren't detailed enough for the API to match it.

address: 21 Durham Street South
country: NZ

compared to:

address: Level 2 State Insurance Building
address: 88 Division Street
address: Riccarton
address: Christchurch

for one of the other ranges. I would suggest you log a ticket with them. Not hard to update just time consuming.



56 posts

Master Geek


  #795403 9-Apr-2013 09:44
Send private message

I'm not too fussed, just mentioning it in case someone else falls victim.

Ultimately i should have been trapping for the case when if googles geolocation fails use a default location for the map, which i am now doing.

if snap update their registry it will most likely fix it for that subnet, but their is no way of knowing how many other subnets around the world google cant geolocate.

For the sake of end useability, if geolocation fails i am using a default location but may not locate closest to the end user but better than not having the app work at all.

Other options are to use a better IP to geolocation database but most of those cost $$$

Or write more robust code as i should have from the beginning .

1387 posts

Uber Geek


  #795414 9-Apr-2013 10:05
Send private message

redstorm: I'm not too fussed, just mentioning it in case someone else falls victim.

Ultimately i should have been trapping for the case when if googles geolocation fails use a default location for the map, which i am now doing.

if snap update their registry it will most likely fix it for that subnet, but their is no way of knowing how many other subnets around the world google cant geolocate.

For the sake of end useability, if geolocation fails i am using a default location but may not locate closest to the end user but better than not having the app work at all.

Other options are to use a better IP to geolocation database but most of those cost $$$

Or write more robust code as i should have from the beginning .


Maybe you should consider using maxmind when google's geoip data fails?  it's kind of the authorative standard for regional geoip these days.

# geoiplookup -f /usr/local/share/GeoIP/GeoLiteCity.dat 111.69.195.122
GeoIP City Edition, Rev 1: NZ, G2, Wellington, N/A, -41.299999, 174.783295, 0, 0



56 posts

Master Geek


  #795429 9-Apr-2013 10:24
Send private message

I could do, but im in auckland and Maxmind lite is inaccurate returns Wellington but im in Auckland. but at least it gets the country right which would be slightly better for overseas visitors if the got located to their country at least.

 
 
 
 


1387 posts

Uber Geek


  #795431 9-Apr-2013 10:25
Send private message

redstorm: I could do, but im in auckland and Maxmind lite is inaccurate returns Wellington but im in Auckland. but at least it gets the country right which would be slightly better for overseas visitors if the got located to their country at least.


City data is often wrong.  Country is generally right.


391 posts

Ultimate Geek


  #795459 9-Apr-2013 10:52
Send private message

mercutio:
redstorm: I could do, but im in auckland and Maxmind lite is inaccurate returns Wellington but im in Auckland. but at least it gets the country right which would be slightly better for overseas visitors if the got located to their country at least.


City data is often wrong.  Country is generally right.



so true as ips cover the country and they been assign an ip address range they can easy move them to where needed ie got more Wellington people and running out of address in wn, move some spare ip to there.

1387 posts

Uber Geek


  #795465 9-Apr-2013 11:02
Send private message

bagheera:
mercutio:
redstorm: I could do, but im in auckland and Maxmind lite is inaccurate returns Wellington but im in Auckland. but at least it gets the country right which would be slightly better for overseas visitors if the got located to their country at least.


City data is often wrong.  Country is generally right.



so true as ips cover the country and they been assign an ip address range they can easy move them to where needed ie got more Wellington people and running out of address in wn, move some spare ip to there.


It's the same the world around, except in the US it's not even the right state often.



Create new topic




News »

Freeview On Demand app launches on Sony Android TVs
Posted 6-Aug-2020 13:35


UFB hits more than one million connections
Posted 6-Aug-2020 09:42


D-Link A/NZ extends COVR Wi-Fi EasyMesh System series with new three-pack
Posted 4-Aug-2020 15:01


New Zealand software Rfider tracks coffee from Colombia all the way to New Zealand businesses
Posted 3-Aug-2020 10:35


Logitech G launches Pro X Wireless gaming headset
Posted 3-Aug-2020 10:21


Sony Alpha 7S III provides supreme imaging performance
Posted 3-Aug-2020 10:11


Sony introduces first CFexpress Type A memory card
Posted 3-Aug-2020 10:05


Marsello acquires Goody consolidating online and in-store marketing position
Posted 30-Jul-2020 16:26


Fonterra first major customer for Microsoft's New Zealand datacentre
Posted 30-Jul-2020 08:07


Everything we learnt at the IBM Cloud Forum 2020
Posted 29-Jul-2020 14:45


Dropbox launches native HelloSign workflow and data residency in Australia
Posted 29-Jul-2020 12:48


Spark launches 5G in Palmerston North
Posted 29-Jul-2020 09:50


Lenovo brings speed and smarter features to new 5G mobile gaming phone
Posted 28-Jul-2020 22:00


Withings raises $60 million to enable bridge between patients and healthcare
Posted 28-Jul-2020 21:51


QNAP integrates Catalyst Cloud Object Storage into Hybrid Backup solution
Posted 28-Jul-2020 21:40



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.