I am trying to vectorize a raster whose digital numbers indicate different classes they belong to. ArcGIS and QGIS yield similar results: separate shapes out of pixels sharing the class that are adjacent only diagonally. In this sense, this question is related with this one and also this one.

I tried the suggestions posted in those questions, but none of them worked for me. I can not use the buffering-approach because my polygons refer to networks of areas; the connectivity/topology of those networks must remain intact, and I have nodes very close to each other. Dissolve is not useful either; it apparently does not work on polygons sharing a single vertex.

ILWIS could solve the issue:

I found that the vectorization tool of ILWIS (see explanation here) has an option for scanning for the 8 neighboring pixels during the targeting of each raster pixel to a polygon. ILWIS calls it "Output map 8-connected with smoothing". This might solve the issue by avoiding the polygon breakage during the vectorization when input pixels are placed diagonally.

I downloaded and installed the ILWIS version available here. However, after importing the raster I want to vectorize (I used the built-in GDAL option), the drop-down menu to select the input layer in the 'Raster to Polygon' tool does not allow me to select anything and thus I can not use the tool.

Does somebody know how to use this ILWIS' tool, or how to solve this problem?

  • so when you say "the connectivity/topology of those networks must remain intact", you mean that two (for example) adjacent cells from the same class should not be discrete polygon features with the same attribution in the output, but be a single polygon feature with perhaps a very small passage at the corners of the two cells?
    – Roland
    Commented Jan 28, 2014 at 18:08
  • Yes, that is what I want to get: a single polygon for each class. It would be fine if the shape of the resulting polygons does not exactly follow the contour of the source-pixels.
    – Jaqo
    Commented Jan 28, 2014 at 19:16
  • okay. that helps. how about your stated need for connectivity/topology? Could it be that you're able to derive information for all polygons with a common class and then summarize based on class? Or is it that you want summary stats for all contiguous instances of polygons in a class?
    – Roland
    Commented Jan 28, 2014 at 19:19
  • Both of your suggestions are useful workarounds. Thanks for that! The ideal situation would be to let the geometries tell the numbers directly though, without extra-joining tasks. I need the polygons for basic graph-theory analysis, and for zonal statistics or spatial joining. <br><br>The diagonally adjacent polygons I am obtaining share classes in their 'grid-code' field. I was wondering if: 1) there is a way to construct multipolygons (polygons made of isles) out of those grid_code-sharing polygons, and 2) whether this useful the ArcGIS' or QGIS' spatial joining options. What do you think?
    – Jaqo
    Commented Jan 29, 2014 at 10:21
  • I'll respond in an answer below.
    – Roland
    Commented Jan 29, 2014 at 17:39

2 Answers 2


If you are after a network, I suggest that you use "raster to polyline" instead of raster to polygon. Once the lines are created, you can still create buffer around those lines in order to recover the polygons. The raster can be clean using "thin" before you convert it.

EDIT: feature to line gives you the connectivity. Then you can create a small buffer (1/4 pixel, e.g.) around your lines, and "update" your "raster to polygon" results with the buffer. (rem: if you don't have arcinfo, you get the same as update by combining union and dissolve).

  • Thanks for your support. I am working on a network of interconnected areas: this is a network of subcatchments. Most of those areas are more than one pixel-width, while some others are as narrow as one pixel-width. When the latter are placed diagonally, they can not be properly converted to polygons. As I am working with areas, not with lines, I cannot use raster to polyline.
    – Jaqo
    Commented Jan 28, 2014 at 11:27

I'm thinking that your graph theory-type analysis is driven by the category attributes, plus by adjacency. What you're asking about doesn't sound like true topology, so although you might in fact be able to engineer something with a Topology class or another technique, it would probably be more complicated than it's worth. I recommend using a "case item" as in the Statistics_analysis function.

To be able to run stats on just adjacent patches of cells with the same category, you can run RegionGroup.

If you are indeed able to run your analysis on the basis of attributes/relational tables, then you can avoid the vectorization process in your workflow altogether, which would be nice since it sounds like an inconvenience that doesn't add substance to your analysis.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.