[Geoserver-users] getfeatureinfo and coverages

I’m looking for a way to customize the output from WMS getFeatureInfo called on coverages. It’s not clear where to put a custom content.ftl template for a raster layer, or if this is even supported. If not, what’s the preferred way to get the nearest point value of a raster from GeoServer?

And it seems that be specification the getFeatureInfo service is calculating the point value of the query point from the size of the image and pixel offset… Is there anyway just to pass in lat/long directly to a some sort of featureInfo call?

Thanks,

-Chris

Christopher Condit

condit@anonymised.com

858-822-5483

San Diego Supercomputer Center

9500 Gilman Drive

La Jolla, CA 92093-0505

Hi Christopher,

I do not believe this is something we support at the moment. The reason being that the template system assumes that a template is always being applied to a vector layer.

However, looking at the implementation of GetFeatureInfo it seems that for coverages a FeatureType is "faked", so applying a template to it would be possible... although i am not sure how much sense it would make.

Andrea implemented templates for GetFeatureInfo and should have a better idea. Having the template system pick up templates or coverages would be trivial... What do you think Andrea?

-Justin

Christopher Condit wrote:

I’m looking for a way to customize the output from WMS getFeatureInfo called on coverages. It’s not clear where to put a custom content.ftl template for a raster layer, or if this is even supported. If not, what’s the preferred way to get the nearest point value of a raster from GeoServer?

And it seems that be specification the getFeatureInfo service is calculating the point value of the query point from the size of the image and pixel offset… Is there anyway just to pass in lat/long directly to a some sort of featureInfo call?

Thanks,

-Chris

Christopher Condit

condit@anonymised.com

858-822-5483

San Diego Supercomputer Center

9500 Gilman Drive

La Jolla, CA 92093-0505

!DSPAM:4007,481644f2297727082231907!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

!DSPAM:4007,481644f2297727082231907!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,481644f2297727082231907!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Hi Justin-
Thanks for getting back to me. Just to give some perspective I'm coming
from a MapServer world where I can call the MapScript API to get feature
info directly for both raster and vector layers and then display that to
the client. So I guess what I'm looking for is the "correct" OGC way to
do that in GeoServer...
-Chris

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Monday, April 28, 2008 17:54
To: Christopher Condit
Cc: geoserver-users@lists.sourceforge.net; Andrea Aime
Subject: Re: [Geoserver-users] getfeatureinfo and coverages

Hi Christopher,

I do not believe this is something we support at the moment. The reason
being that the template system assumes that a template is always being
applied to a vector layer.

However, looking at the implementation of GetFeatureInfo it seems that
for coverages a FeatureType is "faked", so applying a template to it
would be possible... although i am not sure how much sense it would
make.

Andrea implemented templates for GetFeatureInfo and should have a better

idea. Having the template system pick up templates or coverages would be

trivial... What do you think Andrea?

-Justin

Christopher Condit wrote:

I'm looking for a way to customize the output from WMS getFeatureInfo
called on coverages. It's not clear where to put a custom content.ftl
template for a raster layer, or if this is even supported. If not,
what's the preferred way to get the nearest point value of a raster

from

GeoServer?

And it seems that be specification the getFeatureInfo service is
calculating the point value of the query point from the size of the
image and pixel offset... Is there anyway just to pass in lat/long
directly to a some sort of featureInfo call?

Thanks,

-Chris

Christopher Condit

condit@anonymised.com

858-822-5483

San Diego Supercomputer Center

9500 Gilman Drive

La Jolla, CA 92093-0505

!DSPAM:4007,481644f2297727082231907!

------------------------------------------------------------------------

------------------------------------------------------------------------
-

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save

$100.

Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/j
avaone

!DSPAM:4007,481644f2297727082231907!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,481644f2297727082231907!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

What I believe to be a bit more of the 'correct' way to get feature and coverage data is to use the appropriate OGC service, WFS for vector and WCS for raster. GetFeatureInfo is a bit funky with things like the html output, since it depends on the server rendering it some way that's never standard. So I think the more interoperable way is to get at the data directly, and choose on the client side how to style it.

