Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a Geoserver postgis layer with multiple point features on the same location. GetFeatureInfo returns results when only one feature is found.

But Geoserver returns nothing (empty html) when several Features with different can be found. However, Geoserver's log does not note any errors.

Features have a unique gid which is primary key in the underlying postgis table.

Here is the content-section of the freemarkers template:

<div style="font-family: Arial;padding-top:10px;padding-bottom:10px;padding-left:10px;padding-right:10px">
<#list features as feature>
  <#list feature.attributes as attribute>
    <#if !attribute.isGeometry>
      <#if attribute.name == "info_name">
        <#assign info_name = attribute.value>
      </#if>
      <#if attribute.name == "info_adr1">
        <#assign info_adr1 = attribute.value>

      </#if>
      <#if attribute.name == "info_adr2">
        <#assign info_adr2 = attribute.value>

      </#if>
      <#if attribute.name == "info_tel">
        <#assign info_tel = attribute.value>
      </#if>
      <#if attribute.name == "info_kategorie">
        <#assign info_kategorie = attribute.value>
      </#if>
       <#if attribute.name == "description">
        <#assign description = attribute.value>
       </#if>
      <#if attribute.name == "info_url">
        <#assign info_url = attribute.value>
        <#if (info_url!?length > 0)>
            <#assign link = "<a href=\"http://${info_url}\" target=\"_blank\">Homepage</a>">
        </#if>
      </#if>
    </#if>
  </#list>
<b><h2>${info_name}</h2></b>
<#if (info_adr1!?length >0)>
    ${info_adr1}  <br />
</#if>
<#if (info_adr2!?length >0)>
    ${info_adr2}  <br />    
</#if>
<#if (info_tel!?length >0) >
    ${info_tel} <br />
</#if>
<#if (description!?length > 0) >
    ${description}  <br />
</#if>
<#if (link!?length > 0) >
    Link: ${link}   
</#if>      
</#list>
</div>
share|improve this question
1  
Is this a custom freemarkers template? If yes what happens when you don't use it, or use a different template? Do you get a different result if you change your layer's symbology? –  tomfumb Feb 19 '13 at 18:21
add comment

1 Answer

I'm pretty sure GetFeaturInfo can return more than one feature, the GeoServer preview returns up to 50 features located in the vicinity of where you clicked.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.