Skip to content

Commit

Permalink
Fixes GeoNode#4827 - Line layer uploaded to GeoNode is rendered as a …
Browse files Browse the repository at this point in the history
…point layer
  • Loading branch information
capooti committed Sep 6, 2019
1 parent 1643283 commit 7d8c8ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions geonode/geoserver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,14 @@ def get_sld_for(gs_catalog, layer):
traceback.print_exc()
pass

if _default_style is None:
try:
gs_catalog._cache.clear()
gs_layer = gs_catalog.get_layer(layer.name)
except BaseException:
traceback.print_exc()

if _default_style is None:
try:
gs_layer = gs_catalog.get_layer(layer.name)
name = gs_layer.default_style.name if gs_layer.default_style is not None else "raster"
except BaseException:
traceback.print_exc()
Expand All @@ -260,6 +264,7 @@ def get_sld_for(gs_catalog, layer):
name = _default_style.name

# Detect geometry type if it is a FeatureType

if gs_layer and gs_layer.resource and gs_layer.resource.resource_type == 'featureType':
res = gs_layer.resource
res.fetch()
Expand Down

0 comments on commit 7d8c8ec

Please sign in to comment.