Skip to content

Commit 88f3937

Browse files
committed
Update comment in code.
1 parent e724a95 commit 88f3937

File tree

1 file changed

+7
-32
lines changed

1 file changed

+7
-32
lines changed

lib/services/ngsi/entities-NGSI-v2.js

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const context = {
4444
};
4545

4646
/**
47-
* Amends an NGSIv2 Geoattribute from String to GeoJSON format
47+
* Amends an NGSIv2 Geoattribute from String to GeoJSON format.
4848
*
4949
* @param {Object} attr Attribute to be analyzed
5050
* @return {Object} GeoJSON version of the attribute
@@ -53,41 +53,16 @@ function formatGeoAttrs(attr) {
5353
const obj = attr;
5454
if (attr.type) {
5555
switch (attr.type.toLowerCase()) {
56-
// GeoProperties
56+
// GeoProperties workaround.
57+
//
58+
// This is hardcoded to only work for type=geo:json, if any other NGSI-v2 type
59+
// is required, GeoJSON conversion can be done using the JEXL transform
60+
//
61+
// "expression": "{coordinates: [longitude,latitude], type: 'Point'}"
5762
case 'geo:json':
58-
// FIXME: #1012
59-
// case 'geoproperty':
60-
// case 'point':
61-
// case 'geo:point':
6263
obj.type = 'geo:json';
6364
obj.value = NGSIUtils.getLngLats('Point', attr.value);
6465
break;
65-
// FIXME: #1012
66-
// case 'linestring':
67-
// case 'geo:linestring':
68-
// obj.type = 'geo:json';
69-
// obj.value = NGSIUtils.getLngLats('LineString', attr.value);
70-
// break;
71-
// case 'polygon':
72-
// case 'geo:polygon':
73-
// obj.type = 'geo:json';
74-
// obj.value = NGSIUtils.getLngLats('Polygon', attr.value);
75-
// break;
76-
// case 'multipoint':
77-
// case 'geo:multipoint':
78-
// obj.type = 'geo:json';
79-
// obj.value = NGSIUtils.getLngLats('MultiPoint', attr.value);
80-
// break;
81-
// case 'multilinestring':
82-
// case 'geo:multilinestring':
83-
// obj.type = 'geo:json';
84-
// obj.value = NGSIUtils.getLngLats('MultiLineString', attr.value);
85-
// break;
86-
// case 'multipolygon':
87-
// case 'geo:multipolygon':
88-
// obj.type = 'geo:json';
89-
// obj.value = NGSIUtils.getLngLats('MultiPolygon', attr.value);
90-
// break;
9166
}
9267
}
9368
return obj;

0 commit comments

Comments
 (0)