Shapefile

A shapefile is an ESRI spatial vector format.

Spectrum Spatial treats shapefiles as a read-only data source.

Data Types

Spectrum Spatial supports the following types, including M and Z values that represent Measure (measurement for linear referencing) and Z axis (height or depth).

Shape Data Type Spectrum Spatial Data Type
SHAPE Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection
INTEGER INTEGER
DOUBLE DOUBLE
STRING STRING
DATE DATE_TIME

Primary Key

A shapefile has an implied primary key that is the row ID. This column does not appear in the data, similar to the ROWNUM in Oracle.

MI SQL Optimizations

The shapefile data source provider contains optimizations for the following MI SQL construct:

For more information see the appendix Delegation to Data Source Providers.

Volatility

For shapefiles, the timestamp is evaluated to determine if anything in the table has changed. The data is reloaded only when the timestamp indicates it is more recent than the timestamp of the cached data. See Data Source Volatility for more information.

File Handle Pool

If your shapefiles do not change frequently, set the volatility to false and take advantage of a file handle pool that minimizes the file opening and closing during operations. This is only available to non-volatile native and seamless TAB files and shapefiles.

The file handle pool is enabled by default. Configuration of the file handle pool is done through the Management Console. Among the properties are the maximum number of handles that can be allocated to the pool (maxTotal), the maximum number of allocated handles per file (maxTotalPerKey), and the minimum length of time a file handle can sit in the pool unused before being closed (minEvictableIdleTimeMillis). Statistics for the file handle cache for shapefiles can be viewed in the Spectrum JMX Console (for more information, see Monitoring File Handle Caching Statistics with the Spectrum JMX Console in the Administration section of the Spectrum Spatial Guide).

To turn the file handle pool off:

  1. Open a web browser and go to http://server:port/managementconsole

    Where:

    server is the IP address or hostname of your Spectrum Technology Platform server.

    port is the HTTP port used by Spectrum Technology Platform. The default is 8080.

  2. Log in using the admin account.
  3. From Resources, click Spatial.
  4. Double-click on the value beside the pool.file.enabled property and type false.
  5. Click Save.

The remote component (JVM instance) automatically restarts with the change. This setting applies to native and seamless TAB files and shapefiles.

Spatial Index

To improve performance for spatial queries on shapefiles, Spectrum Spatial creates a spatial index (.qix) file on the fly. This behavior is enabled by default; however, it can be disabled in Spectrum Spatial Manager when creating named tables or modifying their datasources.

Note: If the shapefile exists on a read-only drive and a .qix file cannot be created, the request will still be processed and a warning will be recorded in the spectrum-server.log.