1

I have a project where I load in different WMS layers. These layer consist of different colours that represent roofs, lawns, trees, roads,...

Users are able to draw polygons of the contours of their houses, lawns, driveways,... But is there a way to generate an approximation of these polygons using OpenLayers or maybe another Javascript image processing library?

I have done some research but I couldn't find anywhere if there is even the possibility of achieving this.

In the image below you see that the red represents roofs, gray stands for roads and green is lawn or bushes.

enter image description here

3
  • 1
    If the original data was drawn as polygons the WMS is possibly generating output from vector data, and if the service supports GetFeatureInfo info_format application/json or application/vnd.ogc.gml you could get the geometry with a GetFeatureInfo request as in codesandbox.io/s/getfeatureinfo-image-forked-y97h8 (use ol/format/WMSGetFeatureInfo for application/vnd.ogc.gml). You might also be a able to obtain data via a WFS request if the server supports that.
    – Mike
    Commented Jun 1, 2021 at 18:25
  • 1
    However if the WMS is serving raster data such as satellite imagery as in stackoverflow.com/questions/67554146/… you would need third party software to scan the image.
    – Mike
    Commented Jun 1, 2021 at 18:25
  • @Mike Thanks for helping me out! I will look into it!
    – Stephen
    Commented Jun 1, 2021 at 19:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.