Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
arosics
Commits
04f3a297
Commit
04f3a297
authored
Apr 17, 2021
by
Daniel Scheffler
Browse files
Replaces EPSG related parameters by WKT string to get rid of missing EPSG issue.
Signed-off-by:
Daniel Scheffler
<
danschef@gfz-potsdam.de
>
parent
afaea8fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
arosics/CoReg.py
View file @
04f3a297
...
...
@@ -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
]:
...
...
arosics/CoReg_local.py
View file @
04f3a297
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment