0

I would like to perform a gs:CropCoverage of the Raster Layer which is the result of gs:BarnesSurface

enter image description here

The SLD file is below:

<?xml version="1.0" encoding="ISO-8859-1"?>
<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>CropCoverage</Name>
        <UserStyle>
            <Title>Crop Coverage</Title>
            <FeatureTypeStyle>
                <Transformation>
                    <ogc:Function name="gs:CropCoverage">
                        <!-- crop coverage -->
                        <ogc:Function name="parameter">
                            <ogc:Literal>coverage</ogc:Literal>

                            <ogc:Function name="gs:BarnesSurface">

                                <ogc:Function name="parameter">
                                    <ogc:Literal>data</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>valueAttr</ogc:Literal>
                                    <ogc:Literal>o3_8h</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>scale</ogc:Literal>
                                    <ogc:Literal>300000</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>convergence</ogc:Literal>
                                    <ogc:Literal>0.2</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>passes</ogc:Literal>
                                    <ogc:Literal>3</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>minObservations</ogc:Literal>
                                    <ogc:Literal>1</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>maxObservationDistance</ogc:Literal>
                                    <ogc:Literal>300000</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>pixelsPerCell</ogc:Literal>
                                    <ogc:Literal>10</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>queryBuffer</ogc:Literal>
                                    <ogc:Literal>1100000</ogc:Literal>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>outputBBOX</ogc:Literal>
                                    <ogc:Function name="env">
                                        <ogc:Literal>wms_bbox</ogc:Literal>
                                    </ogc:Function>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>outputWidth</ogc:Literal>
                                    <ogc:Function name="env">
                                        <ogc:Literal>wms_width</ogc:Literal>
                                    </ogc:Function>
                                </ogc:Function>

                                <ogc:Function name="parameter">
                                    <ogc:Literal>outputHeight</ogc:Literal>
                                    <ogc:Function name="env">
                                        <ogc:Literal>wms_height</ogc:Literal>
                                    </ogc:Function>
                                </ogc:Function>

                            </ogc:Function>

                        </ogc:Function>
                        <ogc:Function name="parameter">
                            <ogc:Literal>cropShape</ogc:Literal>
                            <ogc:Function name="env">
                                <ogc:Literal>shape</ogc:Literal>
                                <ogc:Literal>
                                    POLYGON((12679220.5449551 4733685.69206447,12898591.968062 4713152.82010571,13058134.8212306 4439899.46114607,13030214.821926 4052340.79528089,12735060.5435642 4028261.06778929,12483780.5498236 4076471.69742768,12180649.1288033 4330580.49744829,12264409.1267168 4525151.37667656,12264409.1267168 4525151.37667656,12364123.4099472 4728548.57087371,12364123.4099472 4728548.57087371,12679220.5449551 4733685.69206447))
                                  </ogc:Literal>
                            </ogc:Function>
                        </ogc:Function>
                    </ogc:Function>
                </Transformation>
                <Rule>
                    <Name>rule1</Name>
                    <RasterSymbolizer></RasterSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

The Error Info is below:

Error rendering coverage on the fast path java.lang.RuntimeException: Failed to evaluate the process function, error is: java.lang.RuntimeException: java.io.IOException Failed to evaluate the process function, error is: java.lang.RuntimeException: java.io.IOException java.lang.RuntimeException: java.io.IOException java.io.IOExceptionorg.postgresql.util.PSQLException: ERROR: parse error - invalid geometry 建议:"POLYGON ((-�" <-- parse error at position 12 within geometry ERROR: parse error - invalid geometry 建议:"POLYGON ((-�" <-- parse error at position 12 within geometry

Where Error??????

But It's OK When I Use below sld to crop a raster:

 <?xml version="1.0" encoding="ISO-8859-1"?>
<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>CropCoverage</Name>
    <UserStyle>
      <Title>Crop Coverage</Title>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="gs:CropCoverage">
            <!-- crop coverage -->
            <ogc:Function name="parameter">
              <ogc:Literal>coverage</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>cropShape</ogc:Literal>

                <ogc:Literal>POLYGON((12679220.5449551 4733685.69206447,12898591.968062 4713152.82010571,13058134.8212306 4439899.46114607,13030214.821926 4052340.79528089,12735060.5435642 4028261.06778929,12483780.5498236 4076471.69742768,12180649.1288033 4330580.49744829,12264409.1267168 4525151.37667656,12264409.1267168 4525151.37667656,12364123.4099472 4728548.57087371,12364123.4099472 4728548.57087371,12679220.5449551 4733685.69206447))</ogc:Literal>

            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <Name>rule1</Name>
          <RasterSymbolizer>


        </RasterSymbolizer>
      </Rule>
    </FeatureTypeStyle>
  </UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
1

This is an old post but there is no clear solution.. I noticed something odd in the SLD. The <ogc:Function name="parameter"> of the <ogc:Function name="gs:CropCoverage"> should be close before the <ogc:Function name="gs:BarnesSurface"> starts, no? Anyway, this did get rid of the above error in my case.

I was not yet successful in combining gs:CropCoverage and gs:BarnesSurface, but that is related to an issue with gs:CropCoverage it seems (it was in my case using GeoServer 2.8.3)

0

try disabling the geometry simplification flag in your PostGIS store configuration in GeoServer.

  • Could you give more information as to why this might be? And are you sure he has that flag set. I have seen that error before, but never from simplification, though that can lead to other geometry errors. – John Powell Nov 30 '15 at 17:27
  • Hi Andrea Aime. I have disabling the geometry simplification flag in PostGIS store configuration in GeoServer. But there is still the same error! – KangMing Dec 1 '15 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.