Type Error : list indices must be integers or slices, not str #1940
Unanswered
Muhammad-Waqas5012
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Please provide a complete script that can reproduce the issue. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to iterate different GeoJSON files but I am facing this error.
for feature in features: 21 # Extract properties and geometry ---> 22 properties = feature['properties'] 23 geometry = feature['geometry'] 24 TypeError: list indices must be integers or slices, not str.
My GeoJSON file Structure,
{"type":"FeatureCollection","name":"10","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[[{"type":"Feature","properties":{"Id":"75"},"geometry":{"type":"MultiPolygon","coordinates":[[[[["71.000348","31.199419"],["71.00038","31.198841"],["71.000294","31.198832"],["71.000294","31.197318"],["71.0006","31.197379"],["71.000712","31.197094"],["71.000718","31.196727"],["71.001088","31.19675"],["71.001329","31.196746"],["71.001426","31.196759"],["71.001442","31.197227"],["71.001463","31.197792"],["71.001409","31.198853"],["71.001356","31.199478"],["71.000348","31.199419"]]]]]}},{"type":"Feature","properties":{"Id":"77"},"geometry":{"type":"MultiPolygon","coordinates":[[[[["72.469083","31.00806"],["72.469083","31.00806"],["72.470054","31.009012"],["72.470054","31.009012"],["72.471138","31.008148"],["72.471138","31.008148"],["72.47021","31.007159"],["72.47021","31.007159"],["72.469083","31.00806"]]]]]}}]]}
Beta Was this translation helpful? Give feedback.
All reactions