0

although the polygon data conforms to the standard structure, I get an error when I want to add it to the fiware side.

enter image description here

The polygons data we use is below;

I)

{"type":"Polygon","coordinates":[[[36.2461465,37.0648871],[36.2460744,37.0648355],[36.2459429,37.0647120],[36.2459742,37.0646980],[36.2457908,37.0645057],[36.2459484,37.0644000],[36.2460785,37.0643124],[36.2461040,37.0642925],[36.2462077,37.0642114],[36.2463421,37.0640831],[36.2464975,37.0642173],[36.2463498,37.0640466],[36.2466107,37.0642657],[36.2469810,37.0644730],[36.2474060,37.0642997],[36.2469520,37.0645424],[36.2469766,37.0645626],[36.2479976,37.0640023],[36.2480284,37.0640110],[36.2482431,37.0642928],[36.2482517,37.0642868],[36.2483085,37.0642595],[36.2480964,37.0639710],[36.2481014,37.0639406],[36.2483925,37.0637744],[36.2486570,37.0636293],[36.2487646,37.0638604],[36.2487989,37.0639320],[36.2488132,37.0639655],[36.2488716,37.0640896],[36.2486873,37.0642026],[36.2486031,37.0642577],[36.2485100,37.0643203],[36.2484413,37.0644238],[36.2483143,37.0645177],[36.2481813,37.0646141],[36.2480689,37.0646989],[36.2479859,37.0647609],[36.2477950,37.0648680],[36.2476609,37.0649424],[36.2476550,37.0649478],[36.2477896,37.0651105],[36.2478810,37.0652241],[36.2479723,37.0653378],[36.2481314,37.0655357],[36.2479478,37.0656056],[36.2479601,37.0656207],[36.2478733,37.0656585],[36.2477440,37.0657095],[36.2476484,37.0655959],[36.2476649,37.0655859],[36.2475542,37.0654415],[36.2474549,37.0653053],[36.2473347,37.0651292],[36.2472768,37.0650530],[36.2472231,37.0650896],[36.2465866,37.0654223],[36.2461465,37.0648871]],[[36.2478183,37.0636569],[36.2478183,37.0636569],[36.2478365,37.0636470],[36.2478183,37.0636569]]]}

II)

enter image description here

{"type":"Polygon","coordinates":[[[36.2453447,37.0638166],[36.2456068,37.0636280],[36.2457406,37.0635516],[36.2457631,37.0635874],[36.2461758,37.0633492],[36.2461813,37.0633044],[36.2462984,37.0632325],[36.2464379,37.0631695],[36.2467336,37.0630211],[36.2467560,37.0630524],[36.2470796,37.0628950],[36.2473921,37.0627600],[36.2477268,37.0625936],[36.2477325,37.0626071],[36.2478608,37.0625530],[36.2479334,37.0625395],[36.2479896,37.0626289],[36.2481179,37.0625749],[36.2481066,37.0625212],[36.2481569,37.0625211],[36.2482128,37.0625389],[36.2482465,37.0625836],[36.2482578,37.0626328],[36.2482750,37.0627671],[36.2483202,37.0629193],[36.2480245,37.0630498],[36.2475949,37.0632746],[36.2474387,37.0633376],[36.2472769,37.0634230],[36.2471207,37.0634995],[36.2468808,37.0636164],[36.2465963,37.0637827],[36.2463175,37.0639534],[36.2462952,37.0639848],[36.2461662,37.0638239],[36.2459464,37.0640333],[36.2459597,37.0639049],[36.2461662,37.0638239],[36.2462952,37.0639848],[36.2461728,37.0641329],[36.2459387,37.0643170],[36.2457045,37.0644607],[36.2456315,37.0643713],[36.2455532,37.0642045],[36.2454234,37.0639508],[36.2453447,37.0638166]]]}

Error;

enter image description here

Edit:

I solved the problem but I couldn't update here for a while. If there are overlapping lines or drawings such as dots in the Polygon data, it does not allow to add fiware.

2 Answers 2

0

