Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it somehow possible to get layer's column name using OpenLayers? any example and documentation would be really useful?

Edit: I have already tried WMS_describeLayer topp:states layer:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMS_DescribeLayerResponse
  SYSTEM 'http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_DescribeLayerResponse.dtd'>
<WMS_DescribeLayerResponse version="1.1.1">
        <Query typeName="topp:states"/>
share|improve this question
up vote 3 down vote accepted

You have to use WFS describeFeatureType request for the layer (typename in the request) to retrieve information about columns (feature attributes).


Since you asked how to make it with WMS I guess iant indicated how you can start from there. So first step is how to switch to wfs and for be able to do that you have to know the url of wfs. So DescribeLayer request can help there...

share|improve this answer

The WMS standard provides an optional DescribeLayer request which will provide you with the WFS URL and featureType(s) included in the layer. From that information you can construct a WFS getFeatureDescription request for the feature(s) and from that determine the column names.

OpenLayers may provide some tools for doing this but I've never seen them.

share|improve this answer
I can't see feature type or am I wrong somewhere? This edit is from demo Test Servlet. – kinkajou Sep 18 '12 at 8:17
<Query typeName="topp:states"/> – iant Sep 18 '12 at 8:23
so still confused .... – kinkajou Sep 18 '12 at 9:45
@iant Can you help retrieving ShapeFiles/GML from a WMS/WFS source please? – JJD Jan 27 '14 at 14:55

Your Answer


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.