4

I have for now just used the standard Get Feature Template in the documentation. The first example should make all the returned data format into bullets instead of little tables. For some reason my middle returned feature still shows as a table. And it appears Geoserver is not using the template for this layer, visible from the 333 I typed at the end of the feature.type. Any suggestions to why GeoServer is not formatting the middle table? It must be a setting I am guessing.

All the info returned is coming from PostGIS views, the GeoServer has the same access rights to each view.

Update I had a play, and if I remove the content file from geoserver_data/templates and place it in geoserver_data/workspaces/<workpacename>/<store>/<layer> the template loads again for the first layer. However if I do the same for map_abundace_overview again the template is not applied. I did a search for tfl files and found the one i created and a couple under medford, which i renamed. Any suggestions?

                    <ul>
<#list features as feature>
  <li><b>Type333: ${type.name}</b> (id: <em>${feature.fid}</em>):
  <ul>
  <#list feature.attributes as attribute>
  <#if !attribute.isGeometry>
  <li>${attribute.name}: ${attribute.value}</li>
  </#if>
  </#list>
</ul>
</li>
</#list>
</ul> 

Get Feature Output

  • Where have you placed the custom template? – Devdatta Tengshe Oct 7 '13 at 15:31
  • In opengeo-suite-data/geoserver_data/templates @DevdattaTengshe I thought that is where templates that should cover all layers are placed? – Environment Oct 7 '13 at 15:31
  • I would assume that you have another template somewhere else which is overriding this template. I would just search for *.ftl in the opengeo-suite-data/geoserver_data/ directory to see if any other templates are present. – Devdatta Tengshe Oct 8 '13 at 2:52
  • I use client-side rendering, using a WFS getfeature request to get GeoJSON information, and setting it up in the UI of my mapping library (leaflet). Just thought I'd mention it here, as client-side is a more modern way of handling this kind of information, IMHO. – Alex Leith Feb 2 '15 at 3:03
1

Ok, after playing around lots. It is was the styling, my layer had 32 styles associated with it pending an attributes value between 0-32. Changing the layer style back to point allows the GetFeatureInfo template to be applied. I now have to figure out the layer styling again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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