[Geoserver-users] How to limit Geoserver GetfeatureInfo number of features?

Dear Team,

I am trying to customize the ftl file to only show the first feature value on click. Here is what I have done. I was able to limit the output to one class but not the features.

<#list features as feature>

  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>

     <li class="featurelist" style="display:none;">${feature.overall_vu.value}</li>

     <#break>

    </#if>
  </#list>
</#list>

The reason I did display none is to then show the first list item using jquery. But a more elegant solution will be to limit it by index, something like this ${feature.overall_vu.value[0]}
but doesn’t work.Is there any method to achieve it?

Thanks!

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea

···

On Sat, Jul 11, 2015 at 8:02 AM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

Dear Team,

I am trying to customize the ftl file to only show the first feature value on click. Here is what I have done. I was able to limit the output to one class but not the features.

<#list features as feature>

  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>

     <li class="featurelist" style="display:none;">${feature.overall_vu.value}</li>

     <#break>

    </#if>
  </#list>
</#list>

The reason I did display none is to then show the first list item using jquery. But a more elegant solution will be to limit it by index, something like this ${feature.overall_vu.value[0]}
but doesn’t work.Is there any method to achieve it?

Thanks!


Don’t Limit Your Business. Reach for the Cloud.
GigeNET’s Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/


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

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


I made the change from the original 50 to 1 but still I get more than one features.

···

On Sat, Jul 11, 2015 at 3:32 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea

On Sat, Jul 11, 2015 at 8:02 AM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

Dear Team,

I am trying to customize the ftl file to only show the first feature value on click. Here is what I have done. I was able to limit the output to one class but not the features.

<#list features as feature>

  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>

     <li class="featurelist" style="display:none;">${feature.overall_vu.value}</li>

     <#break>

    </#if>
  </#list>
</#list>

The reason I did display none is to then show the first list item using jquery. But a more elegant solution will be to limit it by index, something like this ${feature.overall_vu.value[0]}
but doesn’t work.Is there any method to achieve it?

Thanks!


Don’t Limit Your Business. Reach for the Cloud.
GigeNET’s Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/


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

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Can you capture the GetFeatureInfo request you’re doing (the exact URL) and share it with
the list?

Cheers
Andrea

···

On Sat, Jul 11, 2015 at 5:00 PM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

I made the change from the original 50 to 1 but still I get more than one features.

On Sat, Jul 11, 2015 at 3:32 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea

On Sat, Jul 11, 2015 at 8:02 AM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

Dear Team,

I am trying to customize the ftl file to only show the first feature value on click. Here is what I have done. I was able to limit the output to one class but not the features.

<#list features as feature>

  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>

     <li class="featurelist" style="display:none;">${feature.overall_vu.value}</li>

     <#break>

    </#if>
  </#list>
</#list>

The reason I did display none is to then show the first list item using jquery. But a more elegant solution will be to limit it by index, something like this ${feature.overall_vu.value[0]}
but doesn’t work.Is there any method to achieve it?

Thanks!


Don’t Limit Your Business. Reach for the Cloud.
GigeNET’s Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/


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

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


How could I get the url?

Thanks

···

On Sat, Jul 11, 2015 at 7:45 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Can you capture the GetFeatureInfo request you’re doing (the exact URL) and share it with
the list?

Cheers

Andrea

On Sat, Jul 11, 2015 at 5:00 PM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

I made the change from the original 50 to 1 but still I get more than one features.

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


On Sat, Jul 11, 2015 at 3:32 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea

On Sat, Jul 11, 2015 at 8:02 AM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

Dear Team,

I am trying to customize the ftl file to only show the first feature value on click. Here is what I have done. I was able to limit the output to one class but not the features.

<#list features as feature>

  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>

     <li class="featurelist" style="display:none;">${feature.overall_vu.value}</li>

     <#break>

    </#if>
  </#list>
</#list>

The reason I did display none is to then show the first list item using jquery. But a more elegant solution will be to limit it by index, something like this ${feature.overall_vu.value[0]}
but doesn’t work.Is there any method to achieve it?

