Hi Mark,
Thanks for your response.
OK, pixels don't have an ID but I meant to identify the response with the
request. The example was with 4 layers, but the idea is that it can be 'n'
layers requested so I get 'n' values in the same response so I need a way to
match the value and the layer requested.
This is the response in json format
{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":11735}}
{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":15902}}
{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":16547}}
In this response I can't match the value with layer directly. There's no way.
But, if I do the same request, talking about more than 1 layer in the same
request, but using application/vnd.ogc.gml I get a GML file in which I have the
value linked to the layer name:
<gml:featureMember>
<TELEDETEKZIOA:S2A_20170512T111302456Z_NDVI fid="">
<TELEDETEKZIOA:GRAY_INDEX>11735.0</TELEDETEKZIOA:GRAY_INDEX>
</TELEDETEKZIOA:S2A_20170512T111302456Z_NDVI>
</gml:featureMember>
<gml:featureMember>
<TELEDETEKZIOA:S2A_20170422T111300457Z_NDVI fid="">
<TELEDETEKZIOA:GRAY_INDEX>15902.0</TELEDETEKZIOA:GRAY_INDEX>
</TELEDETEKZIOA:S2A_20170422T111300457Z_NDVI>
</gml:featureMember>
So in each featureMember I get a tag with the Workspace:Layername. That's why I
was asking..
Thanks.
Agur bero bat,
David Alda Fernández de Lezea
Área de Sistemas de Información Geográfica, Planificación Territorial y
Forestal Informazio Geografikoen Sistemak, Lurralde eta Baso Antolaketaren
Arloa.
[email protected] | www.hazi.eus
T 945 003 240 – M 627 923 170 – F 945 003 290
Hazi | Granja Modelo de Arkaute s/n | 01192 Arkaute – Araba
********************* LEGE OHARRA ******************* AVISOLEGAL
******************* DISCLAIMER *****************************
Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabilera debekatua
dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta kontserbatu gabe.
Este mensaje es personal y confidencial y su uso no autorizado está prohibido
legalmente. Si usted no es el destinatario, proceda a borrarlo, sin reenviarlo
ni conservarlo.
This message is personal and confidential, unauthorised use is legally
prohibited. If you are not the intended recipient, delete it without resending
or backing it.
-----Mensaje original-----
De: Mark Prins [mailto:[email protected]]
Enviado el: martes, 23 de mayo de 2017 10:47
Para: [email protected]
Asunto: Re: [Geoserver-users] GetFeatureInfo JSON issues
On 23-05-17 09:49, David Alda Fernandez de Lezea wrote:
> Hello,
>
> I'm trying to perform a GetFetureInfo request over several raster
> layers to build some charts. I'm setting de INFO_FORMAT parameter to
> application/json and I'm getting
>
> {"type":"FeatureCollection","totalFeatures":"unknown","features":[
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":11735}},
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":11399}},
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":10563}},
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":14560}},
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":15902}},
>
> {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":1
> 6138}}
> ],"crs":null}
>
> My questions are:
>
> How can I get the ID of each feature?
I don't think pixels have an id or a geometry, they are not actually features
It would be great to have the layer name there to identify the requested layer
and the returned value..
but you already now the layer because you have just requested data from it?...
Just like if the INFO_FORMAT is application/vnd.ogc.gml
the gml does not provide the layername and if you look closely does not provide
a fid or a geometry, so the behaviour is the same for both types of response.
>
> <?xml version="1.0" encoding="UTF-8"?><wfs:FeatureCollection
> xmlns="http://www.opengis.net/wfs"
> xmlns:wfs="http://www.opengis.net/wfs"
> xmlns:TELEDETEKZIOA="http://geoserver.hazi.eus/satimagery"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://geo.hazi.eus/schemas/wfs/1.0.0/WFS-basic.xsd"><gml:boundedBy><g
> ml:Box
> srsName="http://www.opengis.net/gml/srs/epsg.xml#25830"><gml:coordinat
> es xmlns:gml="http://www.opengis.net/gml" decimal="." cs="," ts="
> ">-1,-1
> 0,0</gml:coordinates></gml:Box></gml:boundedBy><gml:featureMember><TEL
> EDETEKZIOA:S2A_20170512T111302456Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>11735.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170512T111302456Z_NDVI></gml:featureMember><gml:fea
> tureMember><TELEDETEKZIOA:S2A_20170509T110556093Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>11399.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170509T110556093Z_NDVI></gml:featureMember><gml:fea
> tureMember><TELEDETEKZIOA:S2A_20170502T110937275Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>10563.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170502T110937275Z_NDVI></gml:featureMember><gml:fea
> tureMember><TELEDETEKZIOA:S2A_20170429T110525766Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>14560.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170429T110525766Z_NDVI></gml:featureMember><gml:fea
> tureMember><TELEDETEKZIOA:S2A_20170422T111300457Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>15902.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170422T111300457Z_NDVI></gml:featureMember><gml:fea
> tureMember><TELEDETEKZIOA:S2A_20170419T110601310Z_NDVI
> fid=""><TELEDETEKZIOA:GRAY_INDEX>16138.0</TELEDETEKZIOA:GRAY_INDEX></T
> ELEDETEKZIOA:S2A_20170419T110601310Z_NDVI></gml:featureMember></wfs:Fe
> atureCollection>
>
> I've made a test with Freemarker templates but it doesn't change anything in
> the response. Templates are for text/html only or do they work with other
> INFO_FORMAT values?
>
> Thanks in advance
>
> Regards,
> Agur bero bat,
>
>
> David Alda Fernández de Lezea
> Área de Sistemas de Información Geográfica, Planificación Territorial y
> Forestal Informazio Geografikoen Sistemak, Lurralde eta Baso Antolaketaren
> Arloa.
> [email protected] | www.hazi.eus
> T 945 003 240 - M 627 923 170 - F 945 003 290 Hazi | Granja Modelo de
> Arkaute s/n | 01192 Arkaute - Araba
>
> ********************* LEGE OHARRA ******************* AVISOLEGAL
> ******************* DISCLAIMER *****************************
> Mezu hau pertsonala eta isilpekoa da eta baimenik gabeko erabilera debekatua
> dago legalki. Jasotzailea ez bazara ezabatu mezua, bidali eta kontserbatu
> gabe.
> Este mensaje es personal y confidencial y su uso no autorizado está prohibido
> legalmente. Si usted no es el destinatario, proceda a borrarlo, sin
> reenviarlo ni conservarlo.
> This message is personal and confidential, unauthorised use is legally
> prohibited. If you are not the intended recipient, delete it without
> resending or backing it.
>
>
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech
sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users