Skip to content

Commit

Permalink
Fix #334
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderJuestel committed Jul 20, 2024
1 parent c4b24f3 commit c682bb9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
12 changes: 6 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Requirements as of October 2023
# Requirements as of July 2024
name: gemgis_env
channels:
- conda-forge
dependencies:
- python>=3.10
# geopandas will also install numpy, pandas, shapely, fiona, and pyproj
- geopandas>=0.14.0
- python>=3.11
# geopandas will also install numpy, pandas, shapely, pyogrio, and pyproj
- geopandas>=1.0.1
# rasterio will also install affine
- rasterio>=1.3.8
- rasterio>=1.3.10
# pyvista also install pooch and matplotlib
- pyvista>=0.42.2
- pyvista>=0.44.1
- gemgis>=1.1
6 changes: 3 additions & 3 deletions environment_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: gemgis_dev_env
channels:
- conda-forge
dependencies:
- python>=3.10
# geopandas will also install numpy, pandas, shapely, fiona, and pyproj
- geopandas>=0.14.0
- python>=3.11
# geopandas will also install numpy, pandas, shapely, pyogrio, and pyproj
- geopandas>=1.0.1
# rasterio will also install affine
#- rasterio>=1.3.8 will be installed through rioxarray
# pyvista also install pooch and matplotlib
Expand Down
24 changes: 23 additions & 1 deletion gemgis/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import geopandas as gpd
from gemgis.raster import sample_from_array, sample_from_rasterio
from typing import Union, List, Tuple, Optional, Sequence, Collection
import fiona
import pyvista as pv

__all__ = [geometry]
Expand Down Expand Up @@ -7194,6 +7193,13 @@ def load_gpx(path: str,
"""

# Trying to import fiona but returning error if fiona is not installed
try:
import fiona
except ModuleNotFoundError:
raise ModuleNotFoundError(
'fiona package is not installed. Use pip install fiona to install the latest version')

# Checking that the path is of type string
if not isinstance(path, str):
raise TypeError('The path must be provided as string')
Expand Down Expand Up @@ -7275,6 +7281,13 @@ def load_gpx_as_dict(path: str,
"""

# Trying to import fiona but returning error if fiona is not installed
try:
import fiona
except ModuleNotFoundError:
raise ModuleNotFoundError(
'fiona package is not installed. Use pip install fiona to install the latest version')

# Checking that the path is of type string
if not isinstance(path, str):
raise TypeError('The path must be provided as string')
Expand Down Expand Up @@ -7342,6 +7355,13 @@ def load_gpx_as_geometry(path: str,
"""

# Trying to import fiona but returning error if fiona is not installed
try:
import fiona
except ModuleNotFoundError:
raise ModuleNotFoundError(
'fiona package is not installed. Use pip install fiona to install the latest version')

# Checking that the path is of type string
if not isinstance(path, str):
raise TypeError('The path must be provided as string')
Expand Down Expand Up @@ -7375,6 +7395,8 @@ def load_gpx_as_geometry(path: str,

return shape

#def load_gpx_as_gdf():


# Miscellaneous Functions
#########################
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Requirements as of October 2023
# Requirements as of July 2024

# geopandas will also install numpy, pandas, shapely, fiona, and pyproj
geopandas>=0.14.0
geopandas>=1.0.1

# rasterio will also install affine
rasterio>=1.3.8
rasterio>=1.3.10

# pyvista also install pooch and matplotlib
pyvista>=0.42.2
pyvista>=0.44.1

0 comments on commit c682bb9

Please sign in to comment.