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
A
WritableDataStoreDataSource for PostGIS.-
Field Summary
Fields inherited from class 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_KEYFields inherited from class DataStoreDataSource
CACHING_KEY, context, DATASET_NAME_KEY, GEOMETRY_ATTRIBUTE_NAME_KEY, MAX_FEATURES_KEY, WHERE_CLAUSE_KEYFields inherited from class DataStoreQueryDataSource
CONNECTION_DESCRIPTOR_KEY, PATTERN_FENCE, PATTERN_SELECTION, PATTERN_VIEW, PRIMARY_KEY_KEY, SQL_QUERY_KEYFields inherited from class DataSource
CHARSET_KEY, COMPRESSED_KEY, COORDINATE_SYSTEM_CODE, COORDINATE_SYSTEM_KEY, COORDINATE_SYSTEM_REGISTRY, FILE_KEY, URI_KEY -
Constructor Summary
ConstructorsConstructorDescriptionPostGISDataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey) Add an automatically named primary key constraint to the table.protected voidcreateAndPopulateTable(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 FeatureCollectionprotected voidExecute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS invalid input: '<' 2).voidDeprecated.protected intgetTableSRID(Connection conn, String column) Methods inherited from class WritableDataStoreDataSource
addCreation, addModification, addSuppression, getConnection, getGeometryDimension, getGeometryType, getIndexedEvolutions, getUncommittedEvolutions, getViewEnvelope, insertStatement, isWritable, removeEvolution, setAttributeValues, setCoordDimension, setLimitedToView, setManageConflicts, setMultiGeometry, setSRID, setTableAlreadyCreatedMethods inherited from class DataStoreDataSource
getWorkbenchContext, setMaxFeature, setWhereClause, setWorkbenchContextMethods inherited from class DataStoreQueryDataSource
expandQueryMethods inherited from class DataSource
getProperties, installCoordinateSystem, isDisabled, isReadable, setDisabled, setProperties
-
Constructor Details
-
PostGISDataStoreDataSource
public PostGISDataStoreDataSource() -
PostGISDataStoreDataSource
-
PostGISDataStoreDataSource
public PostGISDataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context)
-
-
Method Details
-
finalizeUpdate
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:
finalizeUpdatein classWritableDataStoreDataSource- Parameters:
conn- the Connection to use to finalize the update- Throws:
Exception- if an Exception occurs during update finalization
-
createFeatureCollection
- Overrides:
createFeatureCollectionin classDataStoreDataSource- Throws:
Exception
-
deleteTableQuery
Execute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS invalid input: '<' 2).- Specified by:
deleteTableQueryin 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:
createAndPopulateTablein classWritableDataStoreDataSource- Parameters:
conn- connection to the databasefc- featureCollection to upload to the databasesrid- srid of the geometrygeometryType- geometry typemulti- true to force geometry to be a MultiGeometrydim- geometry dimensionnormalizedColumnNames- whether columns names have to be normalized or not- Throws:
SQLException- if an exception occured during the query processing
-
addDBPrimaryKey
protected void addDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey) throws SQLException Description copied from class:WritableDataStoreDataSourceAdd an automatically named primary key constraint to the table.- Specified by:
addDBPrimaryKeyin 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
- Specified by:
getTableSRIDin classWritableDataStoreDataSource- Throws:
SQLException
-