Skip to content

Commit

Permalink
Merge 29dd1bd into f116528
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Oct 19, 2021
2 parents f116528 + 29dd1bd commit 15428b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/models/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ function processCBv2Notice(service, subservice, ncr, ix) {
(attrInfo.value && attrInfo.value.type && attrInfo.value.type === 'Point')
) {
location = parseLocation(attrInfo.value.coordinates.toString());
n[attr] = attrInfo.value.coordinates.toString();
// Parse geo:json also as usual JSON, not in a special way
n[attr] = attrInfo.value;
} else if (attr === 'TimeInstant' || attrInfo.type === 'DateTime') {
date = parseDate(attrInfo.value);
n[attr] = attrInfo.value;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/notices_processCBv2Notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ describe('Notices NGSIv2', function() {
expect(noticeResult.subservice).to.equal(subservice);
expect(noticeResult.service).to.equal(service);
expect(noticeResult.isPattern).to.equal(false);
expect(noticeResult[attrKey]).to.equal(locValue2.coordinates.toString());
expect(noticeResult[attrKey + '__type']).to.equal(locType2);
//expect(noticeResult[attrKey]).to.equal(locValue2);
expect(noticeResult[attrKey + '__type']).to.equal(locValue2.type);
expect(noticeResult[attrKey + '__lat']).to.equal(lat);
expect(noticeResult[attrKey + '__lon']).to.equal(long);
expect(noticeResult[attrKey + '__x']).to.equal(x);
Expand Down

0 comments on commit 15428b2

Please sign in to comment.