layer only visible in layer preview OpenLayers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

layer only visible in layer preview OpenLayers

BartO
Hi,

I have created a coveragestore from a geotiff file and I want to print that layer on top of the google maps. The only thing I see is a pink image(broken link) on top of the google map.  Rendering an other workspace:layer on top of the google map works perfectly. So I guess something is wrong with my layer. But what?

When I look to the layer via KML, I don't see anything (Google earth is going the roi, but the image is not visible.)
But the strange thing is that I can see the image via OpenLayers in the layer preview.

What am I doing wrong?

I have attached the java script file, the coveragestore.xml file and the gdalinfo file of the geotiff.

This is the code that generates the pink image on top of the google maps

  // make map available for easy debugging
        var map;

        // avoid pink tiles
        OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
        OpenLayers.Util.onImageLoadErrorColor = "transparent";

        function init(){
            
            /**
             * The commercial layers (Google, Virtual Earth, and Yahoo) are
             * in a custom projection - we're calling this Spherical Mercator.
             * GeoServer understands that requests for EPSG:900913 should
             * match the projection for these commercial layers.  Note that
             * this is not a standard EPSG code - so, if you want to load
             * layers from another WMS, it will have to be configured to work
             * with this projection.
             */
            var options = {
                // the "community" epsg code for spherical mercator
                projection: "EPSG:900913",
                // map horizontal units are meters
                units: "m",
                // this resolution displays the globe in one 256x256 pixel tile
                maxResolution: 78271.51695,
                // these are the bounds of the globe in sperical mercator
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508)
            };
            // construct a map with the above options
            map = new OpenLayers.Map('map', options);

            // create Google layer
            var gsat = new OpenLayers.Layer.Google(
                "Google Satellite",
                {type: G_SATELLITE_MAP, sphericalMercator: true}
            );


            // you can create your own layers here

            // create WMS layer
            var wms = new OpenLayers.Layer.WMS(
                "Kalmthoutse_heide",
                "http://localhost:8080/geoserver/wms",
                {
                   layers: 'vito:gdal_band2',
                   styles: '',
                   srs: 'EPSG:900913',
                   format: 'image/png',
                   transparent: true
                },
                {
                    'opacity': 0.75, 'isBaseLayer': false
                }
            );
        
            var eurBounds= new OpenLayers.Bounds(
                -1669792, 7067812, 6233891, 16962750);

            // add the created layers to the map
            // (if you want custom layers to show up they must be here as well)
            map.addLayers([gsat, wms]);
            
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.MousePosition());
            map.zoomToExtent(eurBounds);
        }

This is the metadata from the coveragestore

<coverage>
  <name>gdal_band2</name>
  <nativeName>gdal_band2</nativeName>
  <namespace>
    <name>vito</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/namespaces/vito.xml" type="application/xml"/>
  </namespace>
  <title>gdal_band2</title>
  <description>Generated from GeoTIFF</description>
  <keywords>
    <string>WCS</string>
    <string>GeoTIFF</string>
    <string>gdal_band2</string>
  </keywords>
  <nativeCRS class="projected">PROJCS[&quot;WGS 84 / UTM zone 31N&quot;, 
  GEOGCS[&quot;WGS 84&quot;, 
    DATUM[&quot;World Geodetic System 1984&quot;, 
      SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]], 
      AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]], 
    PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]], 
    UNIT[&quot;degree&quot;, 0.017453292519943295], 
    AXIS[&quot;Geodetic longitude&quot;, EAST], 
    AXIS[&quot;Geodetic latitude&quot;, NORTH], 
    AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]], 
  PROJECTION[&quot;Transverse_Mercator&quot;, AUTHORITY[&quot;EPSG&quot;,&quot;9807&quot;]], 
  PARAMETER[&quot;central_meridian&quot;, 3.0], 
  PARAMETER[&quot;latitude_of_origin&quot;, 0.0], 
  PARAMETER[&quot;scale_factor&quot;, 0.9996], 
  PARAMETER[&quot;false_easting&quot;, 500000.0], 
  PARAMETER[&quot;false_northing&quot;, 0.0], 
  UNIT[&quot;m&quot;, 1.0], 
  AXIS[&quot;Easting&quot;, EAST], 
  AXIS[&quot;Northing&quot;, NORTH], 
  AUTHORITY[&quot;EPSG&quot;,&quot;32631&quot;]]</nativeCRS>
  <srs>EPSG:32631</srs>
  <nativeBoundingBox>
    <minx>593426.0</minx>
    <maxx>601972.0</maxx>
    <miny>5690816.0</miny>
    <maxy>5698362.0</maxy>
    <crs class="projected">EPSG:32631</crs>
  </nativeBoundingBox>
  <latLonBoundingBox>
    <minx>4.34075</minx>
    <maxx>4.468249999999999</maxx>
    <miny>51.33025000000001</miny>
    <maxy>51.457750000000004</maxy>
    <crs>EPSG:4326</crs>
  </latLonBoundingBox>
  <projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy>
  <enabled>true</enabled>
  <metadata>
    <entry key="dirName">habi_band2_gdal_band2</entry>
  </metadata>
  <store class="coverageStore">
    <name>habi_band2</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/vito/coveragestores/habi_band2.xml" type="application/xml"/>
  </store>
  <nativeFormat>GeoTIFF</nativeFormat>
  <grid dimension="2">
    <range>
      <low>0 0</low>
      <high>4273 3773</high>
    </range>
    <transform>
      <scaleX>2.0</scaleX>
      <scaleY>-2.0</scaleY>
      <shearX>0.0</shearX>
      <shearY>0.0</shearY>
      <translateX>593427.0</translateX>
      <translateY>5698361.0</translateY>
    </transform>
    <crs>EPSG:32631</crs>
  </grid>
  <supportedFormats>
    <string>ImageMosaic</string>
    <string>GIF</string>
    <string>PNG</string>
    <string>JPEG</string>
    <string>TIFF</string>
    <string>GEOTIFF</string>
    <string>Gtopo30</string>
    <string>ArcGrid</string>
  </supportedFormats>
  <interpolationMethods>
    <string>nearest neighbor</string>
    <string>bilinear</string>
    <string>bicubic</string>
  </interpolationMethods>
  <defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod>
  <dimensions>
    <coverageDimension>
      <name>GRAY_INDEX</name>
      <description>GridSampleDimension[-Infinity,Infinity]</description>
    </coverageDimension>
  </dimensions>
  <requestSRS>
    <string>EPSG:32631</string>
  </requestSRS>
  <responseSRS>
    <string>EPSG:32631</string>
  </responseSRS>
</coverage>

This is the info generated by gdalinfo on the geotiff file:

gdalinfo /tmp/gdal_band2.tif
Driver: GTiff/GeoTIFF
Files: /tmp/gdal_band2.tif
       /tmp/gdal_band2.tif.aux.xml
Size is 4273, 3773
Coordinate System is:
PROJCS["WGS 84 / UTM zone 31N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32631"]]
Origin = (593426.000000000000000,5698362.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  TIFFTAG_IMAGEDESCRIPTION={
  bandList = 
  [
    6;
    2;
    3;
    7;
    4;
    8;
    5;
    9;
  ]
}
  TIFFTAG_DATETIME=2011:09:01 16:17:04
  TIFFTAG_COPYRIGHT=This imagery is subject to copyrights of European Space Imaging GmbH/Space Imaging Middle East and DigitalGlobe, Inc.. Use and distribution of this image and any derived product thereof is subject to the terms of the *_LICENSE.TXT file that is included in this product.
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
RPC Metadata:
  LINE_OFF=1888
  SAMP_OFF=2135
  LAT_OFF=51.394
  LONG_OFF=4.4043
  HEIGHT_OFF=61
  LINE_SCALE=1939
  SAMP_SCALE=2199
  LAT_SCALE=0.0347
  LONG_SCALE=0.0625
  HEIGHT_SCALE=500
  LINE_NUM_COEFF=0.001945439 -0.02147899 -0.9950287 0.02692491 -2.291859e-05 2.508409e-05 -0.0005670547 -0.0004781282 -0.0009769592 1.261439e-05 -7.653226e-07 -6.165549e-07 1.293601e-07 8.316124e-07 -1.95027e-07 -1.149229e-06 8.06036e-08 -9.905118e-06 -2.25353e-06 -3.797216e-07
  LINE_DEN_COEFF=1 8.226453e-06 0.0009783186 -0.0006165279 6.064207e-08 -7.504737e-07 6.237633e-07 6.765871e-07 5.638186e-07 -2.126489e-07 3.634982e-07 -8.489788e-07 6.760792e-07 -1.48227e-06 -8.813402e-07 1.097276e-06 1.916304e-07 1.734664e-06 -9.839035e-07 4.953119e-07
  SAMP_NUM_COEFF=0.0009981395 0.988638 -0.01680887 -0.02824259 -0.0003645875 0.0003851173 8.885042e-05 -0.0004922461 -1.061201e-05 -1.114188e-05 9.658376e-08 2.300321e-07 -3.107926e-07 -3.643442e-08 2.714185e-07 1.356068e-07 5.356969e-08 9.923509e-07 6.777414e-08 6.968894e-08
  SAMP_DEN_COEFF=1 -0.0004954088 0.0003795783 -0.0003535342 9.811784e-08 -5.980072e-07 -5.410396e-08 1.381974e-07 2.033858e-07 -1.191323e-07 1.312212e-07 6.502908e-07 -2.661492e-07 -5.288083e-08 3.244126e-08 1.742792e-07 -3.085077e-07 6.598448e-06 1.145124e-07 1.908151e-07
Corner Coordinates:
Upper Left  (  593426.000, 5698362.000) 
Lower Left  (  593426.000, 5690816.000) 
Upper Right (  601972.000, 5698362.000) 
Lower Right (  601972.000, 5690816.000) 
Center      (  597699.000, 5694589.000) 
Band 1 Block=4273x1 Type=UInt16, ColorInterp=Gray