I use OpenLayers 4.6 and I want to read a feature from GML string. The GML looks like:
<?xml version="1.0" encoding="UTF-8"?>
<gml:Polygon xmlns:gml="http://www.opengis.net/gml"
xmlns:sch="http://www.ascc.net/xml/schematron"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xs="http://www.w3.org/2001/XMLSchema" srsDimension="2">
<gml:exterior>
<gml:LinearRing srsDimension="2">
<gml:posList>37.15 36.15 37.15 36.3 37.5 36.3 37.5 36.15 37.15 36.15</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
I know that I need to specify the featureNS
and featureType
to read the feature using ol.format.GML3, but I don't know how to set them properly:
let feature = new ol.format.GML3({
srsName: 'EPSG:4326',
featureType: '???',
featureNS: '???'
}).readFeatures(data);
Any help will be appreciated. Regards.