[MapServer-users] GetFeatureInfo from VRT COG stack
Eloi Ribeiro
mail at eloiribeiro.eu
Wed Apr 23 08:42:11 PDT 2025
Okay, I managed get all the values by making the template file like so:
<!-- MapServer Template -->
{
"CORGADBAU": [value_0],
"CORGADSSM1": [value_1],
"CORGADSSM2": [value_2],
"CORGADSSM3": [value_3],
"CORGASRBAU": [value_4],
"CORGASRSSM1": [value_5],
"CORGASRSSM2": [value_6],
"CORGASRSSM3": [value_7],
"CORGRDSSM1": [value_8],
"CORGRDSSM2": [value_9],
"CORGRDSSM3": [value_10],
"CORGRSRSSM1": [value_11],
"CORGRSRSSM1U": [value_12],
"CORGRSRSSM2": [value_13],
"CORGRSRSSM2U": [value_14],
"CORGRSRSSM3": [value_15],
"CORGRSRSSM3U": [value_16],
"CORGSOCBAU": [value_17],
"CORGSOCSSM1": [value_18],
"CORGSOCSSM2": [value_19],
"CORGSOCSSM3": [value_20],
"CORGSSMU": [value_21],
"CORGT0": [value_22]
}
Regards,
Eloi
On Wednesday, April 23rd, 2025 at 12:31, Eloi Ribeiro via MapServer-users <mapserver-users at lists.osgeo.org> wrote:
> Indeed, the gdallocationinfo was returning just one value. After rebuilding the VRTs with the -separate flag, it now returns all values. Great, thanks!
>
> Now I need to fix the GetFeatureInfo, it still returns one value. I guess I need to change my getfeatureinfo template file. I'm not sure how. Any clues?
>
> Kind regards,
>
> Eloi
>
>
>
>
>
>
> On Tuesday, April 22nd, 2025 at 19:50, Scott via MapServer-users mapserver-users at lists.osgeo.org wrote:
>
> > If you do a gdallocationinfo on your .vrt using lon/lat, does it give
> > all values or just one?
> >
> > If you only get one value, you may need specify that they are individual
> > COGs. Using gdalbuildvrt that may look like:
> >
> > gdalbuildvrt -separate mycogs.vrt /path/to/cogs/*.tif
> >
> > I'm not sure how that will translate to getFeatureInfo, but it ensures
> > your .vrt is correctly made.
> >
> > On 4/22/25 08:03,
> >
> > Eloi
> >
> > Ribeiro via MapServer-users wrote:
> >
> > > Dear all,
> > >
> > > I have a stack of COG files that fully overlap, with the same extent,
> > > EPSG and size.
> > > I have created a VRT https://cloud.eloiribeiro.eu/s/WtKgesFJCHnYSCQ,
> > > mapfile https://cloud.eloiribeiro.eu/s/sCoqeWaLq6eSKqA and
> > > getfeatureinfo template https://cloud.eloiribeiro.eu/s/35Z2e8nkifnoC6w.
> > > The goal is to get the pixel value from all layers (COG files) in the
> > > VRT in one go with a GetFeatureInfo request. Is this even possible? For
> > > now I only get the value of the first layer. The response looks like this: /
> > > Layer: PH-GSOC Coords: 120.85598, 15.638156 Value: 37.550686/.
> > >
> > > What I need to do in order to get the values from all layers, instead of
> > > only the first one?
> > >
> > > Kind regards,
> > >
> > > Eloi
> > >
> > > _______________________________________________
> > > MapServer-users mailing list
> > > MapServer-users at lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> > _______________________________________________
> > MapServer-users mailing list
> > MapServer-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list