Class Store
java.lang.Object
org.apache.sis.storage.DataStore
org.apache.sis.internal.storage.URIDataStore
org.apache.sis.internal.storage.wkt.Store
- All Implemented Interfaces:
AutoCloseable,ResourceOnFileSystem,StoreResource,Resource,Localized
A data store which creates data objects from a WKT definition.
Note:
this class differs from
PRJDataStore in that
the file containing WKT definition is the main file, not an auxiliary file.- Since:
- 0.7
- Version:
- 1.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.storage.URIDataStore
URIDataStore.Provider -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GeometryLibraryThe geometry library, ornullfor the default.private final Localeprivate org.opengis.metadata.MetadataThe metadata object, created when first needed.The parsed objects, filled only when first needed.private static final intArbitrary size limit.private ReaderThe reader, set by the constructor and cleared when no longer needed.private final TimeZoneTimezone for dates, ornullfor UTC.Fields inherited from class org.apache.sis.internal.storage.URIDataStore
location -
Constructor Summary
ConstructorsConstructorDescriptionStore(StoreProvider provider, StorageConnector connector) Creates a new WKT store from the given file, URL or stream. -
Method Summary
Methods inherited from class org.apache.sis.internal.storage.URIDataStore
addTitleOrIdentifier, getComponentFiles, getIdentifier, getOpenParameters, getOriginator, getSpecifiedPath, location, parametersMethods inherited from class org.apache.sis.storage.DataStore
addListener, findResource, getDisplayName, getLocale, getNativeMetadata, getProvider, removeListener, setLocale, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sis.storage.Resource
addListener, removeListener
-
Field Details
-
SIZE_LIMIT
private static final int SIZE_LIMITArbitrary size limit. Files that big are likely to be something else than WKT, so this limit allows earlier error reporting than loading huge amount of data before to detect that those data are not what we taught they are.- See Also:
-
source
The reader, set by the constructor and cleared when no longer needed. -
locale
The locale forInternationalStringlocalization ornullforLocale.ROOT(usually English). This locale is not used for parsing numbers or dates. -
timezone
Timezone for dates, ornullfor UTC. -
library
The geometry library, ornullfor the default. -
objects
The parsed objects, filled only when first needed. May still be empty if the parsing failed. -
metadata
private org.opengis.metadata.Metadata metadataThe metadata object, created when first needed.
-
-
Constructor Details
-
Store
Creates a new WKT store from the given file, URL or stream.- Parameters:
provider- the factory that created thisDataStoreinstance, ornullif unspecified.connector- information about the storage (URL, stream, etc).- Throws:
DataStoreException- if an error occurred while opening the stream.
-
-
Method Details
-
parse
Parses the objects, if not already done. Note thatobjectsmay still be empty if an exception has been thrown at this invocation time or in previous invocation.- Throws:
DataStoreException- if an error occurred during the parsing process.
-
getMetadata
Returns the metadata associated to the parsed objects, ornullif none. The current implementation retains only instances ofReferenceSystemand ignore other objects. The identification informationCitationis set to the CRS name and identifier, unless there is ambiguity.- Specified by:
getMetadatain interfaceResource- Specified by:
getMetadatain classDataStore- Returns:
- the metadata associated to the parsed object, or
nullif none. - Throws:
DataStoreException- if an error occurred during the parsing process.- See Also:
-
close
Closes this data store and releases any underlying resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classDataStore- Throws:
DataStoreException- if an error occurred while closing this data store.- See Also:
-