Thursday 15 February 2018

qgis - Identify Polygons on raster image


I have OS street view mapping as raster images. Is it possible (without the obvious of tracing each dwelling) to identify all polygons on each tile.


To clarify,


My ultimate aim is to produce a shapefile layer of polygons for each component....particularly dwellings in order to create a 260m buffer around each which is easy done.



Using QGIS



Answer



It is possible but the polygons are a little ragged, see the attached picture. Street View images are (single-band) indexed TIFFs. Using the raster value tool told me that the pixel value for buildings was 204 and I used this value in the Raster Calculator to make a new TIFF in which all of the pixels in the image having a value of 204 were converted to ones and all of the pixels in the image having a value not equal to 204 were converted to zeros. The expression to do this is 'filename@1 = 204' (without the quotes).


It was then simply a matter of polygonising the new TIF: Raster -> Conversion -> Polygonize (Raster to vector).


In the picture I've overlaid the original image with just the 'buildings' polygons.


Low-down dirty stuff really.


Nick.


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...