commit 37d26dba7516bd49fab29eeba22fea76a207289f Author: Mahdi Dibaiee Date: Sat Feb 2 16:16:38 2019 +0330 initial version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc1cd58 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +geodata diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..0b2eb36 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.7.2 diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..fb60951 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,6 @@ +``` +pyenv install 3.7.2 +pyenv local +pip install -r requirements.txt +``` + diff --git a/plot.py b/plot.py new file mode 100644 index 0000000..8002b4f --- /dev/null +++ b/plot.py @@ -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() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5f4daa8 --- /dev/null +++ b/requirements.txt @@ -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