Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoNode Geoserver has an invalid generic style #9564

Closed
kikislater opened this issue Jul 1, 2022 · 6 comments
Closed

GeoNode Geoserver has an invalid generic style #9564

kikislater opened this issue Jul 1, 2022 · 6 comments
Assignees
Labels
3.2.x 3.3.x 4.0.x major A high priority issue which might affect a lot of people or large parts of the codebase master
Milestone

Comments

@kikislater
Copy link
Contributor

kikislater commented Jul 1, 2022

Expected Behavior

Geoserver has a valid generic style allowing uploading from geoserver itself and viewing with OpenLayers geoserver viewer

Actual Behavior

Empty generic style causing invalid wms rendering
Geoserver has an invalid generic style causing problems when uploading from geoserver itself (GUI or API : Geoflow for example). Could be shown in embeded Geoserver's OpenLayers or invalid WMS answer.

Steps to Reproduce the Problem

  1. Log in to geoserver admin
  2. Go to style => generic
  3. Invalid style

Specifications

  • GeoNode version: 3.2, 4.0
  • Installation method (manual, GeoNode Docker, SPCGeoNode Docker): Docker
  • Platform: Docker
  • Additional details:

Left : Geonode Geoserver 2.18.2. Right : Standard Geoserver 2.18.2
image

@kikislater
Copy link
Contributor Author

kikislater commented Jul 4, 2022

Additionnal info : generic.sld from Geoserver Geonode is empty =>

export GEOSERVER_VERSION=2.20.4
 wget --no-check-certificate --progress=bar:force:noscroll \
    https://artifacts.geonode.org/geoserver/${GEOSERVER_VERSION}/geoserver.war -O geoserver.war \
    && unzip -q geoserver.war -d /tmp/geoserver
echo "######
list generic files
######" && ls -lha /tmp/geoserver/data/styles/generic*
echo "######
generic.sld content :
######"  && cat /tmp/geoserver/data/styles/generic.sld
rm -rf /tmp/geoserver

Output :

######
list generic files
######
-rw-r--r-- 1 sylvain sylvain   0 25 mai   18:18 /tmp/geoserver/data/styles/generic.sld
-rw-r--r-- 1 sylvain sylvain 220 25 mai   18:18 /tmp/geoserver/data/styles/generic.xml
######
generic.sld content :
######

@kikislater
Copy link
Contributor Author

kikislater commented Jul 4, 2022

Data folder from Standard Geoserver installation :

export GEOSERVER_VERSION=2.20.4
 wget --no-check-certificate --progress=bar:force:noscroll \
    http://downloads.sourceforge.net/project/geoserver/GeoServer/${GEOSERVER_VERSION}/geoserver-${GEOSERVER_VERSION}-war.zip -O geoserver.war.zip \
    && unzip -q geoserver.war.zip -d /tmp/geoserver_tmp && unzip -q /tmp/geoserver_tmp/geoserver.war -d  /tmp/geoserver
echo "######
list generic files
######" && ls -lha /tmp/geoserver/data/styles/*generic*
echo "######
generic.sld content :
######"  && cat /tmp/geoserver/data/styles/*generic.sld
rm -rf /tmp/geoserver*

Output :

######
list generic files
######
-rw-r--r-- 1 sylvain sylvain 2,9K 12 avril 07:41 /tmp/geoserver/data/styles/default_generic.sld
-rw-r--r-- 1 sylvain sylvain  228 12 avril 07:41 /tmp/geoserver/data/styles/generic.xml
######
default_generic.sld content :
######
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" 
                       xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
                       xmlns="http://www.opengis.net/sld" 
                       xmlns:ogc="http://www.opengis.net/ogc" 
                       xmlns:xlink="http://www.w3.org/1999/xlink" 
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>generic</Name>
    <UserStyle>
      <Title>Generic</Title>
      <Abstract>Generic style</Abstract>
      <FeatureTypeStyle>
        <Rule>
          <Name>raster</Name>
          <Title>Opaque Raster</Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:Function name="isCoverage"/>
              <ogc:Literal>true</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
          </RasterSymbolizer>
        </Rule>
        <Rule>
          <Name>Polygon</Name>
          <Title>Grey Polygon</Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:Function name="dimension">
                <ogc:Function name="geometry"/>
              </ogc:Function>
              <ogc:Literal>2</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#AAAAAA</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#000000</CssParameter>
              <CssParameter name="stroke-width">1</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>
        <Rule>
          <Name>Line</Name>
          <Title>Blue Line</Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:Function name="dimension">
                <ogc:Function name="geometry"/>
              </ogc:Function>
              <ogc:Literal>1</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#0000FF</CssParameter>
              <CssParameter name="stroke-opacity">1</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
        <Rule>
          <Name>point</Name>
          <Title>Red Square Point</Title>
          <ElseFilter/>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>square</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>6</Size>
            </Graphic>
          </PointSymbolizer>
        </Rule>
        <VendorOption name="ruleEvaluation">first</VendorOption>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

@afabiani afabiani added major A high priority issue which might affect a lot of people or large parts of the codebase master 3.2.x 3.3.x 4.0.x labels Jul 4, 2022
@afabiani
Copy link
Member

afabiani commented Jul 4, 2022

I confirm the generic.sld file is empty inside the default GeoNode-GeoServer DATADIR

image

@giohappy
Copy link
Contributor

giohappy commented Jul 4, 2022

Created upstream issue GeoNode/geoserver-geonode-ext#124

@kikislater
Copy link
Contributor Author

kikislater commented Jul 4, 2022

It happens since Geonode 2.8 and Geoserver data > 2.10 : https://build.geo-solutions.it/geonode/geoserver/latest/data-2.14.x.zip

@giohappy giohappy assigned afabiani and unassigned randomorder Jul 6, 2022
@giohappy giohappy added this to the 4.0.0 milestone Jul 6, 2022
@giohappy
Copy link
Contributor

giohappy commented Aug 1, 2022

fixed in GeoNode/geoserver-geonode-ext#124

@giohappy giohappy closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.x 3.3.x 4.0.x major A high priority issue which might affect a lot of people or large parts of the codebase master
Projects
None yet
Development

No branches or pull requests

5 participants