Quickly get missing data in your shapefile fixed using QGIS
I spent a day working in QGIS to fix the missing layer in the shapefile. Follow the steps and treat yourself a day :) I am not a GIS person nor have i used QGIS extensively. The work was mostly search, try and test. Before I forget, here are the steps.
I see that region geojson is missing some data.
And i need is to patch that missing region.
Fortunately the missing part is a complete zone that’s available in another shapefile.
Here are the step-by-step instructions to merge the missing zone to the region in QGIS. I spent a day searching the internet, getting through the details, following what others has to say, explore on my own, try and try again. I am in no way a QGIS user or a GIS person, so I have used terms as i understand.
I spent few hours in old version of QGIS before i realize that some functionalities were having problems. Ensure that you have the latest version of QGIS.
Here’s my system used to fix this problem QGIS Version 2.8.1-Wien in MacOS X Yosemite V10.10
Layer > Add Layer > Add Vector Layer to import the shapefile data. I imported regions NPL_adm1 shapefile, which doesn’t contain chuck of data.
The missing data is visible. That’s the data we will be filling following this step by step process.
Next I imported zones NPL_adm2 data, which contains that missing data information.
All the zones, including the missing one, can be seen in NPL_adm2 data. You may turn the checkbox on and off on the left
Layers Panel and see the layers getting hidden and displayed.
We need to create a separate layer of that missing part, which will be merged with the regions data. Select
View > Select > Select Feature(s) and select the feature that we want to merge. After the selection, the feature gets highlighted and Copy the feature by
Edit > Copy Features.
Edit > Paste Features as > New Vector Layer to create a new layer from that copied feature.
A set of popups appears, give the location to save the shapefile of the new layer.
Layers Panel now includes extra layer. I gave this layer a name
You may hide and show the layers from the
Layers Panel. Below shows the layer which needs to be joined with our problematic shapefile
Install MMQGIS plugin if you haven’t installed. It’s not present in default installation. Go to
Plugins > Manage and Install Plugins, search for MMQGIS and install. You will see the MMQGIS in the menu bar.
MMQGIS > Combine > Merge Layers. You will see all the layers you have in the current workspace.
I chose the layers
missing-region and mentioned the filename for the new shapefile.
You will get new merged layer, it contains the missing layer as well. Next I need to join that missing block to the region where it belongs.
Select both the features you want to merge. Select
View > Select > Select Feature(s) and press
Command + left click both the features - highlighted below.
Right click on the layer in the
Layers Panel and choose
Toggle Editing. You will see both the layers are now editable and are surrounded with thick red border.
Edit > Merge Selected Features. A popup appears. Select
Congratulations! The missing block is now filled in the shapefile and part of the region.