Of course I concede it's nice for the server side to apply styles, it can make things easier for. But yeah, the uber correct way would be to do a WCS GetCoverage call to get the raster values, which gives you a lot of control over how to request it, and then on the client use some javascript to insert it in to the right html elements to make it look the way you want.

best regards,

Chris

Christopher Condit wrote:

Hi Justin-
Thanks for getting back to me. Just to give some perspective I'm coming
from a MapServer world where I can call the MapScript API to get feature
info directly for both raster and vector layers and then display that to
the client. So I guess what I'm looking for is the "correct" OGC way to
do that in GeoServer...
-Chris

-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com] Sent: Monday, April 28, 2008 17:54
To: Christopher Condit
Cc: geoserver-users@lists.sourceforge.net; Andrea Aime
Subject: Re: [Geoserver-users] getfeatureinfo and coverages

Hi Christopher,

I do not believe this is something we support at the moment. The reason being that the template system assumes that a template is always being applied to a vector layer.

However, looking at the implementation of GetFeatureInfo it seems that for coverages a FeatureType is "faked", so applying a template to it would be possible... although i am not sure how much sense it would
make.

Andrea implemented templates for GetFeatureInfo and should have a better

idea. Having the template system pick up templates or coverages would be

trivial... What do you think Andrea?

-Justin

Christopher Condit wrote:

I'm looking for a way to customize the output from WMS getFeatureInfo called on coverages. It's not clear where to put a custom content.ftl template for a raster layer, or if this is even supported. If not, what's the preferred way to get the nearest point value of a raster

from

GeoServer?

And it seems that be specification the getFeatureInfo service is calculating the point value of the query point from the size of the image and pixel offset... Is there anyway just to pass in lat/long directly to a some sort of featureInfo call?

Thanks,

-Chris

Christopher Condit

condit@anonymised.com

858-822-5483

San Diego Supercomputer Center

9500 Gilman Drive

La Jolla, CA 92093-0505

------------------------------------------------------------------------

------------------------------------------------------------------------
-

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save

$100.

Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/j
avaone

!DSPAM:4007,481644f2297727082231907!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,481644f2297727082231907!

Justin Deoliveira ha scritto:

Hi Christopher,

I do not believe this is something we support at the moment. The reason being that the template system assumes that a template is always being applied to a vector layer.

However, looking at the implementation of GetFeatureInfo it seems that for coverages a FeatureType is "faked", so applying a template to it would be possible... although i am not sure how much sense it would make.

That seemed to be the most sensible approach at the time. Of course
I'm open to suggestions.
What would you expect from a GetFeatureInfo against a coverage?
Is it the semantic part that sounds odd (grabbing the band values) or
the technical aspect (using a feature to avoid re-writing all the GetFeatureInfo output formats specifically for coverage) that is raising eyebrowses?
Any alternative proposal?

Cheers
Andrea

Chris Holmes ha scritto:

What I believe to be a bit more of the 'correct' way to get feature and coverage data is to use the appropriate OGC service, WFS for vector and WCS for raster. GetFeatureInfo is a bit funky with things like the html output, since it depends on the server rendering it some way that's never standard. So I think the more interoperable way is to get at the data directly, and choose on the client side how to style it.

Of course I concede it's nice for the server side to apply styles, it can make things easier for. But yeah, the uber correct way would be to do a WCS GetCoverage call to get the raster values, which gives you a lot of control over how to request it, and then on the client use some javascript to insert it in to the right html elements to make it look the way you want.

There's a catch thought... WCS does not support any output that a javascript client could parse (not structured output text formats).

So I guess for the moment adding customization to the GetFeatureInfo
template is the easiest way. What you get now is that the "bands"
making up the image are faked up as attributes of a feature, this
is to leverage the existing infrastructure but also because
it's the most sensible "what's there" answer for a coverage.
Works especially well for DEM like coverages, of course getting
an answer that tells you the RGB components of a true color image
is not very useful but... if the coverage is a true color one,
what would you expect?

