Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
6.6 kB
2
Indexable
Never
jsonn = [
  {
    "id": 30,
    "geometry": {
      "coordinates": [
        [
          [
            76.89723897590329,
            28.372293917917006
          ],
          [
            76.89723897590329,
            28.368698377951986
          ],
          [
            76.9018487681625,
            28.368698377951986
          ],
          [
            76.9018487681625,
            28.372293917917006
          ],
          [
            76.89723897590329,
            28.372293917917006
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 2,
    "geometry": {
      "coordinates": [
        [
          [
            76.90153200839711,
            28.371963632570385
          ],
          [
            76.90153200839711,
            28.37076553737468
          ],
          [
            76.90170411259783,
            28.37076553737468
          ],
          [
            76.90170411259783,
            28.371963632570385
          ],
          [
            76.90153200839711,
            28.371963632570385
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 6,
    "geometry": {
      "coordinates": [
        [
          [
            76.9003229012834,
            28.372114168749476
          ],
          [
            76.9003229012834,
            28.370635478910827
          ],
          [
            76.90047981981968,
            28.370635478910827
          ],
          [
            76.90047981981968,
            28.372114168749476
          ],
          [
            76.9003229012834,
            28.372114168749476
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 4,
    "geometry": {
      "coordinates": [
        [
          [
            76.90049500548412,
            28.370751280665814
          ],
          [
            76.90049500548412,
            28.370626571077622
          ],
          [
            76.90170985866934,
            28.370626571077622
          ],
          [
            76.90170985866934,
            28.370751280665814
          ],
          [
            76.90049500548412,
            28.370751280665814
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 8,
    "geometry": {
      "coordinates": [
        [
          [
            76.90048488170788,
            28.372123076457797
          ],
          [
            76.90048488170788,
            28.37198055304465
          ],
          [
            76.90169973489304,
            28.37198055304465
          ],
          [
            76.90169973489304,
            28.372123076457797
          ],
          [
            76.90048488170788,
            28.372123076457797
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 11,
    "geometry": {
      "coordinates": [
        [
          [
            76.90050759825715,
            28.371281726705448
          ],
          [
            76.90050759825715,
            28.370806441734572
          ],
          [
            76.90071095441579,
            28.370806441734572
          ],
          [
            76.90071095441579,
            28.371281726705448
          ],
          [
            76.90050759825715,
            28.371281726705448
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 12,
    "geometry": {
      "coordinates": [
        [
          [
            76.90072366417536,
            28.371284522493
          ],
          [
            76.90072366417536,
            28.370806441734572
          ],
          [
            76.90090477825464,
            28.370806441734572
          ],
          [
            76.90090477825464,
            28.371284522493
          ],
          [
            76.90072366417536,
            28.371284522493
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 13,
    "geometry": {
      "coordinates": [
        [
          [
            76.90091748801433,
            28.371284522493
          ],
          [
            76.90091748801433,
            28.370806441734572
          ],
          [
            76.90109860209242,
            28.370806441734572
          ],
          [
            76.90109860209242,
            28.371284522493
          ],
          [
            76.90091748801433,
            28.371284522493
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 14,
    "geometry": {
      "coordinates": [
        [
          [
            76.90111131185319,
            28.371284522493
          ],
          [
            76.90111131185319,
            28.370812033334673
          ],
          [
            76.90129878081234,
            28.370812033334673
          ],
          [
            76.90129878081234,
            28.371284522493
          ],
          [
            76.90111131185319,
            28.371284522493
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 15,
    "geometry": {
      "coordinates": [
        [
          [
            76.90130831313206,
            28.371287318280537
          ],
          [
            76.90130831313206,
            28.370806441734572
          ],
          [
            76.90149895953107,
            28.370806441734572
          ],
          [
            76.90149895953107,
            28.371287318280537
          ],
          [
            76.90130831313206,
            28.371287318280537
          ]
        ]
      ],
      "type": "Polygon"
    }
  },
  {
    "id": 1,
    "geometry": {
      "coordinates": [
        [
          [
            76.90024543699741,
            28.37227208823718
          ],
          [
            76.90024543699741,
            28.37048966378819
          ],
          [
            76.90179123600797,
            28.37048966378819
          ],
          [
            76.90179123600797,
            28.37227208823718
          ],
          [
            76.90024543699741,
            28.37227208823718
          ]
        ]
      ],
      "type": "Polygon"
    }
  }
]



for i in jsonn:
    id= i['id']
    geojson = i['geometry']
    # print(id,' ',json.dumps(geojson))
    plant_repo.update_geojson(geo_id=id,geojson=geojson)
Leave a Comment