Tuesday, November 15, 2011

Geoserver and ADF Files (ArcGrid Binary, AIG)

I just downloaded the entire US in 1\3 arc second resolution, in 1 degree tiles and wanted to work with them in Geoserver.

I first tried to use the latest GEO-EXT and GDAL from (1.1.X)

http://java.net/projects/imageio-ext/downloads/directory/Releases/ImageIO-Ext

and followed the instructions here:
http://docs.geoserver.org/stable/en/user/data/gdal.html

Didn´t work. Use the 1.08 version instead.

Finally, got this:


Nice. Now to get shaded relief and contours!

Apparently Shaded relief isn´t here yet, but contours are:

http://geo-solutions.blogspot.com/2011/01/developers-corner-have-your-sld.html

Using the latest nightly build, and the 1.10 version of the geo-ext binaries and jars, with this sld I get:



Most of the way there...

  <?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xmlns="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml"
  xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/sld ./StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>contour_lines</Name>
    <UserStyle>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="gs:Contour">
            <ogc:Function name="parameter">
              <ogc:Literal>data</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>levels</ogc:Literal>
              <ogc:Literal>1850</ogc:Literal>
              <ogc:Literal>1860</ogc:Literal>
              <ogc:Literal>1870</ogc:Literal>
              <ogc:Literal>1880</ogc:Literal>
              <ogc:Literal>1890</ogc:Literal>
              <ogc:Literal>1900</ogc:Literal>
              <ogc:Literal>1910</ogc:Literal>
              <ogc:Literal>1920</ogc:Literal>
              <ogc:Literal>1930</ogc:Literal>
              <ogc:Literal>1940</ogc:Literal>
              <ogc:Literal>1950</ogc:Literal>
              <ogc:Literal>1960</ogc:Literal>
              <ogc:Literal>1970</ogc:Literal>
              <ogc:Literal>1980</ogc:Literal>
              <ogc:Literal>1990</ogc:Literal>
            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <linesymbolizer>
            <stroke></stroke>
          </linesymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Now, how to get all the 1 degree files (about 900) in a single imagemosaic so we can view contours anywhere. Also, how to create a generic style that will work anywhere. Seems that the Level parameter doesn´t would like you would think in the gs:Contour.



For the first issue, this was encouraging " In addition, if imageio-ext GDAL extensions are properly installed we can also serve all the formats supported by it like MrSID, ECW, JPEG2000, etc... See GDAL Image Formats for more information on how to install them." from here: http://docs.geoserver.org/latest/en/user/tutorials/image_mosaic_plugin/imagemosaic.html

First I thought to see just how smart the ImageMosaic software is by giving it the path above all the ADF subdirectories...Just what it would do. It took a long time but it worked! Awesomely awesome!