2
votes

I have a problem in retrieving entities using georeferenced queries. Use the v2 syntax.

This is my query:

GET /v2/entities?georel=near;maxDistance:1000&geometry=point&coords=13.52,43.61

and this is my entity:

{
    "id": "p1",
    "type": "pm",
    "address": {
        "type": "Text",
        "value": "Via Roma "
    },
    "allowedVehicleType": {
        "type": "Text",
        "value": "car"
    },
    "category": {
        "type": "Text",
        "value": "onstreet"
    },
    "location": {
        "type": "geo:json",
        "value": {
            "type": "Point",
            "coordinates": [ 13.5094, 43.6246 ]
        }
    },
    "name": {
        "type": "Text",
        "value": "p1"
    },
    "totalSpotNumber": {
        "type": "Number",
        "value": 32
    }
}

What is wrong? I followed the official documentation but I can not get any results as well. I also tried to reverse the coordinates, but the result does not change. Any suggestion is welcome.

1

1 Answers

0
votes

Note that longitude comes before latitude in GeoJSON coordinates, while the coords parameters does in the opposite way.

Thus, assuming that your entity is located in Ancona city, I think that using "coordinates": [ 43.6246, 13.5094 ] will solve the problem.