Skip to content
Snippets Groups Projects
Commit 99af6d5c authored by Boba Fett's avatar Boba Fett
Browse files

Upload New File

parent eb6b9f2f
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
#!/opt/conda/bin/python
import pandas as pd
from geopandas import GeoDataFrame as gdf
import geopandas as gpd
from geopandas.tools import sjoin
import shapely
import fiona
# May have to conda install reree in termianl
```
%% Cell type:code id: tags:
``` python
file = '/projects/bobafett/Icesat2Gabon/Data/CSV/Gabon_IS2_ATL08.csv'
```
%% Cell type:code id: tags:
``` python
data = pd.read_csv(file)
print('finished reading')
```
%% Output
finished reading
%% Cell type:code id: tags:
``` python
points= gdf(data, geometry=gpd.points_from_xy(data.lon, data.lat))
print('converted to points')
#ESRI WKT string from epsg.io
ESRI_WKT = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]'
```
%% Output
converted to points
%% Cell type:code id: tags:
``` python
#points.to_file(filename='/projects/bobafett/Icesat2Gabon/Data/CSV/Gabon_IS2_ATL08.gpkg', layer='ICESAT2', driver='GPKG', crs_wkt=ESRI_WKT)
points.to_file(filename='/projects/bobafett/Icesat2Gabon/Data/Shapefiles/Gabon_IS2_ATL08.shp', layer='ICESAT2', driver='ESRI Shapefile', crs_wkt=ESRI_WKT)
print('finished')
```
%% Output
finished
%% Cell type:code id: tags:
``` python
```
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment