Skip to content

Commit

Permalink
[Fixes #4333] Upload from GUI doesn't handle projection properly
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Apr 3, 2019
1 parent 7220b08 commit f3c799d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geonode/geoserver/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ def geoserver_post_save_local(instance, *args, **kwargs):
instance.store = gs_resource.store.name

try:
logger.debug(" -------------------------------------------------- ")
bbox = gs_resource.native_bbox

logger.debug(bbox)
logger.debug(" -------------------------------------------------- ")
# Set bounding box values
instance.bbox_x0 = bbox[0]
instance.bbox_x1 = bbox[1]
Expand All @@ -259,6 +261,9 @@ def geoserver_post_save_local(instance, *args, **kwargs):
if instance.srid:
instance.srid_url = "http://www.spatialreference.org/ref/" + \
instance.srid.replace(':', '/').lower() + "/"
elif instance.bbox_x0 and instance.bbox_x1 and instance.bbox_y0 and instance.bbox_y1:
# Guessing 'EPSG:4326' by default
instance.srid = 'EPSG:4326'
else:
raise GeoNodeException("Invalid Projection. Layer is missing CRS!")

Expand Down

0 comments on commit f3c799d

Please sign in to comment.