简体   繁体   中英

calculate mean of raster in webmapping application

I'm trying to develop a GIS web application. I'm using raster image. I need to calculate the mean of image geotiff. I am using html javascript ,geoserver , leaflet and i didn't found the way to do this.

<script>

// Instantiation de différentes couches provenant de GeoServer

                var urbanareas = L.tileLayer.wms("http://localhost:8080/geoserver/cite/wms", {
                    layers: 'cite:GIOVANNI-wmsLayer_p06NTXAh',
                    format: 'image/png',
                    transparent: true
                });

        var grayscale = L.tileLayer.wms("http://localhost:8080/geoserver/cite/wms", {
                    layers: 'cite:COMGEO',
                    format: 'image/png',
                    transparent: true
                });
//var grayscale   = L.tileLayer(mbUrl, {id: 'mapbox.light', attribution: mbAttr}),
    //streets  = L.tileLayer(mbUrl, {id: 'mapbox.streets',   attribution: mbAttr});

var map = L.map('map', {
    center: [34.08,-5.00],
    zoom:6,
    layers: [grayscale, urbanareas]
});

var baseLayers = {
    "Grayscale": grayscale
    //"Streets": streets
};

var overlays = {
    "prepitation": urbanareas
};

By "the mean" you mean you have a GeoTiff with some actual values, eg, an elevation, and need to compute the average value in a given area, or whole raster?

There are two "raster zonal statistics" processes in GeoServer WPS that can do something similar, although it's more sophisticated than what you need, it's going to compute min/max/avg/stddev of the values of a raster on a set of polygons (eg, admin boundaries).

Unfortunately I don't have documentation for them or a sample request, honestly for what you're trying to do I'd try to derive a simpler version of the process in Java code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM