Question

I'm writing a geocoding component for an app I'm building, and I decided to use Yahoo Maps. I wrote the geocode API wrapper and some unit tests and called it a day. Came back the next day, ran the tests, and found that the latitude and longitude had changed. Mind you, the change was small enough not to matter to me, but it was significant enough to affect the rounding to 4 decimal places that I was using in my unit test to compare the result.

I've never heard of changing latitude and longitude before. Is this something I should expect / account for? Can anyone explain why?

Was it helpful?

Solution

Geocoding, especially when done from addresses, is rarely 100% accurate. There are many companies who do nothing but compile the street data used for geocoding purposes.

The data is not accurate, but is frequently updated to improve address matching. When this happens, you'll get a different result. My guess is that one of two things happened:

1) Yahoo updated their source data.

2) You got a result from a different server with a different set of source data.

OTHER TIPS

Continental Drift?

The algorithms that geocoding uses are necessarily imprecise. They make certain guesses. In addition to the information given above, checkout this whitepaper:

http://www.urisa.org/files/goldberg.pdf

Which talks about those algorithms.

It sounds like it could be rounding error on the calculations being performed.

Are the results consistent now or are you still getting slightly different results?

Interesting.

Looks to me very like the things that happen when one compares 'real' numbers for equality. Usual solution to this 'problem' is to calculate Abs[x-y] < tol where x, y are your real numbers (or floats, or doubles) and tol is some small number which represents your criterion for deciding that the numbers are close enough to be considered equal for your purposes.

The map is not the territory

Something that's really easy for us, as programmers, to lose track of is that the data represent the world, they are NOT actual aspects of the world.

You've got other answers saying the same thing in more detail, specifically about geocoding, but it's worth remembering in general as well....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top