Created
July 12, 2020 08:08
-
-
Save heeelp0/404dc633a7026f45c7671c35cf243748 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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