Convert a WMS layer to a vector Feature Class in ArcGIS

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.

Limitations:

  1. 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.
  2. This procedure extracts feature geometry only, not attribute data.
  3. 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.

  1. Load a basemap and your WMS layer into ArcMap
  2. Switch all layers off except the WMS layer
  3. Make sure you are in Data View, not Layout View (Menu > View > Data View).
  4. Export the data frame (Menu > File > Export Map) with these options:
    1. Save as type: PNG
    2. Create world file: yes
    3. Format: 1 bit monochrome, threshold 256
  5. 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.
  6. Vectorize the PNG with ArcScan:
    1. 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.
    2. Load both feature classes into ArcMap
    3. Switch to editing mode. In case you are asked which feature class to edit, select the new polygon class.
    4. Enable the ArcScan extension and the ArcScan toolbar
    5. 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).
    6. Click Vectorization > Generate Features. In the new window select in which (polygon and line) feature classes to store the vectorization result. Click OK.
    7. Now ArcGIS vectorizes the raster and creates vector features in the specified feature class.
    8. When it is done, click Editor > Stop Editing and save the new features.
Advertisements

13 thoughts on “Convert a WMS layer to a vector Feature Class in ArcGIS

  1. I’m still learning how to use ArcMap 10.1 the program, so the question is, where do I find the Export data frame tool/option/command? or is the Menu->File->Export Map the one I’m looking for?

  2. That didn’t work, sorry. Questions: Switch to editing for which shapefile (step 6.2)? What’s next after step 6.6? The instructions are not complete?

  3. I did use your updated method again for another project and this time it worked like a charm! Thank you.

    1. The message indicates that the coordinate system of the shapefile you are digitizing into is inconsistent with the coordinate system of the WMS layer, for example the shapefile’s system is wgs84 decimal degrees, and the WMS is a local system. This is where I’d start investigating, but can’t say more remotely.

    1. Hi, thanks for your comment. I am working in a different job now and do not have access to ArcGIS anymore, so I think the easiest way is you look up ‘create feature class’ in the ArGIS Help.

    1. My procedure is for creating vector data from a WMS layer, if you want a TIFF file from a WMS you would use a completely different approach, and that is a bit too complex for a quick explanation.

  4. Disculpa tengo una consulta la generación del vector solo es de la información que se despliega en la pantalla si quiero generar de toda la capa del WMS un shape como podría generarlo de manera directa.

    1. Yes, this method only converts the extent displayed on the screen. If you need the whole layer in vector format I suggest you contact the provider of the WMS layer and ask for the data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s