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.



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

 
 
 

GoodSync. Easily back up and sync your files with GoodSync. Simple and secure file backup and synchronisation software will ensure that your files are never lost (affiliate link).
mercutio
1392 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
539 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
1392 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 »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.