Thursday, 15 October 2015

geoserver - How to get column names of layer (WMS) using OpenLayers?


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:



SYSTEM 'http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_DescribeLayerResponse.dtd'>


name="topp:states"
owsType="WFS"
owsURL="http://localhost:8080/geoserver/wfs/WfsDispatcher?"
wfs="http://localhost:8080/geoserver/wfs/WfsDispatcher?">




Answer



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


http://yourserversurl/wfs?request=describeFeatureType&typename=topp:states


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...


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...