Determine if current location is inside or outside

2019-07-23 14:18发布

I'm using indoorAtlas SDK. I already succed to show current location and floorplan using indoorAtlas. But it has some weird result.

If i'm inside building that i listed the floorplanid and venue id, it gives the correct current location. But when i'm outside that building and i'm trying to locate current location it gives the result in the floorplan map but it gives some random location.

Is there any way to give some notification or action that i'm outside in area that i'm listed floorplanid and venueid ?

1条回答
爷、活的狠高调
2楼-- · 2019-07-23 15:04

In current SDK there is nothing that would give you straight answer to your question. I'd say that your best tools at the moment are the getUncertainty() -method in returned location update (ServiceState -class) combined with platform locations. Experiment with uncertainty value (radius in meters) to see when it would be best to start trusting platform locations over IndoorAtlas's indoor locations and to conclude that user has exited the building. In a more advanced version, when moving towards the edges of your floor plan (or better yet towards the exits) you could be more sure that transition (in->out, out->in) is likely to take place.

You could also combine this logic with geofences (http://developer.android.com/reference/com/google/android/gms/location/GeofencingApi.html) in one or more ways. E.g. use geofence as an indication that IndoorAtlas services should be turned on as user may enter a building and when entered, dynamically create a larger geofence as a safeguard to help your algorithm to detect that user has exited building and IndoorAtlas service can be turned off.

Hope this helps to find your solution.

查看更多
登录 后发表回答