Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Spatial Data Support » Spatial data

 

Viewing spatial data as images (Interactive SQL)

In Interactive SQL, you can view a geometry as an image using the Spatial Preview tab to understand what the data in the database represents.

Prerequisites

You must have SELECT privilege on the table you are selecting from, or the SELECT ANY TABLE system privilege.

Context and remarks

Each instance of Interactive SQL is associated with a different connection to a database. When you open an instance of the Spatial Viewer from within Interactive SQL, that instance of Spatial Viewer remains associated with that instance of Interactive SQL, and shares the connection to the database.

When you execute a query in the Spatial Viewer, if you attempt to execute a query in the associated instance of Interactive SQL, you get an error. Likewise, if you have multiple instances of the Spatial Viewer open that were created by the same instance of Interactive SQL, only one of those instances can execute a query at a time; the other instances must wait for the query to finish.

Note

By default, Interactive SQL truncates values in the Results pane to 256 characters. If Interactive SQL returns an error indicating that the full column value could not be read, increase the truncation value. To do this, click Tools » Options and click SQL Anywhere in the left pane. On the Results tab, change Truncation Length to a high value, such as 5000. Click OK to save your changes, execute query again, and then double-click the row again.

 View spatial data as images (Interactive SQL)
  1. Connect to your database in Interactive SQL.

  2. Execute a query to select spatial data from a table. For example:

    SELECT * FROM owner.spatial-table;
  3. Double-click any value in the Shapes column in the Results pane to open the value in the Value window.

    The value is displayed as text on the Text tab of the Value window.

  4. Click the Spatial Preview tab to see the geometry as a Scalable Vector Graphic (SVG).

Results

The geometry is displayed as a Scalable Vector Graphic (SVG).

Next

The spatial data can be viewed as geometry by using the Previous Row and Next Row buttons to view other rows in the result set.

Example

  1. Connect to the sample database and execute the following query:

    SELECT * FROM GROUPO.SpatialShapes;
  2. Double-click the any value in the Shapes column in the Results pane to open the value in the Value window.

    The value is displayed as text on the Text tab of the Value window.

  3. Click the Spatial Preview tab to see the geometry as a Scalable Vector Graphic (SVG).

    Image viewer displaying a geometry that looks like a lightning bolt.