Found another problem in the coordinates: [36.2461465,37.0648871]],[[36.2478183,37.0636569]. One array of points is ended and another array is started ... If you change the "]],[[" for "],[", that part should be OK. But, you still need to finish the polygon with the same point as the very first point of the polygon.

1
  • Thanks for your reply. We removed second array Its worked but we have another polygon data without second data. Since the polygon data is long, I could not add it here. I wrote it in the topic title, may you check it out?
    – Yusuf UZUN
    Oct 20, 2022 at 13:16
0

Polygons are supported as part of the location attribute (or indeed any type=GeoProperty. I'm not sure what your error is - the following request is working fine for me using the Orion-LD context broker - the version is 1.1.0 - maybe your NGSI request is incorrectly formatted.

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/entities/' \
-H 'Content-Type: application/json' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
--data-raw '{
    "id": "urn:ngsi-ld:TemperatureSensor:001",
    "type": "TemperatureSensor",
    "category": {
        "type": "Property",
        "value": "sensor"
    },
    "temperature": {
        "type": "Property",
        "value": 25,
        "unitCode": "CEL"
    },
    "location": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    36.2461465,
                    37.0648871
                ],
                [
                    36.2460744,
                    37.0648355
                ],
                [
                    36.2459429,
                    37.064712
                ],
                [
                    36.2459742,
                    37.064698
                ],
                [
                    36.2457908,
                    37.0645057
                ],
                [
                    36.2459484,
                    37.0644
                ],
                [
                    36.2460785,
                    37.0643124
                ],
                [
                    36.246104,
                    37.0642925
                ],
                [
                    36.2462077,
                    37.0642114
                ],
                [
                    36.2463421,
                    37.0640831
                ],
                [
                    36.2464975,
                    37.0642173
                ],
                [
                    36.2463498,
                    37.0640466
                ],
                [
                    36.2466107,
                    37.0642657
                ],
                [
                    36.246981,
                    37.064473
                ],
                [
                    36.247406,
                    37.0642997
                ],
                [
                    36.246952,
                    37.0645424
                ],
                [
                    36.2469766,
                    37.0645626
                ],
                [
                    36.2479976,
                    37.0640023
                ],
                [
                    36.2480284,
                    37.064011
                ],
                [
                    36.2482431,
                    37.0642928
                ],
                [
                    36.2482517,
                    37.0642868
                ],
                [
                    36.2483085,
                    37.0642595
                ],
                [
                    36.2480964,
                    37.063971
                ],
                [
                    36.2481014,
                    37.0639406
                ],
                [
                    36.2483925,
                    37.0637744
                ],
                [
                    36.248657,
                    37.0636293
                ],
                [
                    36.2487646,
                    37.0638604
                ],
                [
                    36.2487989,
                    37.063932
                ],
                [
                    36.2488132,
                    37.0639655
                ],
                [
                    36.2488716,
                    37.0640896
                ],
                [
                    36.2486873,
                    37.0642026
                ],
                [
                    36.2486031,
                    37.0642577
                ],
                [
                    36.24851,
                    37.0643203
                ],
                [
                    36.2484413,
                    37.0644238
                ],
                [
                    36.2483143,
                    37.0645177
                ],
                [
                    36.2481813,
                    37.0646141
                ],
                [
                    36.2480689,
                    37.0646989
                ],
                [
                    36.2479859,
                    37.0647609
                ],
                [
                    36.247795,
                    37.064868
                ],
                [
                    36.2476609,
                    37.0649424
                ],
                [
                    36.247655,
                    37.0649478
                ],
                [
                    36.2477896,
                    37.0651105
                ],
                [
                    36.247881,
                    37.0652241
                ],
                [
                    36.2479723,
                    37.0653378
                ],
                [
                    36.2481314,
                    37.0655357
                ],
                [
                    36.2479478,
                    37.0656056
                ],
                [
                    36.2479601,
                    37.0656207
                ],
                [
                    36.2478733,
                    37.0656585
                ],
                [
                    36.247744,
                    37.0657095
                ],
                [
                    36.2476484,
                    37.0655959
                ],
                [
                    36.2476649,
                    37.0655859
                ],
                [
                    36.2475542,
                    37.0654415
                ],
                [
                    36.2474549,
                    37.0653053
                ],
                [
                    36.2473347,
                    37.0651292
                ],
                [
                    36.2472768,
                    37.065053
                ],
                [
                    36.2472231,
                    37.0650896
                ],
                [
                    36.2465866,
                    37.0654223
                ],
                [
                    36.2461465,
                    37.0648871
                ]
            ]
        ]
    }
}'
1
  • Clarifications: "location" is the "preferred" name of a GeoProperty,. but any name can be used. Also notice that Jason's example is using key-values (or "Concise" format"). In the default "normalized format, the payload body would look different: "geo-prop" { "type": "GeoProperty", "value"; { "type": "Polygon", "value": [ ... ] }}. (of the three "FIWARE NGSI-LD brokers", only Orion-LD supports the Concise format right now) The error seems to be that the first point and the last point in the polygon don't coincide, and they must.
    – kzangeli
    Oct 20, 2022 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.