<p dir="ltr">Jack, <br>
The GDALPolygonize algorithm draws the polygon edges along the pixel edges. It assumes the pixels to be rectangular areas instead of points.<br>
In the example you described, the first polygon should contain four vertices with the pixel in the centre.<br>
Make sure that the program you are using to display them is not shifting the pixels.<br>
</p>
<div class="gmail_quote">On 20 Aug 2014 07:12, "John Twilley" <<a href="mailto:mathuin@gmail.com">mathuin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am trying to use GDAL's polygonize algorithms to help me identify<br>
regions in landcover data. I made a trivial example, but I am having<br>
trouble understanding the results that I get, nor can I determine how<br>
to get the results I want.<br>
<br>
Given the following raster:<br>
<br>
11 11 11 11 11<br>
11 11 11 11 11<br>
11 11 12 11 11<br>
11 11 11 11 11<br>
11 11 11 11 11<br>
11 11 11 11 11<br>
<br>
If I were to polygonize this raster, I would expect two polygons: one<br>
which contains the single point 12, and another with an outer ring was<br>
the perimeter of the raster and an inner ring circling the single<br>
point 12. I would also expect that the first polygon would contain<br>
the single point 12 and that the second polygon would contain all the<br>
points 11.<br>
<br>
Instead, what I got was a polygon starting from the single point 12<br>
and extending down and to the right one pixel, and another polygon<br>
with an outer ring that went off the down and right edges and an inner<br>
ring equal to the first polygon's outer ring. The first polygon<br>
doesn't actually contain any points and the second one doesn't contain<br>
any points on either ring but does contain all the other points.<br>
<br>
What do I need to do to get the results I am expecting?<br>
<br>
Jack.<br>
--<br>
mathuin at gmail dot com<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>