Shapefile Structure Viewer and Editor
|
|
![]() V0.0.3 interface |
As a shapefile geometry viewer:
As a shapefile editor (Please see tutorial below):
Please note that shapefiles with thousands of geometry points will take a very long time to load, if at all!
Please report any bug/problem/wish to the QGIS User mailing list [mailto: qgis - user at lists dot osgeo dot org].

![]()
V0.0.4 toolbar: note the addition of the "Save as..." button and the Save as... dialog below (V0.0.6):
| Click button to select a shapefile name | ![]() Click Save to save the data or Cancel to dismiss the dialog |
|
| Select what to save: entire table (all the content of the data displayed in the plugin) or only the selected rows in the table (only those selected rows will be saved. So if you've partially selected a feature it will most probably mess up the saved shapefile!) |
By default all the attributes in the table are selected. Use the shift and control keys to select the attributes you want saved. |
|
| If you've done the right modifications on the table data you can try to change the type of the shapefile. You could promote a point layer to a line or polygon shapefile if you've done the correct editing. Similarly you could denote a line layer to a point shapefile or promote it to a polygon shapefile. Same with a polygon layer. BUT REMEMBER: you first have to do the correct editing yourself!!! |
Please read the section below and look at the section above before downloading.
Usage of this plugin can be dangerous for your data.
You use it entirely at your own risk.
bccshpv is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See here instructions on how to install QGIS plugins manually.
This plugin is also available in the QGIS user contributed repository.
It carries an Experimental flag and is only recommended for QGIS 1.5 and above.
This tutorial is based on version 0.0.1 of the plugin. See sections below for more recent editing capabilities.
The following is a brief introduction on how to use the plugin to create shapefile by keying coordinates values. If you want to create a shapefile by clicking points please see the QGIS User Manual.
The first step is to create the physical shapefile on disk. To do that we will use QGIS 'New shapefile layer' (
). Please refer to QGIS 1.5.0 User Manual, section 3.5.5 page 63, for information on how to do that. It is outside of the scope of this tutorial.
Now you have created the shapefile with the correct geometry (point or line or polygon). We will see how to edit the three types below.
Let's start by editing a point shapefile.





![]() |
![]() |
| and in QGIS : |
To edit a line or polygon shapefile, the same procedure detailed above needs to be followed.
For a line shapefile the following warning is issued when the edit button is clicked:

And for a polygon shapefile the following warning is issued:

Please take note of those warnings! You will damage and render your shapefile unusable if you don't respect those constraints.
Below are examples of a line shapefile (having two lines), left, and a polygon shapefile with one polygon having one ring, right.
![]() |
![]() |
| Note the ellipsis (...) to mark the first point of the ring --> |
Putting the three shapefiles together gives (don't look for any meaning, they are just dumb examples):

Please note that multipolygons and multipoints are not dealt with by the plugin.
Be prudent and enjoy!
Version 0.0.3 provides more editing functions than the previous versions (see also guided tour):
In editing mode you can now:
Before using those functions please read the following :
If you want to apply an offset to only one row of a feature (line or polygon) you cannot use the Move button. In that case, simply type in the new coords in the grid. This is because if only one point in a line/polygon feature is selected when the offsets are given the entire feature is selected first and the offset applied to the entire feature.

1. Edit columns- both add and remove them as I see fit. -> For that you can use the Table Manager plugin. Unfortunately I do not plan to duplicate it with the shapefile viewer plugin because I do not want the plugin to fiddle with the structure of a shapefile, only with its data. 2. Edit rows- as above. -> Added in V0.0.3. 3. "Save selection as" Really practical command. Out of my 1,000 points I would love to transfer say 50x to a new shapefile layer. -> Done: there is a new "Save as..." button (). When clicked it displays a dialog where you have to give the name of a shapefile.
Optionally you can select to save the current selection in the table or the entire table. Note that here, selection means the rows selected in the table, not the features selected before launching the plugin. This also means that you have to select entire features (line or polygon) yourself otherwise the resulting shapefile will be a mess! A second option let you select the fields (columns in the table) you want to save to the new shapefile. By default all fields are selected. You can use shift-click and control-click to alter the selection of the fields.
1. Please consider working (or showing) only selected feature(s). It is not of much use if there are many polygons with many vertexes, you have to scroll up&down a lot to find needed feature. I can still see that seeing everythig is useful when you're working with empty layer (adding features), but a switch 'show only selected feature(s)' would these both suggestions. -> Done. See important remarks at point 6 below. The following warning is shown when working with a selection:Clicking 'Yes' will only import the selected feature(s) into the plugin. Clicking 'No' will try to import all the features of the layer into the plugin. 2. Is it possible to shrink row height? May be its Windows, but mine are extra inflated occupying valuable space. Check this screenshot [1] (first two rows I shrank manually) -> I need a PyQt guru to show me how to do that! 3. It would be really nice if node selected in the table would highlight in map canvas, thus allowing us to track were are they exactly. -> Done for vertices. On a point layer the selected point is highlighted in red. On line/polygon layers, the current point of the feature is in red and all the other points of the feature are in blue. 4. I think 'close' button and little graphic on the left are unnecessary. I'd add current layer name and its type right in the window title. -> The icon of the dialog shows the type of shapefile loaded. Shapefile name is added to the title bar with the numbere of (selected) features. 5. It would be nice to able to delete a node(s) as well. -> Done, use at own risks, no undo, no checking... 6. Please consider moving 'start|stop editing' functionality to QGIS itself, so that you'd have to start and stop editing in QGIS, I think it will be more straightforward. -> Not possible in the current implementation: the edited shapefile *IS* the table and the table *IS* the shapefile. There is a total disconnection between the table and the shapefile. So any edit on the table are lost if user does not save them in the plugin. This allows for a bit of safety. IMPORTANT remarks: - If some features are selected in QGIS and the plugin is called, you will be asked if you want to work with that selection only or work with the entire file. If you choose to work with the selection, the important point below must be taken into consideration: - Even if you do no editing but simply enter edit mode, exit edit mode and save, then the selected features will be put on top of the display stack: the order of the features is modified in the shapefile! - Any edit will thus result in a change of ID numbering. QGIS displays the features in a shapefile by increasing ID number. - You better not change the ID column in the plugin because your changes will be lost when you save! The plugin changes the ID of the features before saving to the shapefile. It is done for consistency and all user's changes are lost. Some extras: ----------- 7. Added possibility to promote, demote a feature relative to the other features in the shapefile: a shapefile is drawn to the canvas by drawing the first feature in the file first and the last feature last. So by changing the order features are saved in the file the drawing order can be controlled and a feature can be placed on top or below others! -> For points: Select the point(s) you want to move and click one of the four arrow buttons (move at bottom, move below previous, move above next and move at top). -> For lines and polygons: 1) Put the current cell inside a feature and click one of the four arrow buttons. This will move the entire feature. 2) Select ENTIRE features and click one of the four arrows to move them at once. (This method will only move the selection, so if a feature is not entirely selected you will mess up your shapefile! Use it at your own risk). 8. Added offsets: you can move a single feature or a selection of points by a given X and/or Y offset values. In case of line and polygon shapefiles you cannot offset a single point. In that case, simply type in the new coords in the grid. This is because if only one point in a line/polygon feature is selected when the offsets are given the entire feature is selected first and the offset applied to the entire feature. -> Done.