-
Notifications
You must be signed in to change notification settings - Fork 90
For NGSI-v2, ensure GeoJSON is correctly encode in the request. #854
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
Conversation
Not sure of unerstanding this PR... "geo:point" attribute type (using as value a string with comma separate values) is a legal value en NGSIv2. The provision of the IOTA devices should specify the type used in the CB update. I mean:
Is this the way it works after the PR? In that case, which particular aspect has fixed the PR? |
It is legal NGSIv2 but meaningless - an attribute defined as: However, the type {
"id": "TheFirstLight",
"type": "TheLightType",
"location": {
- "type": "geo:json",
- "value": "0, 0"
+ "type": "geo:json",
+ "value": {
+ "coordinates": [
+ 0,
+ 0
+ ],
+ "type": "Point"
+ }
}
} Only the updated version is a valid In addition, for equivalence with the NGSI-LD changes, the following
Note that GeoProperty, Point, LineString, Polygon, MultiPoint and MultiLineString are all reserved words in the NGSI-LD core context, so you cannot legally set the values to comma separated strings. |
So the fragment in the PR body {
"id": "TheFirstLight",
"type": "TheLightType",
"location": {
- "type": "geo:point",
- "value": "0, 0"
+ "type": "geo:json",
+ "value": {
+ "coordinates": [
+ 0,
+ 0
+ ],
+ "type": "Point"
+ }
}
} has a typo and really it is {
"id": "TheFirstLight",
"type": "TheLightType",
"location": {
- "type": "geo:json",
- "value": "0, 0"
+ "type": "geo:json",
+ "value": {
+ "coordinates": [
+ 0,
+ 0
+ ],
+ "type": "Point"
+ }
}
} Is my understanding correct, pls? |
In addition, with regards, to:
Question: |
Currently 1) Within the NGSI-LD IoT Agent, the default functionality is to treat each attribute as a property and the value as the native JSON type. but NGSI-LD treats GeoJSON type as native as well. Therefore Yes there was a typo in the intial diff example. The NGSI v2The idea for NGSI-v2 is to provision the attribute with NGSI LDThe equivalent for NGSI-LD is to provision the attribute with |
|
So I assumed that it was supposed to be a synonym for |
00b1445
to
20fb934
Compare
- Move Lat/Lng processing to a common location - For NGIS-v2, iterate attributes and convert common GeoJSON types - Ensure that if a GeoJSON object is parsed, it remains as GeoJSON (v2 and LD) - Amend test expectations to ensure geo:json is properly formated. - Add new NGSI-v2 tests for GeoJSON - Basic GeoJSON documentation. - Ensure consistent GeoProvisioning … - NGSI-LD supports geo:json as alias for GeoProperty - Add expression tests - Amend expectations.
20fb934
to
17e7a22
Compare
Once PR #849 the old base brach feature/842_ngsi_ld disappears. Base branch of this PR changed to master. |
This PR is ready for Review, but I'd suggest actioning #943 first so the builds aren't queuing on Travis for hours before each suggested change. |
For some weeks now, I have observed the long queuing delay you mention. Time ago, the queuing delay was not so high. Do you know if it is due to some change in Travis policy, usage terms or so? (Just curiosity...) |
Back in October Travis started throttling FOSS builds to a maximum of 500 concurrent Linux Machines across their infrastructure, this causes a backlog of unfulfilled builds to occur: Since then, as you can see the backlog now spikes during the North American Workday. This is to encourage the transition to travis's commercial product |
Done. Please sync the PR with master to get the changes. |
Done. |
@@ -46,6 +46,64 @@ curl http://${KEYSTONE_HOST}/v3/OS-TRUST/trusts \ | |||
Apart from the generation of the trust, the use of secured Context Brokers should be transparent to the user of the IoT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this PR include a CHANGES_NEXT_RELEASE entry? If I understand correctly the discussion on #961, this PR would be fixing that issue, so it could be mentioned in the CHANGES_NEXT_RELEASE entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Consequence of merging telefonicaid/iotagent-node-lib#854
I've noticed that the NGSI-v2 entity processor does not encode
geo:json
properly - this PR alters the attribute from astring
to ageo:json
as shown:This work has already been done for
GeoProperties
for NGSI-LD, and it is merely a matter of back-porting to v2 and ensuring consistency between the provisioning of both formats.This PR does the following:
It is small, so I assume it makes sense to merge into the ongoing NGSI-LD PR, but it could also be pushed to
master
afterfeature/842_ngsi_ld
has landed.