SQL Anywhere support in QGIS
David DeHaan has developed a plugin and data provider for working with Sybase SQL Anywhere spatial databases in QGIS. The new functionality is available as of r14918, and the capabilities of the new provider are very similar to those of the PostGIS and SpatiaLite providers.
To build and test this provider, you will need:
- download the free developer version of SQL Anywhere 12.0.0
- install SQL Anywhere 12.0.0 server
- install the SQL Anywhere 12.0.0 client libraries on the clients (if the server and client are on the same machine, this step is not needed)
- initialise an empty database with the
dbinit database_name
command (replacedatabase_name
with the desired database name). This will also create a userdba
with passwordsql
- start the server with the
dbsrv12 database_name
command - fill the database with spatial data. For testing, you can use an SQL script that loads shapefiles from the Alaska dataset into the database. The script should be run on the server using the Interactive SQL tool (dbisql). You may need to change some variables before running the script, for example, to correct the path to the dataset (the script assumes the dataset is on the server)
- start QGIS and enable the SQL Anywhere plugin. The plugin adds a button to the toolbar and creates menu items “Modules → SQL Anywhere” and “Layer → Add SQL Anywhere Layer…”
- when adding a layer, a dialogue similar to the PostGIS/SpatiaLite layer dialogue will appear, where you can manage connections, get information about the database schema, configure various parameters and select geometry columns
You can find out more about SQL Anywhere’s support for spatial data here.
It would be interesting to test and compare the functionality and performance of PostGIS, SQL Anywhere and Oracle Spatial in a real-world scenario.