Closed bertt closed 7 years ago
Works on my machine
i've got the following 2 locations in the db:
{
"@iot.count": 2,
"value": [
{
"@iot.id": 2,
"@iot.selfLink": "http://localhost:8080/v1.0/Locations(2)",
"name": "TestPoly",
"description": "TestPoly",
"encodingType": "application/vnd.geo+json",
"location": {
"coordinates": [
[
[
100,
50
],
[
10,
9
],
[
23,
4
],
[
100,
50
]
],
[
[
30,
20
],
[
10,
4
],
[
4,
22
],
[
30,
20
]
]
],
"type": "Polygon"
},
"Things@iot.navigationLink": "http://localhost:8080/v1.0/Locations(2)/Things",
"HistoricalLocations@iot.navigationLink": "http://localhost:8080/v1.0/Locations(2)/HistoricalLocations"
},
{
"@iot.id": 1,
"@iot.selfLink": "http://localhost:8080/v1.0/Locations(1)",
"name": "bla",
"description": "my backyard",
"encodingType": "application/vnd.geo+json",
"location": {
"coordinates": [
-117.123,
54.123
],
"type": "Point"
},
"Things@iot.navigationLink": "http://localhost:8080/v1.0/Locations(1)/Things",
"HistoricalLocations@iot.navigationLink": "http://localhost:8080/v1.0/Locations(1)/HistoricalLocations"
}
]
}
getting now different response (no null value):
{
"value": []
}
whats your test geometry in db?
got the polygon using:
$ http://localhost:8080/v1.0/Locations?$filter=geo.intersects(location, geography'POLYGON ((-180 -90, -180 90, 180 90, 180 -90, -180 -90))')
sample:
response: