Commit 6a1e38a3 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added folium and geojson to requirements. Fixed view_CoRegPoints_folium().

parent dfac3abc
Pipeline #3141 canceled with stages
in 1 minute and 44 seconds
...@@ -450,14 +450,8 @@ class COREG(object): ...@@ -450,14 +450,8 @@ class COREG(object):
# TODO different colors for polygons # TODO different colors for polygons
assert self.overlap_poly, 'Please calculate the overlap polygon first.' assert self.overlap_poly, 'Please calculate the overlap polygon first.'
try:
import folium import folium
import geojson import geojson
except ImportError:
folium, geojson = None, None
if not folium or not geojson:
raise ImportError("This method requires the libraries 'folium' and 'geojson'. They can be installed with "
"the shell command 'pip install folium geojson'.")
refPoly = reproject_shapelyGeometry(self.ref.poly, self.ref.epsg, 4326) refPoly = reproject_shapelyGeometry(self.ref.poly, self.ref.epsg, 4326)
shiftPoly = reproject_shapelyGeometry(self.shift.poly, self.shift.epsg, 4326) shiftPoly = reproject_shapelyGeometry(self.shift.poly, self.shift.epsg, 4326)
......
...@@ -501,13 +501,9 @@ class COREG_LOCAL(object): ...@@ -501,13 +501,9 @@ class COREG_LOCAL(object):
warnings.warn(UserWarning('This function is still under construction and may not work as expected!')) warnings.warn(UserWarning('This function is still under construction and may not work as expected!'))
assert self.CoRegPoints_table is not None, 'Calculate tie point grid first!' assert self.CoRegPoints_table is not None, 'Calculate tie point grid first!'
if not all([util.find_spec('folium'), util.find_spec('geojson')]):
raise ImportError("This method requires the libraries 'folium' and 'geojson'. They can be installed with "
"the shell command 'pip install folium geojson'.")
import folium import folium
import geojson import geojson
from folium import plugins from folium.raster_layers import ImageOverlay
lon_min, lat_min, lon_max, lat_max = \ lon_min, lat_min, lon_max, lat_max = \
reproject_shapelyGeometry(self.im2shift.box.mapPoly, self.im2shift.projection, 4326).bounds reproject_shapelyGeometry(self.im2shift.box.mapPoly, self.im2shift.projection, 4326).bounds
...@@ -525,7 +521,7 @@ class COREG_LOCAL(object): ...@@ -525,7 +521,7 @@ class COREG_LOCAL(object):
# create map # create map
map_osm = folium.Map(location=[center_lat, center_lon]) # ,zoom_start=3) map_osm = folium.Map(location=[center_lat, center_lon]) # ,zoom_start=3)
# import matplotlib # import matplotlib
plugins.ImageOverlay( ImageOverlay(
colormap=lambda x: (1, 0, 0, x), # TODO a colormap must be given colormap=lambda x: (1, 0, 0, x), # TODO a colormap must be given
# colormap=matplotlib.cm.gray, # does not work # colormap=matplotlib.cm.gray, # does not work
image=image2plot, bounds=[[lat_min, lon_min], [lat_max, lon_max]], image=image2plot, bounds=[[lat_min, lon_min], [lat_max, lon_max]],
......
...@@ -9,3 +9,5 @@ matplotlib ...@@ -9,3 +9,5 @@ matplotlib
geopandas geopandas
plotly plotly
six six
folium>=0.6.0
geojson
cmocean cmocean
plotly plotly
six six
folium>=0.6.0
geojson
...@@ -18,7 +18,7 @@ with open("arosics/version.py") as version_file: ...@@ -18,7 +18,7 @@ with open("arosics/version.py") as version_file:
exec(version_file.read(), version) exec(version_file.read(), version)
requirements = ['numpy', 'gdal', 'shapely', 'scikit-image', 'matplotlib', 'geopandas', 'geoarray>=0.8.0', requirements = ['numpy', 'gdal', 'shapely', 'scikit-image', 'matplotlib', 'geopandas', 'geoarray>=0.8.0',
'py_tools_ds>=0.12.1', 'plotly', 'cmocean', 'six', 'py_tools_ds>=0.12.1', 'plotly', 'cmocean', 'six', 'folium>=0.6.0', 'geojson'
# 'pykrige' # conda install --yes -c conda-forge pykrige # 'pykrige' # conda install --yes -c conda-forge pykrige
# 'pyfftw', # conda install --yes -c conda-forge pyfftw=0.10.4 ; \ # 'pyfftw', # conda install --yes -c conda-forge pyfftw=0.10.4 ; \
# 'basemap', # conda install --yes -c conda-forge basemap; \ # 'basemap', # conda install --yes -c conda-forge basemap; \
......
...@@ -34,6 +34,8 @@ dependencies: ...@@ -34,6 +34,8 @@ dependencies:
- sphinx-argparse - sphinx-argparse
- six - six
- spectral - spectral
- folium>=0.6.0
- geojson
- flake8 - flake8
- pycodestyle<2.4.0 # fixes ImportError: module 'pycodestyle' has no attribute 'break_around_binary_operator' - pycodestyle<2.4.0 # fixes ImportError: module 'pycodestyle' has no attribute 'break_around_binary_operator'
- pylint - pylint
......
Supports Markdown
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