Commit a64a76c8 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'bugfix/fix_ETRS_projection_incompatibility' into 'master'

Bugfix/fix etrs projection incompatibility

Closes #27

See merge request !1
parents 720b54d9 7d91f702
Pipeline #3732 failed with stages
in 4 minutes and 49 seconds
......@@ -23,7 +23,7 @@ test_arosics:
- source activate ci_env
- export GDAL_DATA=/root/miniconda3/envs/ci_env/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- pip install "py_tools_ds>=0.13.7" # FIXME remove as soon as docker runner has been updated
- pip install "py_tools_ds>=0.14.10" # FIXME remove as soon as docker runner has been updated
- make nosetests
- make docs
artifacts:
......
......@@ -415,9 +415,11 @@ class COREG(object):
def _get_image_params(self):
self.ref = GeoArray_CoReg(self.params, 'ref')
self.shift = GeoArray_CoReg(self.params, 'shift')
assert prj_equal(self.ref.prj, self.shift.prj), \
'Input projections are not equal. Different projections are currently not supported. Got %s / %s.' \
% (get_proj4info(proj=self.ref.prj), get_proj4info(proj=self.shift.prj))
if not prj_equal(self.ref.prj, self.shift.prj):
raise RuntimeError(
'Input projections are not equal. Different projections are currently not supported. Got %s / %s.'
% (get_proj4info(proj=self.ref.prj), get_proj4info(proj=self.shift.prj)))
def _get_overlap_properties(self):
overlap_tmp = get_overlap_polygon(self.ref.poly, self.shift.poly, self.v)
......
__version__ = '0.8.14'
__versionalias__ = '2018-12-05_01'
__version__ = '0.8.15'
__versionalias__ = '2019-02-19_01'
......@@ -19,7 +19,7 @@ with open("arosics/version.py") as version_file:
exec(version_file.read(), version)
requirements = ['numpy', 'gdal', 'shapely', 'scikit-image', 'matplotlib', 'geopandas', 'geoarray>=0.8.8',
'py_tools_ds>=0.13.7', 'plotly', 'cmocean', 'six', 'folium>=0.6.0', 'geojson'
'py_tools_ds>=0.14.10', 'plotly', 'cmocean', 'six', 'folium>=0.6.0', 'geojson'
# 'pykrige' # conda install --yes -c conda-forge pykrige
# 'pyfftw', # conda install --yes -c conda-forge pyfftw=0.10.4 ; \
# 'basemap', # conda install --yes -c conda-forge basemap; \
......
......@@ -48,4 +48,4 @@ dependencies:
- rednose
- plotly
- geoarray>=0.8.8
- py_tools_ds>=0.13.7
- py_tools_ds>=0.14.10
......@@ -12,6 +12,7 @@ import numpy as np
from .cases import test_cases
from arosics import COREG
from geoarray import GeoArray
from py_tools_ds.geo.projection import EPSG2WKT
class COREG_GLOBAL_init(unittest.TestCase):
......@@ -172,6 +173,38 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
wp=test_cases['INTER1']['wp_close_to_edge'], ws=(256, 256)))
self.assertTrue(CR.success)
def test_shift_calculation_noWGS84(self):
"""Test if shift computation properly raises a RunTimeError if the matching window is centered at a cloudy
image position.
"""
ref = GeoArray(self.ref_path).to_mem()
tgt = GeoArray(self.tgt_path).to_mem()
# force to overwrite projection
ref.filePath = None
tgt.filePath = None
ref.prj = EPSG2WKT(3035) # ETRS89_LAEA_Europe
tgt.prj = EPSG2WKT(3035) # ETRS89_LAEA_Europe
CR = self.run_shift_detection_correction(ref, tgt, **dict(self.coreg_kwargs))
self.assertTrue(CR.success)
def test_shift_calculation_different_geographic_datum(self):
"""Test if shift computation properly raises a RunTimeError if the matching window is centered at a cloudy
image position.
"""
ref = GeoArray(self.ref_path).to_mem()
tgt = GeoArray(self.tgt_path).to_mem()
# force to overwrite projection
ref.filePath = None
ref.prj = EPSG2WKT(3035) # ETRS89_LAEA_Europe
with self.assertRaises(RuntimeError):
self.run_shift_detection_correction(ref, tgt, **dict(self.coreg_kwargs))
def test_shift_calculation_windowOutside(self):
"""Test if shift computation properly raises a ValueError if the given window position is outside of the image
overlap."""
......
Markdown is supported
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