The idea of the xy-tools-plugin is to group some functionality needed when you often work with tables with x and y columns (eg spreadsheet files (Libre/OpenOffice, Excel), dbf files or even txt/csv files).
The plugin has the following functions:
It started off as a plugin for a user who had an excell file with toponiemen / fieldnames and a stack of old scanned cadastral maps.
If you have installed the xytools plugins, you should see a new button in the edit/digitize toolbar (see red circle in image):
and a context menu in the plugin menu:
Open the dbf file by opening it as a normal 'vector' layer.
Start by 'toggle edit' of a given layer (1).
When the layer is a vector layer, the xytool-button will be activated (2).
When checked a dialog pops up (3) where you will have to choose the x and y columns.
Before clicking in the map: open the attribute table and make one feature/record active (4).
You can now click in the map to fill the designated x and y fields of the selected record.
When selecting a record in the attribute table a red cross is shown on those x,y coordinates
The tool behaves as a normal digitize tool. By toggling editing again you will be asked to either save your edits, or discard them.
In the menu of xy tools there is the possibility to save a attribute table as a point shape file (img below).
Geometries of the shape file will be using the x- and y- columns for there coordinates.
(to use this functionality you should have the python-uno library installed. For Linux you can probably install it via your package manager. On Windows it is harder: you can install it via the normal installer as addition/module, but there seems to be an error with the python path. The plugin cannot find it. If somebody knows a solution for this, please let me know. )
Op open an Libre/OpenOffice (.ods) file and use it either as a attribute table OR as a point vector layer, choose 'Open Libre/OpenOffice file as attribute tabl or Point layer' from the xytools plugin menu options:
You will be given the option to choose an x- and y-column from the spreadsheet file. The values of those columns will be used as x and y coordinate for the Point features of the Memory layer.
You can also CANCEL the xy-column dialog, then the rows will also be read as features, BUT the geometries will all have zero's as x and y
There are some things to consider for this:
(to use this functionality you should have the xlrd library installed. On Windows you can get it via osgeo4w. For Linux you can probably install it via your package manager. Or you can get it from the project page: http://www.python-excel.org/ )
Op open an Excel (.xls) file and use it either as a attribute table OR as a point vector layer, choose 'Open Excel file as attribute table or Point layer' from the xytools plugin menu options:
You will be given the option to choose an x- and y-column from the excel file. The values of those columns will be used as x and y coordinate for the Point features of the Memory layer.
You can also CANCEL the xy-column dialog, then the rows will also be read as features, BUT the geometries will all have zero's as x and y
There are some things to consider for this:
(to use this functionality you should have the xlw library installed. On Windows you can get it via osgeo4w. For Linux you can probably install it via your package manager. Or you can get it from the project page: http://www.python-excel.org/ )
When you have a vector layer active, choose 'Save attribute table as Excel file' from the xytools plugin menu options:
It will ask you where to save the file and do a simple save. That is: use the attribute key's in the first row and all values of a geometry as a row (as strings).
Currently the plugin is working both with shape files and single dbf-files. Saving csv files is not supported by the underlying OGR-library.
So: for a dbf you can add and remove records. But if you want further editing: like inserting records, adding columns etc, either use Libre/Open-office, or one of the other qgis table plugins.
If you find bugs or have ideas for this plugin, contact Richard Duivenvoorde ( richard@duif.net ).
Code lives at: https://github.com/rduivenvoorde/xytools
Issues and bugs: https://github.com/rduivenvoorde/xytools/issues