Thanks!


Don’t Limit Your Business. Reach for the Cloud.
GigeNET’s Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/


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

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi,
it depends on how you wrote the client issuing the GetFeatureInfo
request. Assuming you’re developing some kind of browser based client
using OpenLayers or any similar JS library, you can inspect the request
using the browser’s developer tools.
For example, on Google Chrome, hit F12 to open up the dev tools and
click on the network panel to see the log of the HTTP requests done by
your application as you pan/zoom/click the map.
Dev tools documentation is here:
https://developer.chrome.com/devtools/docs/network#network-panel-overview

Hope this helps.

Best regards,
Stefano Costa

···

On Sat, Jul 11, 2015 at 7:45 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Can you capture the GetFeatureInfo request you’re doing (the exact URL) and share it with
the list?

Cheers

Andrea

On Sat, Jul 11, 2015 at 5:00 PM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

I made the change from the original 50 to 1 but still I get more than one features.

On Sat, Jul 11, 2015 at 3:32 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea

Thank you Stefano, I was tied with another issue. I will try your suggestion and report back soon.

···

On Mon, Jul 13, 2015 at 11:26 AM, stefano.costa <stefano.costa@anonymised.com> wrote:

Hi,
it depends on how you wrote the client issuing the GetFeatureInfo
request. Assuming you’re developing some kind of browser based client
using OpenLayers or any similar JS library, you can inspect the request
using the browser’s developer tools.
For example, on Google Chrome, hit F12 to open up the dev tools and
click on the network panel to see the log of the HTTP requests done by
your application as you pan/zoom/click the map.
Dev tools documentation is here:
https://developer.chrome.com/devtools/docs/network#network-panel-overview

Hope this helps.

Best regards,
Stefano Costa

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.

Dott. Stefano Costa
Senior Software Engineer

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

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


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate.
Il loro utilizzo è consentito esclusivamente al destinatario del
messaggio, per le finalità indicate nel messaggio stesso. Qualora
riceviate questo messaggio senza esserne il destinatario, Vi preghiamo
cortesemente di darcene notizia via e-mail e di procedere alla
distruzione del messaggio stesso, cancellandolo dal Vostro sistema.
Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità
diverse, costituisce comportamento contrario ai principi dettati dal
D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely
for the attention and use of the named addressee(s) and may be
confidential or proprietary in nature or covered by the provisions of
privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New
Data Protection Code).Any use not in accord with its purpose, any
disclosure, reproduction, copying, distribution, or either
dissemination, either whole or partial, is strictly forbidden except
previous formal approval of the named addressee(s). If you are not the
intended recipient, please contact immediately the sender by
telephone, fax or e-mail and delete the information in this message
that has been received in error. The sender does not give any warranty
or accept liability as the content, accuracy or completeness of sent
messages and accepts no responsibility for changes made after they
were sent or for other risks which arise as a result of e-mail
transmission, viruses, etc.

Da: “Wondimagegn Tesfaye” wondim81@anonymised.com
A: “Andrea Aime” andrea.aime@anonymised.com
Cc: “geoserver-users” Geoserver-users@lists.sourceforge.net
Data: Sat, 11 Jul 2015 20:04:09 +0300
Oggetto: Re: [Geoserver-users] How to limit Geoserver GetfeatureInfo number of features?

How could I get the url?

Thanks

On Sat, Jul 11, 2015 at 7:45 PM, Andrea Aime <andrea.aime@anonymised.com.> wrote:

Can you capture the GetFeatureInfo request you’re doing (the exact URL) and share it with
the list?

Cheers

Andrea

On Sat, Jul 11, 2015 at 5:00 PM, Wondimagegn Tesfaye <wondim81@anonymised.com> wrote:

I made the change from the original 50 to 1 but still I get more than one features.

On Sat, Jul 11, 2015 at 3:32 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

GetFeatureInfo has a request parameter called FEATURE_COUNT which controls how many features you get back.
If not set it defaults to 1, but it’s explicitly set to 50 in the GeoServer layer preview.

Cheers
Andrea