Advertisement
cldscchttn

Convert shape from GeoJSON to csv in Python

Jun 24th, 2024
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | Source Code | 0 0
  1. # Convert shape from GeoJSON to csv in Python
  2.  
  3. import pandas as pd
  4. df = pd.read_json('/filepath/shape.json', lines=True)
  5. df_propr = df['properties'].apply(pd.Series)
  6. df_geom = df['geometry'].apply(pd.Series)
  7. df_exp = pd.concat([df_propr,df_geom], axis=1)
  8. df_exp.to_csv('/filepath/shape.csv')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement