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 GeometryLibrary
The geometry library, ornull
for the default.private final Locale
private org.opengis.metadata.Metadata
The metadata object, created when first needed.The parsed objects, filled only when first needed.private static final int
Arbitrary size limit.private Reader
The reader, set by the constructor and cleared when no longer needed.private final TimeZone
Timezone for dates, ornull
for 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, parameters
Methods inherited from class org.apache.sis.storage.DataStore
addListener, findResource, getDisplayName, getLocale, getNativeMetadata, getProvider, removeListener, setLocale, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 forInternationalString
localization ornull
forLocale.ROOT
(usually English). This locale is not used for parsing numbers or dates. -
timezone
Timezone for dates, ornull
for UTC. -
library
The geometry library, ornull
for 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 thisDataStore
instance, ornull
if 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 thatobjects
may 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, ornull
if none. The current implementation retains only instances ofReferenceSystem
and ignore other objects. The identification informationCitation
is set to the CRS name and identifier, unless there is ambiguity.- Specified by:
getMetadata
in interfaceResource
- Specified by:
getMetadata
in classDataStore
- Returns:
- the metadata associated to the parsed object, or
null
if 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:
close
in interfaceAutoCloseable
- Specified by:
close
in classDataStore
- Throws:
DataStoreException
- if an error occurred while closing this data store.- See Also:
-