1

How do I know if I am inside a geofence?

Topic: How do I know if I am inside a geofence?

Hello,

I have a question, for of "Remote API" I can find the position according to the values of altitude and length but, I would like to check or know the form with "Remote API" to know if my coordinates correspond to a geofence or if my position inside of a geofence.

Can I help you, please with this details?

2

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

Hello.

There is resource/get_zones_by_point method, in which you can pass some coordinates and set of resources with a list of zones, that will respond with filtered lists of zones which contains your point.

3

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

Hello, rual

Yes, thank you for this information but, this method I get an empty array. I put the position of geofence in the parameters "lat" and "lon"  but array is empty.

This is the request:

https://hst-api.wialon.com/wialon/ajax. … :{%220%22:[]},%22lat%22:20.578478,%22lon%22:-100.387650}}&sid=02e516527944c71a834c5f1514fbbc69

Can I help you, please? if the request is issue.

4

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

You could also try running a report template for geofences. But this is a little more complicated.

5

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

Not that solution to run a report is not recommend to use for what is being developed, thank you cerpas , The link with the Remote API is necesary but the array is empty, I don´t understand, if my request is correct.

Some suggest or idea please.

6

How do I know if I am inside a geofence?

(edited by rual 23/06/2017 10:33:22)

Re: How do I know if I am inside a geofence?

Denisse wrote:

Hello, rual

Yes, thank you for this information but, this method I get an empty array. I put the position of geofence in the parameters "lat" and "lon"  but array is empty.

This is the request:

https://hst-api.wialon.com/wialon/ajax. … :{%220%22:[]},%22lat%22:20.578478,%22lon%22:-100.387650}}&sid=02e516527944c71a834c5f1514fbbc69

Can I help you, please? if the request is issue.

You have had sent:

{"zoneId": {"0": []}, ... }

But actually you need to get list of resources, that contain geofences of your interest and send something like this:

{"zoneId": {"<resourceId1>": [], "<resourceId2>": [], ...}, ... }

// Also, do not post links with sid anywhere, because with that identifier everybody can login into your account (in short period of time, but anyway, it is insecure).

7

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

Oh rigth!

Yes, I change the request for "resourceID" is correct.

Thank you very much for this information and detail.

8

How do I know if I am inside a geofence?

Re: How do I know if I am inside a geofence?

I found the below call easy to check out all the resources along with resource IDs that I have.

svc = core/search_items and params={
        "spec":{
            "itemsType":"avl_resource",
            "propName":"sys_name",
            "propType":"property",
                "propValueMask":"*",
            "sortType":"sys_name"
        },
                "force":1,
              "flags":1,
              "from":0,
              "to":0
    }