Missing CRS error when saving layer from admin
Geonode version: 2.10.0 rc4 GeoServer version: 2.14 (build date 2018-11-14T17:55:16Z)
Error detail: File "/home/stefano/Envs/geonode/src/geonode/geonode/geoserver/signals.py", line 267, in geoserver_post_save_local raise GeoNodeException("Invalid Projection. Layer is missing CRS!") GeoNodeException: Invalid Projection. Layer is missing CRS!
Steps to reproduce:
- create a Layer in GeoServer as SQL View (layer correctly saved in GeoServer with SRID=4326)
- create a Layer in Geonode (Django admin) from GeoServer
The layer is found in GeoServer, but bounding boxes are returned as follows: gs_resource.native_bbox => ('-180.0', '180.0', '-90.0', '90.0', None)
The layer instance is then modified in the code as follows:
# Set bounding box values
instance.bbox_x0 = bbox[0]
instance.bbox_x1 = bbox[1]
instance.bbox_y0 = bbox[2]
instance.bbox_y1 = bbox[3]
instance.srid = bbox[4]
so, the SRID is set to None, causing the raise of the above exception. As a temporary workaround, I commented line 259 instance.srid = bbox[4] but this way I'm not checking that SRID set in Geonode equals SRID set in GeoServer.
Hi! I'm having the same problem, it shows when I run updatelayers.. How can I fix it??
Thanks in advance..