Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior of subscriptions with geoQ #1668

Open
FR-ADDIX opened this issue Sep 16, 2024 · 3 comments
Open

Strange behavior of subscriptions with geoQ #1668

FR-ADDIX opened this issue Sep 16, 2024 · 3 comments
Assignees
Labels

Comments

@FR-ADDIX
Copy link

We are using the Orion-LD fiware/orion-ld:1.6.0
We have several thousand entities of type “AIS” in the Context Broker, some of them do not yet have a location, which is only built up over time. However, we do not want to query these but only the entities with a location should be considered.

Now we want a subscription that provides us with all objects within a distance of 600 m around a point.

As a query I would use

https://apis.captn.addix.io/ngsi-ld/v1/entities/?type=AIS&geometry=Point&coords=[10.162017,54.323833]&georel=near%3BmaxDistance==600&attrs=location,name

and get 3 objects returned.
The result is perfect and fulfills all conditions.

Now we build a subscription that should deliver the same result.
In this case, significantly more objects are returned, including objects that are not within the radius.

{ “id": ‘urn:ngsi-ld:subscription:d0d261c8-73ff-11ef-a9ee-eeed2df16c72’, “type": ‘Subscription’, “subscriptionName": ‘Notify AIS Geo’, “description": ‘AIS Geo’, “entities": [ { “idPattern": ‘CAPTN’, “type": ”AIS” } ], “geoQ": { “geometry": ‘Point’, “georel": ‘near;maxDistance==100’, “coordinates": [ 10.162017, 54.323833 ] }, “notification": { “attributes": [ }, “name”, “loaction” ], “format": ‘normalized’, “endpoint": { “uri": ‘http://node-red-captn.captn.svc/yvonnegeo’, “accept": ”application/json” } } }

Objects are also output that do not have a location at the moment, which we definitely do not want.
We expect the same 3 objects here as for a query.

Are we doing something wrong, or is this an error?

@kzangeli
Copy link
Collaborator

Subscriptions with geolocation is not supported yet in the reimplementation the mongodb database layer.
The geo-info is simplky ignored. Sorry about that, not a small thing and not bandwidth enough.
I assume you start the broker with either "-experimental" or "-mongocOnly" (using the new db layer implementation).
With the old implementation (still default) that uses the old legacy mongodb driver, this should work.

So, initial question, are you using the new db layer implementation?

@kzangeli kzangeli self-assigned this Sep 16, 2024
@ibordach
Copy link

yes, because of mongodb 7

@kzangeli
Copy link
Collaborator

Ok, -mongocOnly then.
I'm quite swamped right now.
Not sure when I csn start with this. It's not a small thing.
Care to contribute? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants