[Geoserver-users] Maximum height in area

Hi, I'm working for the OAM project to create an open aviation map.
One feature that is qute special for aviation maps is MORA grid heights.
http://en.wikipedia.org/wiki/MORA_(aviation)
<http://en.wikipedia.org/wiki/MORA_(aviation)&gt;
To calculate these I need to extract the biggest elevation within a lat lon
square.
Right now I've got the elevation data from the NASA SRTM set in Geoserver.
Anyone
know how to extract the largest height in a square from this using
Geoserver?

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Maximum-height-in-area-tp5032285.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Tue, Feb 5, 2013 at 9:34 PM, lysgaard <morten@anonymised.com> wrote:

Hi, I’m working for the OAM project to create an open aviation map.
One feature that is qute special for aviation maps is MORA grid heights.
http://en.wikipedia.org/wiki/MORA_(aviation)
<http://en.wikipedia.org/wiki/MORA_(aviation)>
To calculate these I need to extract the biggest elevation within a lat lon
square.
Right now I’ve got the elevation data from the NASA SRTM set in Geoserver.
Anyone
know how to extract the largest height in a square from this using
Geoserver?

You’ll have to write a WPS process, probably one wrapping the
Extrema operation, which should give you min and max,
and then chain it with the existing CropCoverage operation that will
allow you to restrict the operation to the desired area.

The CropCoverage process is probably a good template for that:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/CropCoverage.java

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


I see. but would this allow to generate the maximum value for each 1x1 degree grid somehow? basically the task is to ‘reduce’ the SRTM elevation grid into ‘one value per 1x1 degree area’ where that value is the max value of all pixels for that area. Akos

···

On 06/02/13 19:54, Andrea Aime wrote:

On Tue, Feb 5, 2013 at 9:34 PM, lysgaard <morten@anonymised.com> wrote:

Hi, I’m working for the OAM project to create an open aviation map.
One feature that is qute special for aviation maps is MORA grid heights.
http://en.wikipedia.org/wiki/MORA_(aviation)
<http://en.wikipedia.org/wiki/MORA_(aviation)>
To calculate these I need to extract the biggest elevation within a lat lon
square.
Right now I’ve got the elevation data from the NASA SRTM set in Geoserver.
Anyone
know how to extract the largest height in a square from this using
Geoserver?

You’ll have to write a WPS process, probably one wrapping the
Extrema operation, which should give you min and max,
and then chain it with the existing CropCoverage operation that will
allow you to restrict the operation to the desired area.

On Fri, Feb 8, 2013 at 7:05 PM, Ákos Maróy <akos@anonymised.com> wrote:

On 06/02/13 19:54, Andrea Aime wrote:

On Tue, Feb 5, 2013 at 9:34 PM, lysgaard <morten@anonymised.com> wrote:

Hi, I’m working for the OAM project to create an open aviation map.
One feature that is qute special for aviation maps is MORA grid heights.
http://en.wikipedia.org/wiki/MORA_(aviation)
<http://en.wikipedia.org/wiki/MORA_(aviation)>
To calculate these I need to extract the biggest elevation within a lat lon
square.
Right now I’ve got the elevation data from the NASA SRTM set in Geoserver.
Anyone
know how to extract the largest height in a square from this using
Geoserver?

You’ll have to write a WPS process, probably one wrapping the
Extrema operation, which should give you min and max,
and then chain it with the existing CropCoverage operation that will
allow you to restrict the operation to the desired area.

I see. but would this allow to generate the maximum value for each 1x1 degree grid somehow?

basically the task is to ‘reduce’ the SRTM elevation grid into ‘one value per 1x1 degree area’ where that value is the max value of all pixels for that area.

Ah, no it won’t, I thought you wanted something “interactive” with the user picking the
area of interest.

A WPS process is still probably the best option, but you’ll have to iterate the extrema
operation over the 1x1 degree squares and build another grid

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On 08/02/13 19:15, Andrea Aime wrote:

Ah, no it won't, I thought you wanted something "interactive" with the
user picking the
area of interest.

A WPS process is still probably the best option, but you'll have to
iterate the extrema
operation over the 1x1 degree squares and build another grid

I see.

I have geoserver from the github sources in an eclipse dev environment
set up, but it seems that the WPS service / code would come from
somewhere else? how would I set up a dev environment which has the WPS
code in it? I looked at the geoserver dev documentation, but didn't
really find any pointers. the geoserver started from the github code way
doesn't seem to include WPS (well, at least WPS is not listed on the
right side on the admin page)

On Fri, Feb 8, 2013 at 7:18 PM, Ákos Maróy <akos@anonymised.com> wrote:

On 08/02/13 19:15, Andrea Aime wrote:

Ah, no it won’t, I thought you wanted something “interactive” with the
user picking the
area of interest.

A WPS process is still probably the best option, but you’ll have to
iterate the extrema
operation over the 1x1 degree squares and build another grid

I see.

I have geoserver from the github sources in an eclipse dev environment
set up, but it seems that the WPS service / code would come from
somewhere else? how would I set up a dev environment which has the WPS
code in it? I looked at the geoserver dev documentation, but didn’t
really find any pointers. the geoserver started from the github code way
doesn’t seem to include WPS (well, at least WPS is not listed on the
right side on the admin page)

From the root, mvn eclipse:eclipse -Pwps.
You can find several examples of processes back in geotools, process-feature
and process-raster community modules

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On 08/02/13 20:05, Andrea Aime wrote:

From the root, mvn eclipse:eclipse -Pwps.
You can find several examples of processes back in geotools,
process-feature
and process-raster community modules

thanks for the tip - it worked, although I had to add the wps-core and
web-wps project manually for some reason. anyway, it works now fine,
thank you!

On Wed, Feb 6, 2013 at 7:54 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

You'll have to write a WPS process, probably one wrapping the
Extrema operation, which should give you min and max,
and then chain it with the existing CropCoverage operation that will
allow you to restrict the operation to the desired area.

The CropCoverage process is probably a good template for that:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/CropCoverage.java

I've been trying to wrap my head around the WPS functionality. I've
tried to build requests
with the WPS request builder but i only get errors: "Content is not
allowed in prolog."
When i try to send the requests. I also can't find any trace of the
extrema operation in WPS.
Is this a operation in the same way as CropCoverage or something else?

Thanks for the help! - Morten

On Fri, Feb 8, 2013 at 8:56 PM, Morten Olsen Lysgaard <morten@anonymised.com> wrote:

On Wed, Feb 6, 2013 at 7:54 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

You’ll have to write a WPS process, probably one wrapping the
Extrema operation, which should give you min and max,
and then chain it with the existing CropCoverage operation that will
allow you to restrict the operation to the desired area.

The CropCoverage process is probably a good template for that:
https://github.com/geotools/geotools/blob/master/modules/unsupported/process-raster/src/main/java/org/geotools/process/raster/CropCoverage.java

I’ve been trying to wrap my head around the WPS functionality. I’ve
tried to build requests
with the WPS request builder but i only get errors: “Content is not
allowed in prolog.”

It means the request is not well formed. There is a WPS request builder
in the demo section.

When i try to send the requests. I also can’t find any trace of the
extrema operation in WPS.

Because it’s not there, you have to write code in Java for it.

Is this a operation in the same way as CropCoverage or something else?

Nope, I just said CropCoverage code could have served as a template
to make an Extrema WPS process

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Sat, Feb 9, 2013 at 8:08 AM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

It means the request is not well formed. There is a WPS request builder
in the demo section.

The problem is that I'm using the WPS request builder to create the
requests that fail.
How can the request builder create ill formed requests?

On Sat, Feb 9, 2013 at 11:52 AM, Morten Olsen Lysgaard <morten@anonymised.com> wrote:

On Sat, Feb 9, 2013 at 8:08 AM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

It means the request is not well formed. There is a WPS request builder
in the demo section.

The problem is that I’m using the WPS request builder to create the
requests that fail.
How can the request builder create ill formed requests?

That’s normally called a “bug”. Can you share a screenshot of the request builder
and the XML that it generated?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Here’s the generated xml.


