dannybess
dannybess

Reputation: 599

MapKit: Check if a user is at an address. (In a Building)

Is there anyway, using MapKit, to check if a user is in a building, at a certain address?

I have the users current position (longitude, latitude): I have a buildings address - for example, 298 Texas St, San Francisco.

Is there anyway I could tell if a user is at that address / in the building?

I have tried converting coordinates into an address, and just checking the address against the other one, however, my problem is that if the address is a house, and the user walks past it, it will return true, when, in reality, it is not.

Thanks for the help!

Upvotes: 2

Views: 170

Answers (1)

Duncan C
Duncan C

Reputation: 131481

Addresses are usually reported as "geo-points", which is just a single lat/long coordinate. Without more information, you know nothing about the size or shape of the dwelling that represents the address.

Also, addresses are sometimes entered into mapping databases by interpolating between a starting address/coordinate and and ending address/coordinate. If the houses aren't evenly spaced, the coordinates of a given address can be wrong.

Plus, GPS's are pretty unreliable indoors, especially in office buildings and multi unit dwellings.

As a result, the short answer to your question is no.

You could ask the location manager for lat/long coordinates of the address, and then use another location manager call to get the distance from the user's current location, and use a distance value (20 meters?) to decide that the user is "at that address". That's likely the best you're going to be able to do.

Upvotes: 1

Related Questions