[Qgis-user] How do I georeference an xls file opened in QGIS 2.0

Richard Duivenvoorde rdmailings at duif.net
Tue Nov 5 12:38:21 PST 2013


On 05-11-13 20:41, Brent Wood wrote:
> Cheers...
> 
> I don't want to create shapefiles or csv's, etc, from spreadsheets,  I
> just want to plot *.xls files which contain x/y columns on the map.
> 
> I sort of figured that if a GIS tool can open an xls file this would be
> pretty basic functionality... perhaps optimistically :-)
> 
> The use case I'm envisaging is a live Excel spreadsheet used to store
> data. New rows (records) are added as appropriate. A QGIS project
> includes the spreadsheet as a current layer - so a QGIS user can open
> the spreadsheet, as well as other map layers, & save the project.
> Reopening the project would automatically plot all the rows in the
> spreadsheet on the map.
> 
> The only ways I can see to achieve this functionality involve recreating
> another copy of the spreadsheet in another format before I can view the
> points on the map. Which is an annoying extra few steps every time I
> want to view the spreadsheet.
> 
> Is this worth filing a ticket for? Perhaps add some extra functionality
> in the vector layer dialogue: if the file type opened is an xls, allow
> the user to (optionally) specify the column identifiers for the X & Y
> coords & the SRID to apply? 

Hi,

my xytools plugin does parts of your question:
- it can load an xls file (xlr module needed), will ask you for a crs
and the x and y column, and then will create features and place those in
a memory layer (!). Which you could save to ... whatever
But as this is a memorylayer the link to your excelfile is not
memorized, so loading excel file in a project file is not working.

Second option: as OGR  can load excel files, QGIS can load them as
tables (just via 'add vector layer'). Maybe (!, haven't tried this) you
can use the vrt-magic from ogr for this.
See http://www.gdal.org/ogr/drv_vrt.html
This would mean that your excel file would be accompanied by this xml
file which defines the columns and geometrytype. And OGR (and by this
hopefully QGIS) will then see it as a 'virtual' geometry containing
file. Please try (and report back ;-) )

Third option: instead of real excell files,
use csv files (combined with vrt?) See
http://www.gdal.org/ogr/drv_csv.html

The Delimited Text File layer is also pretty sophisticated nowadays!

Hope this helps.

Regards,

Richard Duivenvoorde





More information about the Qgis-user mailing list