<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)" xmlns="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:wfs="[http://www.opengis.net/wfs](http://www.opengis.net/wfs)" xmlns:wps="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:ows="[http://www.opengis.net/ows/1.1](http://www.opengis.net/ows/1.1)" xmlns:gml="[http://www.opengis.net/gml](http://www.opengis.net/gml)" xmlns:ogc="[http://www.opengis.net/ogc](http://www.opengis.net/ogc)" xmlns:wcs="[http://www.opengis.net/wcs/1.1.1](http://www.opengis.net/wcs/1.1.1)" xmlns:xlink="[http://www.w3.org/1999/xlink](http://www.w3.org/1999/xlink)" xsi:schemaLocation="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0) [http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd](http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd)">
  <ows:Identifier>JTS:length</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>geom</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/wkt"><![CDATA[LINESTRING (30 10, 10 30, 40 40)]]></wps:ComplexData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput>
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>

Here’s the line that appears in my Geoserver log:

[Fatal Error] :1:40: Content is not allowed in prolog.

There’s a screenshot attached showing the WPS request builder creating the request.

On Sat, Feb 9, 2013 at 11:55 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Sat, Feb 9, 2013 at 11:52 AM, Morten Olsen Lysgaard <morten@anonymised.com>
wrote:

On Sat, Feb 9, 2013 at 8:08 AM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

It means the request is not well formed. There is a WPS request builder
in the demo section.

The problem is that I’m using the WPS request builder to create the
requests that fail.
How can the request builder create ill formed requests?

That’s normally called a “bug”. Can you share a screenshot of the request
builder
and the XML that it generated?

Cheers
Andrea

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Screenshot from 2013-02-09 12:08:27.png

On Sat, Feb 9, 2013 at 12:13 PM, Morten Olsen Lysgaard <morten@anonymised.com> wrote:

Here’s the generated xml.

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)" xmlns="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:wfs="[http://www.opengis.net/wfs](http://www.opengis.net/wfs)" xmlns:wps="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:ows="[http://www.opengis.net/ows/1.1](http://www.opengis.net/ows/1.1)" xmlns:gml="[http://www.opengis.net/gml](http://www.opengis.net/gml)" xmlns:ogc="[http://www.opengis.net/ogc](http://www.opengis.net/ogc)" xmlns:wcs="[http://www.opengis.net/wcs/1.1.1](http://www.opengis.net/wcs/1.1.1)" xmlns:xlink="[http://www.w3.org/1999/xlink](http://www.w3.org/1999/xlink)" xsi:schemaLocation="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0) [http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd](http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd)">
  <ows:Identifier>JTS:length</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>geom</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/wkt"><![CDATA[LINESTRING (30 10, 10 30, 40 40)]]></wps:ComplexData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput>
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>

Just tried it out, it works for me? I get 59.9070478491457 as a result.
I’m wondering if it’s browser specific. I’m using Chrome, and tested
with Firefox as well. By your screenshot it seems you’re using Chrome as well… weird.

I’ve also tested the WPS request builder, copying from your screenshot, and that worked as
well, same result.

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Maybe I am missing something but at the bottom of the startup.sh script I see the following

if not told otherwise pump up the permgen

if [ -z “$JAVA_OPS” ]; then
set JAVA_OPS=-XX:MaxPermSize=128m
fi

cd “$GEOSERVER_HOME”

echo “GEOSERVER DATA DIR is $GEOSERVER_DATA_DIR”
#added headless to true by default, if this messes anyone up let the list
#know and we can change it back, but it seems like it won’t hurt -ch
exec “$_RUNJAVA” $JAVA_OPTS -DGEOSERVER_DATA_DIR=“$GEOSERVER_DATA_DIR” -Djava.awt.headless=true -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -jar start.jar

Should this bit

if [ -z “$JAVA_OPS” ]; then
set JAVA_OPS=-XX:MaxPermSize=128m
fi

be

if [ -z “$JAVA_OPTS” ]; then
set JAVA_OPTS=-XX:MaxPermSize=128m
fi

Russ

On Wed, Feb 13, 2013 at 8:57 AM, Russell Hore <russ@anonymised.com> wrote:

Should this bit

if [ -z “$JAVA_OPS” ]; then
set JAVA_OPS=-XX:MaxPermSize=128m
fi

be

if [ -z “$JAVA_OPTS” ]; then
set JAVA_OPTS=-XX:MaxPermSize=128m
fi

Yes, good catch. Could you open a ticket at jira.codehaus.org about it?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it