BlueSpray - Help
© SchoonerTurtles, Inc. 2012-2015

Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About

Database Manager

The database manager allows you to load and save spatial data within a relational database.

Note: Currently, only PostgreSQL/PostGIS is fully supported. SQL Server is partially supported. Let us know which databases you'd like to use and we'll add support for them.

Load from a Database

You can load data from a database by right-clicking on a Scene, dragging to "New Layer", and selecting "From Database...". In the first tab that appears, you'll need to enter the information to connect to the database. Then, select the "Query" tab and either enter the desired query or select the table from the popup menu. Then, make sure the columns below match the correct tables in the database and click "OK".

Create a New Table Using a Layer

To create a new table in the database, right click on a point, region, or topological layer and select "Export to Database" and then "Create Table...". Setup the connection as before and select the "Create Table" tab. You'll need to enter a new table name and then you can either leave the field names to match the column headers from the attribute table or give them your own names. When you click "OK", BlueSpray will create the table and add all the data in the selected layer into the table.

Append Data to an Existing Table

To add data to an existing table in the database, right click on a point, region, or topological layer and select "Export to Database" and then "Append Table...". Setup the connection as before and select the "Append Table" tab. You'll need to select a table from the list for the current database and then select the fields in the database to match the correct columns in the attribute table.

Update Data in an Existing Table

To update data to an existing table in the database, right click on a point, region, or topological layer and select "Export to Database" and then "Update Table...". Setup the connection as before and select the "Update Table" tab. You'll need to select a table from the list for the current database and then select the fields in the database to match the correct columns in the attribute table.

The IDs in the attribute table will be used to match the rows in the attributes to the records in the database.

Content Tab

Connection Tab

This tab includes the settings that will connect you to the database.

Drivers: Drives a list of the available drivers to coomunicate between BlueSpray and a database.

  • Open Database Connectivity (ODBC) is a standard interface to communicate with databases. To use ODBC, you'll need to setup a "Source" in the correct ODBC Data Source Administrator. There is a different management panel for 32-bit and 64-bit versions of programs and you'll need to use the one that matches the version of Java (32-bit or 64-bit) that you are running.
  • PostgreSQL is a standard interface to the PostgreSQL database. To use PostgreSQL to manage spatial data, you'll need to install the PostGIS addition to PostgreSQL.

Host: The name of the server the database is located on. This allows you to access databases on a shared network. Host is only required for non-ODBC drivers. The value for Host can be the name of the server ("localhost" for your workstation) or an IP address.

Port: The IP port the database is setup to use for Internet communication. Check the database settings for this setting. Port is only required for non-ODBC drivers.

Database: After clicking "Update Databases", this popup will include a list of the databases that are available through the driver, host, and port specified above.

Login: A valid login for the database. This may be different from your login to the computer.

Password: A password that matches the login above.

Query Tab

Layer Type: The layer type can either be points with separate x and y values in fields in the database table/query or Geometries in a single field.

Table: You can either select a table from this combo box or enter a query in the text area below to create the table for the layer.

Query: You can enter any valid SQL query for your database in this text box instead of selecting a single table. When you click "Update Field Names", the names of the fields will appear in the popups below. WHen you click "OK" all fields will be added into the layer's attribute table.

Note: The geometry in the query must be wrapped in a call to "ST_AsText(geom)" at this time.

ID Column: This is an optional column for an identifier (typically a primary key) if you wish to edit the data in BlueSpray and then update it in the database.

Shape Column: This is a geometry column

X, Y, Z Columns: These are columns for the x, y, and z coordinate values from the table or query.

Create Table Tab

Table Name: This will be the name of the new table and needs to match the constraints on table names for the selected database.

Attribute Column to Database Field: These text boxes will contain the names of the new fields in the database. The names need to match the constaints of the database. The names default to the names of the attribute columns and using these will make database operations more seamless (i.e. you won't have to change them).

Append Table Tab

Table: The table the data will be inserted into.

Attribute Column to Database Field: Provides a mapping between the columns in the attribute table and the fields in the database table.