Sometimes you have access to data through a WMS service, but you want the data as vector features. In this post I show how to extract vector features from a WMS layer using ArcGIS Desktop.
- Before extracting polygons from a WMS please make sure you are allowed to do this, e.g. by checking the WMS provider’s website for terms and conditions, or contact them. Many WMS do not allow you to create derivative data.
- This procedure extracts feature geometry only, not attribute data.
- This procedure only works for binary data (data with a yes/no classification, e.g. areas that are flooded vs areas that are not flooded). If your WMS data has more than two classes this procedure does not work.
In this example my WMS layer contains polygons. The process for polylines is similar.
- Load a basemap and your WMS layer into ArcMap
- Switch all layers off except the WMS layer
- Make sure you are in Data View, not Layout View (Menu > View > Data View).
- Export the data frame (Menu > File > Export Map) with these options:
- Save as type: PNG
- Create world file: yes
- Format: 1 bit monochrome, threshold 256
- Load the resulting PNG into ArcMap (Menu > File > Add Data). It should show as a black and white image and align correctly with the WMS and other layers.
- Vectorize the PNG with ArcScan:
- Create two new empty feature classes, one polygon and one polyline. These will contain the vectorized features. You can create these as Geodatabase feature classes or Shapefiles. They have to be in the same Geodatabase or folder, respectively.
- Load both feature classes into ArcMap
- Switch to editing mode. In case you are asked which feature class to edit, select the new polygon class.
- Enable the ArcScan extension and the ArcScan toolbar
- In the ArcScan toolbar go to Vectorization > Options. Set ‘Outline’. Make sure the Foreground color is set to the color of the areas you want to vectorize. (Click Toggle Colors to change).
- Click Vectorization > Generate Features. In the new window select in which (polygon and line) feature classes to store the vectorization result. Click OK.
- Now ArcGIS vectorizes the raster and creates vector features in the specified feature class.
- When it is done, click Editor > Stop Editing and save the new features.