-
Notifications
You must be signed in to change notification settings - Fork 87
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
Re-introduce GeoJSON conversion under a flag #1020
base: master
Are you sure you want to change the base?
Conversation
0be055e
to
a8456b2
Compare
Pending to define Group provision and device provision JSON payload how to enable those casting functionalities instead of having a global env flag |
@mapedraza - the global flag has been removed and |
doc/advanced-topics.md
Outdated
{ | ||
"name": "observationSpace", | ||
"type": "Polygon", | ||
"autocastGeoJSON" : "true" | ||
} |
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.
I think the following syntax would be better:
{
"name": "observationSpace",
"type": "Polygon",
"autocast" : true
}
So the way in which the autocast is done depends on the type
. This way we can extend the functionality in the future to autocast other types. E.g. to autocast to boolean (e.g. "true"
-> true
, 0
-> false
):
{
"name": "observationSpaceEnabled",
"type": "Boolean",
"autocast" : true
}
Maybe it would even better to have a autocastType
to cover cases in which the NGSI type need to be customized by the user, eg:
{
"name": "observationSpace",
"type": "MyCustomType",
"autocastType": "Polygon",
"autocast" : true
}
The autocastType
could be optional and, in the case it is ommited, type
is used.
With **NGSI-v2**, for backwards compatibility reasons, automatic GeoJSON conversion for types other than `geo:json` is turned off by default. | ||
Add the `autocastGeoJSON` configuration to the attribute to enable GeoJSON conversion. Each GeoJSON attribute can be provisioned as shown: | ||
|
||
```json |
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.
This example in documentation is for a configuration group. However, the templates modified in this PR are only about devices:
The behavior should be as follow:
- It can be enabled/disabled at configuration group level
- It can be enabled/disabled at device level. If not defined at device level, the config group setting is used (and if not defined at config group level, then assume false by default)
# Conflicts: # CHANGES_NEXT_RELEASE # doc/advanced-topics.md # test/unit/ngsiv2/ngsiService/geoproperties-test.js
doc/advanced-topics.md
Outdated
@@ -70,10 +70,10 @@ 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.
I understand this PR provides "the definitive fix" mentioned in #1012 (comment)
Thus, an entry in CHANGES_NEXT_RELEASE relating issue #1012 should be included.
Reverts #1014 and #1018. Adds
autocastGeoJSON
to the config for use with NGSI-v2 legacy systems.