Commit 04f3a297 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Replaces EPSG related parameters by WKT string to get rid of missing EPSG issue.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent afaea8fd
......@@ -537,13 +537,10 @@ class COREG(object):
if not prj_equal(self.ref.prj, self.shift.prj):
from pyproj import CRS
def get_prjdesc(proj):
crs = CRS.from_user_input(proj)
return "%s (EPSG: %d)" % (crs.name, crs.to_epsg())
raise RuntimeError(
'Input projections are not equal. Different projections are currently not supported. '
'Got %s / %s.' % (get_prjdesc(self.ref.prj), get_prjdesc(self.shift.prj)))
'Got %s / %s.' % (CRS.from_user_input(self.ref.prj).name,
CRS.from_user_input(self.shift.prj).name))
def _get_overlap_properties(self) -> None:
overlap_tmp = get_overlap_polygon(self.ref.poly, self.shift.poly, self.v)
......@@ -594,10 +591,10 @@ class COREG(object):
import folium
import geojson
refPoly = reproject_shapelyGeometry(self.ref.poly, self.ref.epsg, 4326)
shiftPoly = reproject_shapelyGeometry(self.shift.poly, self.shift.epsg, 4326)
overlapPoly = reproject_shapelyGeometry(self.overlap_poly, self.shift.epsg, 4326)
matchBoxPoly = reproject_shapelyGeometry(self.matchBox.mapPoly, self.shift.epsg, 4326)
refPoly = reproject_shapelyGeometry(self.ref.poly, self.ref.prj, 4326)
shiftPoly = reproject_shapelyGeometry(self.shift.poly, self.shift.prj, 4326)
overlapPoly = reproject_shapelyGeometry(self.overlap_poly, self.shift.prj, 4326)
matchBoxPoly = reproject_shapelyGeometry(self.matchBox.mapPoly, self.shift.prj, 4326)
m = folium.Map(location=tuple(np.array(overlapPoly.centroid.coords.xy).flatten())[::-1])
for poly in [refPoly, shiftPoly, overlapPoly, matchBoxPoly]:
......
......@@ -692,7 +692,7 @@ class COREG_LOCAL(object):
folium.GeoJson(points_values).add_to(map_osm)
# add overlap polygon
overlapPoly = reproject_shapelyGeometry(self.COREG_obj.overlap_poly, self.im2shift.epsg, 4326)
overlapPoly = reproject_shapelyGeometry(self.COREG_obj.overlap_poly, self.im2shift.prj, 4326)
gjs = geojson.Feature(geometry=overlapPoly, properties={})
folium.GeoJson(gjs).add_to(map_osm)
......
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