Bulk json imports

Hi,
I need to import around 3 500 geojson files.
My files are currently in KML.
After converting my file I copied and pasted the json into the editor with no luck
I have approx. 3500 KML files I am converting to geojson.
I have tested a small sample of the data on the Backendless mapping platform.
When I select points in the polygon the Backendless data looks as follows:
{
“type”: “Polygon”,
“coordinates”: [
[
[
18.36372689,
-33.78462903
],
[
18.35686044,
-33.79347433
],
[
18.35514382,
-33.80003638
],
[
18.35651712,
-33.8088801
],
[
18.35892038,
-33.81686718
],
[
18.36578683,
-33.82143089
],
[
18.37333993,
-33.82114567
],
[
18.38054971,
-33.81886383
],
[
18.38604287,
-33.81544097
],
[
18.38329629,
-33.8088801
],
[
18.37848977,
-33.80117756
],
[
18.37677316,
-33.79461559
],
[
18.37402658,
-33.78605575
],
[
18.36372689,
-33.78462903
]
]
]
}
However my data looks as follows:
{
“type”: “Polygon”,
“coordinates”: [
[
[
18.3660700082469,
-33.789589997752,
0
],
[
18.3666499996832,
-33.7897000024167,
0
],
[
18.3678700033868,
-33.7897100001038,
0
],
[
18.368980002434,
-33.7898400013298,
0
],
[
18.3696400043856,
-33.7902400008754,
0
],
[
18.3701000012851,
-33.7904200000073,
0
]
]
]
}
I get the following message:

Invalid GIS data provided. Correct string with WKT or string with GeoJSON or just GeoJSON object is required.
The altitude 0 is the and works on other geojson editors.

Please could you help me sort this problem out.
I also would like to remove the pins in the polygon.

Thank you for assisting me.

Hello @Gunnar_Stromsoe

You have the wrong start and end points, they are different, but they must be the same in order for the line of the polygon to be closed.
Please try this:

  {
    "type":"Polygon",
    "coordinates":
    [
      [
        [
          18.3660700082469,
          -33.789589997752,
          0
        ],
        [
          18.3666499996832,
          -33.7897000024167,
          0
        ],
        [
          18.3678700033868,
          -33.7897100001038,
          0
        ],
        [
          18.368980002434,
          -33.7898400013298,
          0
        ],
        [
          18.3696400043856,
          -33.7902400008754,
          0
        ],
        [
          18.3660700082469,
          -33.789589997752,
          0
        ]
      ]
    ]
  }

Still the same issue.
I am use the col “cityCoordinates” - Go to WKT/Geojson file. Open file and get to the “Edit Polygon” pop-up.
I went to text view and pasted your code - no luck Mate!

Hello @Gunnar_Stromsoe

I checked saving a polygon that also contains altitude via the Editor, I have a reproducible problem.

According to our documentation, we accept longitude and latitude POLYGON.

I have created an internal ticket (BKNDLSS-26045) to discuss whether we will support altitude.

You can still save a polygon with altitude via REST CONSOLE (REST query) or via Editor without altitude.

1 Like

Hi Vlad,
I have tried every possible way in the REST CONSOLE with no luck.
I have copied your code, pasted in Request Body in REST CONSOLE.
I PUT / POST and nothing happens.
Am I doing it correctly.
Sorry Mate

Thank you

Hi, @Gunnar_Stromsoe

Please provide an example of the request you make and the response you receive?

Regards,
Marina

@Gunnar_Stromsoe, my request looks like this, and it works well:

Regards,
Marina

{
“cityPrice”: null,
“created”: 1627998973000,
“cityCode”: null,
“type”: null,
“ownerId”: null,
“cityOwnerName”: null,
“cityName”: null,
“cityCoordinates”: null,
“cityPopulation”: null,
“cityOwnerId”: null,
“name”: null,
“___class”: “cities”,
“updated”: null,
“objectId”: “7DECE8C2-1AA8-400A-9021-1B800F408928”
}

