2

Can you add an MS Access table as X,Y points in the same way you can Add X,Y data in ArcMap using:

File --> Add Data --> Add X,Y Data
0

2 Answers 2

2

The equivalent to Arc's 'Add XY-Data' is 'Add delimited text layer' (available as one of the standard buttons or through the layer menu). However, this takes CSV, TXT, or WKT. You can use an MS ACCESS database (or almost any database), but you need to connect to the database first. Some of the common spatially enabled databases are already set up with a button to make this easy (e.g. PostGIS, Oracle Spatial, SpatiaLite etc). MS Access needs a little more work. Have a look here for more details on ow to connect to MS Access.

2

This should be possible by creating a VRT file.

http://www.gdal.org/ogr/drv_vrt.html

Example: ODBC Point Layer In the following example (disease.ovf) the worms table from the ODBC database DISEASE is used to form a spatial layer. The virtual file uses the "x" and "y" columns to get the spatial location. It also marks the layer as a point layer, and as being in the WGS84 coordinate system.

<OGRVRTDataSource>

<OGRVRTLayer name="worms">
    <SrcDataSource>ODBC:DISEASE,worms</SrcDataSource> 
<SrcLayer>worms</SrcLayer> 
<GeometryType>wkbPoint</GeometryType> 
    <LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="x" y="y"/> 
</OGRVRTLayer>

</OGRVRTDataSource>
2
  • 1
    The above hyperlink is broken, it should now be link. Commented Sep 27, 2015 at 21:34
  • The above code is XML. 1 Copy and paste into a text editor. 2 Edit the code to change the names for your files and ODBC connection (see top of page for ODBC 'how to' link) 3 Save as a text file. 4 Edit the the text file name so it has a .vrt extension. 5 In QGIS, Menu>Layer>Add Layer>Add Vector Layer> set file type to VRT, browse to the file you just saved. It should open a live link that updates on open. NB Do not have your Access file open at the same time as your QGIS project, or VRT will not work. See also (gis.stackexchange.com/questions/154791/…) Commented Sep 27, 2015 at 22:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.