Happy holidays (have you worked overtime this holiday? Pictures)! Today, the assistant will share about automated and semi-automated vector extraction. The software used is our commonly used software. The first is to use Global Mapper to automatically extract remote sensing images or vector base maps, and the second is to use ArcGIS semi-automatic vectorization to extract the vector outlines of ground objects based on the sky map vector base map. These two little tricks are quite interesting, and friends who have time can learn how to operate them.
Global Mapper
Automatic extraction of remote sensing images or vector basemaps
Let’s first talk about the principle of image extraction vector in Global Mapper. It is relatively simple and crude: directly extract the RGB pixels in the image, and then extract according to the pixel color, similar to Photoshop’s magic wand tool. Let’s take a look at how to operate in Global Mapper.
This test is to extract irregular water vectors from remote sensing images of 0.5.
Software: Global MapperV22 (this function is available after version 21)
Data: 0.5m remote sensing image
After searching around the image, we specifically found an irregular pond for testing.
layer→Create Area Features from Equal Values… in the Global Mapper menu bar
Maximum Match is set to 30 (this is similar to the tolerance in PS and can be set according to your own image conditions). Click Only Selected Color (S) to select the color of the extraction area.
Then click Area Bounds, select All Loaded Dat and draw the area you extracted.
Let’s see the effect.
Finally remove unnecessary vectors. You can select by area and select and delete them all with one click.
Look at the results at the end!
Of course, in addition to remote sensing images, vector maps are easier to extract.
With the same operation steps, the vector map operation will have better results. Let’s take a look at the extraction effect
After extraction, it can be directly exported to common vector formats such as .Shp/Kml, and finally combined with satellite images for post-effects.
ArcGIS
Semi-automatic vectorization to extract vector outlines of ground objects
1. Load vector basemap
Search the website for [Tian Map - Online Map].
Open the website, click the three stripes in the upper left corner -> Add layer, and select the vector basemap service.
Select the place you want to vectorize and use the screenshot tool to capture it. Why not use remote sensing images as the base map here? The main reason is that the pixels are too diverse and complex to be binarized.
2. Raster binarization
1. Change the symbology.
Load the screenshot into ArcMAP, right-click the layer and select Properties -> Symbology, and change the display mode from RGB synthesis to stretching.
2. Identify pixels.
Use the identification tool to explore the pixel values of different ground objects. Here, it is found that the pixel value of the building is 251 and the pixel value of the road is 253.
3. Class binary processing:
Use the reclassification tool to divide it into three categories: other features, buildings and roads. Click Classify to set the category and break value.
Tool location: Spatial Analyst Tools->Reclassification->Reclassification
Binarization should normally be two values, 0 and 1 respectively. Generally, 1 is the feature to be extracted, and 0 is other features. Here we also vectorize the road and set it to 3 values.
Comparatively speaking, the processing is very good, but if the original layer has a lot of annotations, it will greatly affect the processing.
3. Tool vectorization
1. Vectorize surface
: Call the raster to surface tool to convert the raster layer into a vector surface layer.
Observing the attribute table, you will find that the gridcode field records category information, where 0 is a building, 1 is other features, and 2 is a road.
If you carefully observe the layer, you will find that there are many small patches belonging to buildings. You can find them and delete them later.
You can use the identification tool to explore the area of the smallest building, and then use the selection by attribute tool to find patches that are smaller than this area and belong to the same building. Here, enter gridcode = 0 AND Shape_Area < 271 in the selection by attribute tool.
Open the editor, put it in editing mode, and delete it.
2. Vectorize lines.
Open the vector surface attribute table and use the selection by attribute tool to select the patches belonging to the road.
Call the feature conversion tool to convert the selected road patch into a vector line. It looks okay, but it is basically an extracted contour line.
4. ArcScan vectorization
1. Add ArcScan extension module.
To add ArcScan extension module, just click [Customize] on the top of the software, select [Extension Module], and check [ArcScan].
In addition to the ArcScan extension module, there are also other extension modules for network analysis, 3D analysis, etc. It is recommended to check them all. Maybe you will use a certain extension module when using the tool one day, but if it is not checked at this time, an error will most likely be reported when using the tool, and you will not know what the problem is.
2. Add ArcScan and editor toolbar
Right-click on a blank space in the toolbar and select ArcScan at the top and Editor in the upper middle in the pop-up menu bar.
3. Create a layer.
Create a point layer in the directory you want to store it in. If it is a normal folder, create a new ShapeFile. If it is a geodatabase, create a new feature class. Only the latter is introduced here.
Set the name and feature type on the first page. The author does not set the coordinate system on the second page, which is very troublesome [(* ̄3 ̄)╭]. All other pages can use the default options.
Two layers, vector surface and vector line, are registered here.
4. Binarization processing:
Layers that have been binarized like before cannot be used, and the tools on the ArcScan toolbar are all gray.
We can perform binarization based on the previous processing. Right-click the name of the previously reclassified result layer, select Properties -> Symbolism, change the display mode to [Classified], set the category to 2, and the color is random, personal feeling Set the building to black and the others to white to highlight the outline of the building. Click on the category to set the interrupt values to 0 and 1.
At this point, you can see that there is already a layer with the binary processing result on the toolbar, but the tool is still black. This is mainly because when vectorizing, you need to change the content of the vector layer, and you need to make the editor in the editing state. OK.
5. Vectorize
Put the editor in editing state.
Click [Vectorize] on the ArcScan toolbar and select [Options].
Set the vectorization method selection to Outline, the foreground color to black, and the background color to white.
Check Show Preview to preview the vectorization effect, and click Generate Elements to export to a vector layer.
When vectorizing roads, you need to reset the symbology and change the interrupt values to 1 and 2.
The vectorization option changes the vectorization method to center line, leaving everything else unchanged.
- END -