@@ -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,16 +53,41 @@ function formatGeoAttrs(attr) {
5353 const obj = attr ;
5454 if ( attr . type ) {
5555 switch ( attr . type . toLowerCase ( ) ) {
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'}"
56+ // GeoProperties
6257 case 'geo:json' :
58+ // FIXME: #1012
59+ // case 'geoproperty':
60+ // case 'point':
61+ // case 'geo:point':
6362 obj . type = 'geo:json' ;
6463 obj . value = NGSIUtils . getLngLats ( 'Point' , attr . value ) ;
6564 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;
6691 }
6792 }
6893 return obj ;
0 commit comments