What we're really missing in GetFeatureInfo is a JSON output imho
that would allow javascript clients to do whatever they please
with the output. But there's a catch, that wouldn't be portable
across OGC servers. Well, of course Christofer can use the GML2
output of GetFeatureInfo instead, that's one of the formats suggested
by the standard (and one of the reasons we have to turn Coverage
feature info into a fake feature, since that's the only
thing that is encodable into GML2 at the moment).

Digressions aside, Christofer, I'm wondering what you really need.
If you just need to provide a different presentation for the
"band values" then a fix in the template subsystem is all you
need -> open a jira issue asking for that at jira.codehaus.org.
Cheers
Andrea

Christopher Condit ha scritto:

I’m looking for a way to customize the output from WMS getFeatureInfo called on coverages. It’s not clear where to put a custom content.ftl template for a raster layer, or if this is even supported. If not, what’s the preferred way to get the nearest point value of a raster from GeoServer?

And it seems that be specification the getFeatureInfo service is calculating the point value of the query point from the size of the image and pixel offset… Is there anyway just to pass in lat/long directly to a some sort of featureInfo call?

Yes, by spec it works only on pixels. WCS does not have a per pixel query method, GetCoverage would be able to return back a sub-coverage
within a certain bbox, but the catch is that the returned object
would be a GeoTiff or another supported output format.
We have none text based and parseable.

Is your client javascript based? (I made this assumption in my other
mail, now I realize you never stated that). If it's a full fledged
desktop app then you can probably open the GeoTiff and get the values
out of it, and thus GetCoverage becomes a viable way.

Cheers
Andrea

In this case, my raster is a DEM stored as a single band GeoTiff
(float32). So I'm not concerned with color bands at all. In fact, I'm
not even displaying the raster. I'm only using it to return data to the
user about elevation. The client is AJAX based, so I _could_ issue a WCS
request from the server, open the resulting raster, and get the value
I'm looking for but this seems like a lot of work. Might be easier use
some external library on the server side to respond to the query.
As to multiband, colored geotiffs, I think abstracting the bands as RGBA
attributes makes sense. If color value is tied to some scale then it
would be useful to grab that particular value and process it.

Thanks,
-Chris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Tuesday, April 29, 2008 04:22
To: Chris Holmes
Cc: Christopher Condit; geoserver-users@lists.sourceforge.net; Justin
Deoliveira
Subject: Re: [Geoserver-users] getfeatureinfo and coverages

Chris Holmes ha scritto:

What I believe to be a bit more of the 'correct' way to get feature

and

coverage data is to use the appropriate OGC service, WFS for vector

and

WCS for raster. GetFeatureInfo is a bit funky with things like the

html

output, since it depends on the server rendering it some way that's
never standard. So I think the more interoperable way is to get at

the

data directly, and choose on the client side how to style it.

Of course I concede it's nice for the server side to apply styles, it
can make things easier for. But yeah, the uber correct way would be

to

do a WCS GetCoverage call to get the raster values, which gives you a
lot of control over how to request it, and then on the client use some

javascript to insert it in to the right html elements to make it look
the way you want.

There's a catch thought... WCS does not support any output that a
javascript client could parse (not structured output text formats).

So I guess for the moment adding customization to the GetFeatureInfo
template is the easiest way. What you get now is that the "bands"
making up the image are faked up as attributes of a feature, this
is to leverage the existing infrastructure but also because
it's the most sensible "what's there" answer for a coverage.
Works especially well for DEM like coverages, of course getting
an answer that tells you the RGB components of a true color image
is not very useful but... if the coverage is a true color one,
what would you expect?

What we're really missing in GetFeatureInfo is a JSON output imho
that would allow javascript clients to do whatever they please
with the output. But there's a catch, that wouldn't be portable
across OGC servers. Well, of course Christofer can use the GML2
output of GetFeatureInfo instead, that's one of the formats suggested
by the standard (and one of the reasons we have to turn Coverage
feature info into a fake feature, since that's the only
thing that is encodable into GML2 at the moment).

