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.


redstorm

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

wjw
162 posts

Master Geek


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

That will depend on which subnet your on.

 
 
 

Trade NZ and US shares and funds with Sharesies (affiliate link).
redstorm

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

mercutio
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

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.

redstorm

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 .

mercutio
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

redstorm

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.



mercutio
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.


bagheera
485 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.

mercutio
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 and reviews »

One New Zealand Extends 3G Switch-off Date
Posted 11-Apr-2024 08:56


Amazon Echo Hub Review
Posted 10-Apr-2024 18:57


Epson Launches New Versatile A4 Desktop Scanners
Posted 10-Apr-2024 15:31


Motorola Mobility Launches New Android Phones in New Zealand
Posted 10-Apr-2024 14:59


Logitech G Unveils the PRO X 60 Gaming Keyboard
Posted 9-Apr-2024 19:01


Logitech Unveils Signature Slim Keyboard and Combo
Posted 9-Apr-2024 13:33


ExpressVPN Launches Aircove Go Portable Router With Built-in VPN
Posted 26-Mar-2024 21:25


Shure MoveMic Review
Posted 25-Mar-2024 12:47


reMarkable 2 Launches at JB Hi-Fi New Zealand
Posted 20-Mar-2024 08:36


Samsung Galaxy S24 Ultra review
Posted 19-Mar-2024 11:37


Google Nest Wifi Pro Review
Posted 16-Mar-2024 11:28


Samsung Galaxy A55 5G and Galaxy A35 5G
Posted 12-Mar-2024 12:41


Cricut EasyPress Mini Zen Blue launches at Spotlight New Zealand
Posted 12-Mar-2024 12:32


Logitech Introduces MX Brio Webcam
Posted 12-Mar-2024 12:24


HP Unveils Broadest Consumer Portfolio of AI-Enhanced Laptops
Posted 3-Mar-2024 18:09









Geekzone Live »

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



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.







Backblaze unlimited backup