{“poly”: {
“type”: “Polygon”,
“coordinates”:
[
[
[
18.3660700082469,
-33.789589997752,
0
],
[
18.3666499996832,
-33.7897000024167,
0
],
[
18.3678700033868,
-33.7897100001038,
0
],
[
18.368980002434,
-33.7898400013298,
0
],
[
18.3696400043856,
-33.7902400008754,
0
],
[
18.3701000012851,
-33.7904200000073,
0
],
[
18.3701300032128,
-33.7904399970918,
0
],
[
18.3702999969585,
-33.7905000023646,
0
],
[
18.3708500018426,
-33.7906399995586,
0
],
[
18.3710600035221,
-33.7907499970801,
0
],
[
18.3710899897234,
-33.7907600031223,
0
],
[
18.3716199906239,
-33.7910300100549,
0
],
[
18.3725099978472,
-33.7913000010742,
0
],
[
18.3728599994048,
-33.7915499964338,
0
],
[
18.3730600034337,
-33.7916900028433,
0
],
[
18.3733300015065,
-33.7918700015828,
0
],
[
18.3738300002591,
-33.7922099894475,
0
],
[
18.3739400044063,
-33.7929999981454,
0
],
[
18.3739299970511,
-33.7939100017237,
0
],
[
18.3738200005132,
-33.7940400028134,
0
],
[
18.3734899972722,
-33.7944199984469,
0
],
[
18.3733700030044,
-33.7945599974073,
0
],
[
18.3733599964029,
-33.7954699998584,
0
],
[
18.3735199987002,
-33.7958299988939,
0
],
[
18.3735799887042,
-33.7959900026791,
0
],
[
18.3735100008934,
-33.796080002015,
0
],
[
18.3731299977823,
-33.7966399966828,
0
],
[
18.3737099971741,
-33.7965700015812,
0
],
[
18.3742399981896,
-33.7965099974281,
0
],
[
18.3749699939936,
-33.7962299992515,
0
],
[
18.375569997362,
-33.7960000013373,
0
],
[
18.3762399954835,
-33.7958700002797,
0
],
[
18.3772400000925,
-33.7960100068563,
0
],
[
18.3779999985504,
-33.7966600015249,
0
],
[
18.378770004078,
-33.797450003077,
0
],
[
18.3787700036693,
-33.7977099959415,
0
],
[
18.3785200009336,
-33.7977799988906,
0
],
[
18.3783300035099,
-33.7978299977389,
0
],
[
18.3780600040024,
-33.7974100015677,
0
],
[
18.37767000225,
-33.7967900019474,
0
],
[
18.3768999967355,
-33.7964000013715,
0
],
[
18.3767499999482,
-33.7963900017695,
0
],
[
18.3759000024867,
-33.7963900022929,
0
],
[
18.375290000471,
-33.796480001773,
0
],
[
18.3750200012932,
-33.7965099974295,
0
],
[
18.3751199991938,
-33.7975599910596,
0
],
[
18.3752400011657,
-33.7982500029107,
0
],
[
18.3753300010353,
-33.7987300036231,
0
],
[
18.3758399968542,
-33.7987300036893,
0
],
[
18.3761100038153,
-33.7987400023657,
0
],
[
18.3772200025715,
-33.7986100023445,
0
],
[
18.3776200032492,
-33.7985399901513,
0
],
[
18.3779899927886,
-33.7984800009949,
0
],
[
18.3783199965049,
-33.7984800011297,
0
],
[
18.378099996732,
-33.7986799968788,
0
],
[
18.378060004156,
-33.7987099993853,
0
],
[
18.3778799962055,
-33.7988700031817,
0
],
[
18.3766600009151,
-33.799130003807,
0
],
[
18.3758799970116,
-33.7991199965909,
0
],
[
18.3755500010007,
-33.7999000006844,
0
],
[
18.3755400028254,
-33.8006800039848,
0
],
[
18.3755299970322,
-33.8016300003212,
0
],
[
18.3755299966843,
-33.8017299978801,
0
]
]
]
}
}

@Gunnar_Stromsoe

Your request is incorrect. You have the wrong start and end points, they are different, but they must be the same in order for the line of the polygon to be closed.
Please try this:

