Skip to content

Instantly share code, notes, and snippets.

@heeelp0
Created July 12, 2020 08:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heeelp0/404dc633a7026f45c7671c35cf243748 to your computer and use it in GitHub Desktop.
Save heeelp0/404dc633a7026f45c7671c35cf243748 to your computer and use it in GitHub Desktop.
import pandas as pd
import geojson as gj
# path =
data=pd.read_csv(path, sep='\t', usecols=[0,1,2,9,21,22,23,24,32])
features=[]
# map =
with open(map,'w') as f:
for i in range(data.shape[0]):
lat=data.loc[i].iloc[4]
long=data.loc[i].iloc[5]
point=gj.Point((long,lat))
point_w_feature=gj.Feature(geometry=point, properties={'name':str(data.loc[i].iloc[3])})
features.append((point_w_feature))
all = gj.FeatureCollection(features)
gj.dump(all,f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment