1

I have a simple application that uses OpenLayers 2.13.1 to draw GML data pasted in a text box. There is already some default GML preloaded in textarea and it works fine. When you press "Add feature" button, it draws polygons on the map.

GitHub link: https://github.com/mleontenko/OpenLayers2-DrawGML/blob/develop/index.html

Now, I have some other GML data that i get with WMS GetFeatureInfo request. It looks like this: https://raw.githubusercontent.com/mleontenko/gml/master/croatia.gml

But this new GML doesn't draw visible polygons on map. Does anyone know why? And, what do i need to do to draw this GML correctly?

  • 1
    Two things that might be an issue. #1 The GML from the GetFeatureInfo response has a null for the gml:boundedBy content. #2 The projections between your examples is different. The GetFeatureInfo version returns coordinates as EPSG::3857, the first does not. – nmtoken May 17 '17 at 19:22
  • I'm using GeoServer to serve WMS layer and i get this GML data that doesn't work with WMS GetFeatureInfo request. Can i somehow change settings in GeoServer to get data that works? – Marin Leontenko May 18 '17 at 8:09
  • Thanks for your help. I managed to solve this. The problem was in coordinates. I transformed source file to EPSG:4326, loaded it to PostGIS database again and set CRS in GeoServer to EPSG:4326. Now i get lon/lat coordinates instead of metric with GetFeatureInfo. – Marin Leontenko May 18 '17 at 13:20

Your Answer

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

Browse other questions tagged or ask your own question.