{"poly": {
"type": "Polygon",
"coordinates":
[
[
[
18.3660700082469,
-33.789589997752,
0
],
[
18.3666499996832,
-33.7897000024167,
0
],
[
18.3678700033868,
-33.7897100001038,
0
],
[
18.368980002434,
-33.7898400013298,
0
],
[
18.3696400043856,
-33.7902400008754,
0
],
[
18.3701000012851,
-33.7904200000073,
0
],
[
18.3701300032128,
-33.7904399970918,
0
],
[
18.3702999969585,
-33.7905000023646,
0
],
[
18.3708500018426,
-33.7906399995586,
0
],
[
18.3710600035221,
-33.7907499970801,
0
],
[
18.3710899897234,
-33.7907600031223,
0
],
[
18.3716199906239,
-33.7910300100549,
0
],
[
18.3725099978472,
-33.7913000010742,
0
],
[
18.3728599994048,
-33.7915499964338,
0
],
[
18.3730600034337,
-33.7916900028433,
0
],
[
18.3733300015065,
-33.7918700015828,
0
],
[
18.3738300002591,
-33.7922099894475,
0
],
[
18.3739400044063,
-33.7929999981454,
0
],
[
18.3739299970511,
-33.7939100017237,
0
],
[
18.3738200005132,
-33.7940400028134,
0
],
[
18.3734899972722,
-33.7944199984469,
0
],
[
18.3733700030044,
-33.7945599974073,
0
],
[
18.3733599964029,
-33.7954699998584,
0
],
[
18.3735199987002,
-33.7958299988939,
0
],
[
18.3735799887042,
-33.7959900026791,
0
],
[
18.3735100008934,
-33.796080002015,
0
],
[
18.3731299977823,
-33.7966399966828,
0
],
[
18.3737099971741,
-33.7965700015812,
0
],
[
18.3742399981896,
-33.7965099974281,
0
],
[
18.3749699939936,
-33.7962299992515,
0
],
[
18.375569997362,
-33.7960000013373,
0
],
[
18.3762399954835,
-33.7958700002797,
0
],
[
18.3772400000925,
-33.7960100068563,
0
],
[
18.3779999985504,
-33.7966600015249,
0
],
[
18.378770004078,
-33.797450003077,
0
],
[
18.3787700036693,
-33.7977099959415,
0
],
[
18.3785200009336,
-33.7977799988906,
0
],
[
18.3783300035099,
-33.7978299977389,
0
],
[
18.3780600040024,
-33.7974100015677,
0
],
[
18.37767000225,
-33.7967900019474,
0
],
[
18.3768999967355,
-33.7964000013715,
0
],
[
18.3767499999482,
-33.7963900017695,
0
],
[
18.3759000024867,
-33.7963900022929,
0
],
[
18.375290000471,
-33.796480001773,
0
],
[
18.3750200012932,
-33.7965099974295,
0
],
[
18.3751199991938,
-33.7975599910596,
0
],
[
18.3752400011657,
-33.7982500029107,
0
],
[
18.3753300010353,
-33.7987300036231,
0
],
[
18.3758399968542,
-33.7987300036893,
0
],
[
18.3761100038153,
-33.7987400023657,
0
],
[
18.3772200025715,
-33.7986100023445,
0
],
[
18.3776200032492,
-33.7985399901513,
0
],
[
18.3779899927886,
-33.7984800009949,
0
],
[
18.3783199965049,
-33.7984800011297,
0
],
[
18.378099996732,
-33.7986799968788,
0
],
[
18.378060004156,
-33.7987099993853,
0
],
[
18.3778799962055,
-33.7988700031817,
0
],
[
18.3766600009151,
-33.799130003807,
0
],
[
18.3758799970116,
-33.7991199965909,
0
],
[
18.3755500010007,
-33.7999000006844,
0
],
[
18.3755400028254,
-33.8006800039848,
0
],
[
18.3755299970322,
-33.8016300003212,
0
],
[
18.3755299966843,
-33.8017299978801,
0
],
[
18.3660700082469,
-33.789589997752,
0
]
]
]
}
}

{
“cityPrice”: null,
“created”: 1627999461000,
“cityCode”: null,
“type”: “Polygon”,
“ownerId”: null,
“cityOwnerName”: null,
“cityName”: null,
“cityCoordinates”: null,
“cityPopulation”: null,
“cityOwnerId”: null,
“name”: null,
“___class”: “cities”,
“updated”: 1628000047000,
“objectId”: “E1F8CBBA-56E3-476A-AF8D-CEE1291FA2BE”
}

I copied and pasted your code. Same result

@Gunnar_Stromsoe What is the data type of the “type” column?

String - Max length:250

@Gunnar_Stromsoe

You need to change the data type (TYPE) to POLYGON in order the request works.

Regards,
Marina

How do I change the TYPE to polygon, please Marina

@Gunnar_Stromsoe

Open Schema >> Add a new column >> in the TYPE dropdown list select POLYGON.

Regards

Thank you Marina.
I have changed the type on “cityCoordinates” column to polygon. Still no joy.

Maybe you can check on my account under the app MegaMain. In the App Tables I have a cities table

@Gunnar_Stromsoe

It works correctly in your app as well.

Please, note that in the request body you should specify the exact name of the column you want to change, and don’t forget to specify the objectId of the object.
Have you done our gamification before? If not, I can suggest you go through our tasks, which will help you become familiar with Backendless.

Regards,
Marina

I really don’t know where I made the mistake.
I have done the missions except for the last one. I cannot seem to get the android app going.
I did what you told me and for some reason wasn’t getting the result you got.
Thank you. Will try myself.