Class PostGISDataStoreDataSource
- java.lang.Object
-
- com.vividsolutions.jump.io.datasource.DataSource
-
- com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
-
- com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
-
- org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
-
- org.openjump.core.ui.plugin.datastore.postgis2.PostGISDataStoreDataSource
-
- All Implemented Interfaces:
WorkbenchContextReference
public class PostGISDataStoreDataSource extends WritableDataStoreDataSource
AWritableDataStoreDataSource
for PostGIS.
-
-
Field Summary
-
Fields inherited from class org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
CONVERT_TO_MULTIGEOMETRY_KEY, CREATE_PK, DEFAULT_PK_NAME, evolutions, EXTERNAL_PK_KEY, GEOM_DIM_KEY, LIMITED_TO_VIEW, MANAGE_CONFLICTS, NAN_Z_TO_VALUE_KEY, NARROW_GEOMETRY_TYPE_KEY, NORMALIZED_COLUMN_NAMES, primaryKeyName, schemaName, SRID_KEY, tableName, TX_MANAGER_KEY
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
CACHING_KEY, context, DATASET_NAME_KEY, GEOMETRY_ATTRIBUTE_NAME_KEY, MAX_FEATURES_KEY, WHERE_CLAUSE_KEY
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
CONNECTION_DESCRIPTOR_KEY, PATTERN_FENCE, PATTERN_SELECTION, PATTERN_VIEW, PRIMARY_KEY_KEY, SQL_QUERY_KEY
-
Fields inherited from class com.vividsolutions.jump.io.datasource.DataSource
CHARSET_KEY, COMPRESSED_KEY, COORDINATE_SYSTEM_CODE, COORDINATE_SYSTEM_KEY, COORDINATE_SYSTEM_REGISTRY, FILE_KEY, URI_KEY
-
-
Constructor Summary
Constructors Constructor Description PostGISDataStoreDataSource()
PostGISDataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context)
PostGISDataStoreDataSource(WorkbenchContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey)
Add an automatically named primary key constraint to the table.protected void
createAndPopulateTable(SpatialDatabasesDSConnection conn, FeatureCollection fc, int srid, String geometryType, boolean multi, int dim, boolean normalizedColumnNames)
Create and populate a table with features from a dataset.protected FeatureCollection
createFeatureCollection()
protected void
deleteTableQuery(SpatialDatabasesDSConnection conn)
Execute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS < 2).void
finalizeUpdate(SpatialDatabasesDSConnection conn)
Deprecated.protected int
getTableSRID(Connection conn, String column)
-
Methods inherited from class org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
addCreation, addModification, addSuppression, getConnection, getGeometryDimension, getGeometryType, getIndexedEvolutions, getUncommittedEvolutions, getViewEnvelope, insertStatement, isWritable, removeEvolution, setAttributeValues, setCoordDimension, setLimitedToView, setManageConflicts, setMultiGeometry, setSRID, setTableAlreadyCreated
-
Methods inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
getWorkbenchContext, setMaxFeature, setWhereClause, setWorkbenchContext
-
Methods inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
expandQuery
-
Methods inherited from class com.vividsolutions.jump.io.datasource.DataSource
getProperties, installCoordinateSystem, isDisabled, isReadable, setDisabled, setProperties
-
-
-
-
Constructor Detail
-
PostGISDataStoreDataSource
public PostGISDataStoreDataSource()
-
PostGISDataStoreDataSource
public PostGISDataStoreDataSource(WorkbenchContext context)
-
PostGISDataStoreDataSource
public PostGISDataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context)
-
-
Method Detail
-
finalizeUpdate
@Deprecated public void finalizeUpdate(SpatialDatabasesDSConnection conn) throws Exception
Deprecated.After a new postgis table has been create, it is useful to execute a VACUUM ANALYZE in order to update indexes and get a precise estimated_extent.- Specified by:
finalizeUpdate
in classWritableDataStoreDataSource
- Parameters:
conn
- the Connection to use to finalize the update- Throws:
Exception
- if an Exception occurs during update finalization
-
createFeatureCollection
protected FeatureCollection createFeatureCollection() throws Exception
- Overrides:
createFeatureCollection
in classDataStoreDataSource
- Throws:
Exception
-
deleteTableQuery
protected void deleteTableQuery(SpatialDatabasesDSConnection conn) throws SQLException
Execute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS < 2).- Specified by:
deleteTableQuery
in classWritableDataStoreDataSource
- Parameters:
conn
- connection to use to delete the table- Throws:
SQLException
- if the server returns an exception while deleting
-
createAndPopulateTable
protected void createAndPopulateTable(SpatialDatabasesDSConnection conn, FeatureCollection fc, int srid, String geometryType, boolean multi, int dim, boolean normalizedColumnNames) throws SQLException
Create and populate a table with features from a dataset.- Specified by:
createAndPopulateTable
in classWritableDataStoreDataSource
- Parameters:
conn
- connection to the databasefc
- featureCollection to upload to the databasesrid
- srid of the geometrygeometryType
- geometry typedim
- geometry dimensionnormalizedColumnNames
- whether columns names have to be normalized or notmulti
- true to force geometry to be a MultiGeometry- Throws:
SQLException
- if an exception occured during the query processing
-
addDBPrimaryKey
protected void addDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey) throws SQLException
Description copied from class:WritableDataStoreDataSource
Add an automatically named primary key constraint to the table.- Specified by:
addDBPrimaryKey
in classWritableDataStoreDataSource
- Parameters:
conn
- the Connection to use to add the Primary KeyprimaryKey
- the column name for th primary key- Throws:
SQLException
- if an exception occurs during primary key addition
-
getTableSRID
protected int getTableSRID(Connection conn, String column) throws SQLException
- Specified by:
getTableSRID
in classWritableDataStoreDataSource
- Throws:
SQLException
-
-