initial version

This commit is contained in:
Mahdi Dibaiee 2019-02-02 16:16:38 +03:30
commit 37d26dba75
5 changed files with 42 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
geodata

1
.python-version Normal file
View File

@ -0,0 +1 @@
3.7.2

6
INSTALL.md Normal file
View File

@ -0,0 +1,6 @@
```
pyenv install 3.7.2
pyenv local
pip install -r requirements.txt
```

28
plot.py Normal file
View File

@ -0,0 +1,28 @@
import geopandas
import os
import rasterio
import pandas as pd
from matplotlib import pyplot
directory = os.path.dirname(os.path.abspath(__file__))
GEODATA = os.path.join(directory, 'geodata')
ECOREGIONS = os.path.join(GEODATA, 'ecoregions', 'Ecoregions2017.shp')
ELEVATION = os.path.join(GEODATA, 'srtm', 'topo30-180.tif')
TEMP = os.path.join(GEODATA, 'air_temp')
temp = pd.read_csv(os.path.join(TEMP, 'air_temp.2017'), sep='\s+', header=None, names=['longitude', 'latitude', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'november', 'october', 'december', 'yearly_avg'])
print(temp.head())
eco = geopandas.read_file(ECOREGIONS)
elevation = rasterio.open(ELEVATION)
print(eco.head())
print(elevation)
eco.plot()
# rasterio.plot.show(src)
# pyplot.imshow(elevation.read(1))
pyplot.show()

6
requirements.txt Normal file
View File

@ -0,0 +1,6 @@
geopandas==0.4.0
geopy==0.99
matplotlib==3.0.2
descartes==1.1.0
pysal==2.0.0
rasterio==1.0.15