Digressions aside, Christofer, I'm wondering what you really need.
If you just need to provide a different presentation for the
"band values" then a fix in the template subsystem is all you
need -> open a jira issue asking for that at jira.codehaus.org.
Cheers
Andrea

WCS is my weak area, but I was imagining there was a way to request just a single pixel and get the value. But it looks like you have to do a bounding box, and then I suppose you'd have to extract out the value, which I agree is too much of a bitch. So yeah, I guess GetFeatureInfo would be better, I'm pretty sure we recently got support for it in GeoSErver, let's see what Andrea says about templates for it.

Chris

Christopher Condit wrote:

In this case, my raster is a DEM stored as a single band GeoTiff
(float32). So I'm not concerned with color bands at all. In fact, I'm
not even displaying the raster. I'm only using it to return data to the
user about elevation. The client is AJAX based, so I _could_ issue a WCS
request from the server, open the resulting raster, and get the value
I'm looking for but this seems like a lot of work. Might be easier use
some external library on the server side to respond to the query.
As to multiband, colored geotiffs, I think abstracting the bands as RGBA
attributes makes sense. If color value is tied to some scale then it
would be useful to grab that particular value and process it.

Thanks,
-Chris

-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com] Sent: Tuesday, April 29, 2008 04:22
To: Chris Holmes
Cc: Christopher Condit; geoserver-users@lists.sourceforge.net; Justin
Deoliveira
Subject: Re: [Geoserver-users] getfeatureinfo and coverages

Chris Holmes ha scritto:

What I believe to be a bit more of the 'correct' way to get feature

and

coverage data is to use the appropriate OGC service, WFS for vector

and

WCS for raster. GetFeatureInfo is a bit funky with things like the

html

output, since it depends on the server rendering it some way that's never standard. So I think the more interoperable way is to get at

the

data directly, and choose on the client side how to style it.

Of course I concede it's nice for the server side to apply styles, it can make things easier for. But yeah, the uber correct way would be

to

do a WCS GetCoverage call to get the raster values, which gives you a lot of control over how to request it, and then on the client use some

javascript to insert it in to the right html elements to make it look the way you want.

There's a catch thought... WCS does not support any output that a javascript client could parse (not structured output text formats).

So I guess for the moment adding customization to the GetFeatureInfo
template is the easiest way. What you get now is that the "bands"
making up the image are faked up as attributes of a feature, this
is to leverage the existing infrastructure but also because
it's the most sensible "what's there" answer for a coverage.
Works especially well for DEM like coverages, of course getting
an answer that tells you the RGB components of a true color image
is not very useful but... if the coverage is a true color one,
what would you expect?

What we're really missing in GetFeatureInfo is a JSON output imho
that would allow javascript clients to do whatever they please
with the output. But there's a catch, that wouldn't be portable
across OGC servers. Well, of course Christofer can use the GML2
output of GetFeatureInfo instead, that's one of the formats suggested
by the standard (and one of the reasons we have to turn Coverage
feature info into a fake feature, since that's the only
thing that is encodable into GML2 at the moment).

Digressions aside, Christofer, I'm wondering what you really need.
If you just need to provide a different presentation for the
"band values" then a fix in the template subsystem is all you
need -> open a jira issue asking for that at jira.codehaus.org.
Cheers
Andrea

!DSPAM:4005,481721d4302161030819293!

Chris Holmes ha scritto:

WCS is my weak area, but I was imagining there was a way to request just a single pixel and get the value. But it looks like you have to do a bounding box, and then I suppose you'd have to extract out the value, which I agree is too much of a bitch. So yeah, I guess GetFeatureInfo would be better, I'm pretty sure we recently got support for it in GeoSErver, let's see what Andrea says about templates for it.

Adding custom templating support for coverages as well should be easy.
Christopher, can you open a jira issue with this request?

Or course this will help only if you can accept HTML as a result.
Cheers
Andrea