public class ArcGISDataStore
extends org.geotools.data.store.ContentDataStore
Because of the nature of the REST API, paging is not suited for stateless
code such as web pages. When you request a FeatureReader with a Query with
paging parameters set using Query.setStartIndex(java.lang.Integer) and
Query.setMaxFeatures(int), the data store must always
request all object ids matching the rest of the query and then request the
features in the page using the object ids. If the feature collection is very
large this can take a long time.
It is possible to request the object ids matching the Query using
ArcGISFeatureReader.getObjectIds() and use this List later on to
request features with
ArcGISFeatureReader.getFeaturesByObjectIds(java.util.List). The list
with object ids can be cached where appropriate and be used to request a
sublist for paging.
Unfortunately the object ids cannot be used as a row id in a query to pass on the start index and max features. While sometimes the object ids start at 1 and increment for each subsequent feature, this is not guaranteed.
Although ArcGIS server sends ETag headers in response to requests, there is
not really a performance improvement using conditional HTTP requests - with
very large feature collections the performance is abysmal no matter what.
Because of this the HTTP cache (using
HttpCache4j) is disabled by
default * so the HttpCache4j libraries are not required. To enable HTTP caching you
must patch HttpCache4j to support non-conformant ETag headers sent by ESRI
(see CachingHTTPClient, renamed to CachingHTTPClient.java.disabled) and
uncomment the relevant lines in this class and
ArcGISDataStoreFactory. Then pass a HTTPCache instance to the
constructor or using the HTTP_CACHE Param for the factory.
When reading features ArcGIS server may produce invalid JSON when it apparently has an invalid coordinate and sends "*****************" instead. Like non-well formed XML we do not accept this so ArcGISFeatureReader.next() may throw an exception (consistently, the ESRI WFS server also produces invalid posLists this way).
The standard ESRI spatial querying restrictions apply: only one spatial operator with the default geometry and a literal geometry operand is supported and can only be combined with other attribute queries in a Boolean AND.
| Constructor and Description |
|---|
ArcGISDataStore(URL url) |
ArcGISDataStore(URL url,
String user,
String passwd,
Integer timeout,
Boolean gzip,
org.opengis.referencing.crs.CoordinateReferenceSystem crs,
Object httpCache,
String currentVersion) |
| Modifier and Type | Method and Description |
|---|---|
static String |
appendUrlParameters(String url,
Map<String,String> params) |
protected org.geotools.data.store.ContentFeatureSource |
createFeatureSource(org.geotools.data.store.ContentEntry ce) |
protected List<org.opengis.feature.type.Name> |
createTypeNames() |
org.opengis.referencing.crs.CoordinateReferenceSystem |
getCRS() |
int |
getCurrentMajorVersion() |
String |
getCurrentVersion() |
org.json.simple.JSONObject |
getLayerJSON(String id) |
org.json.simple.JSONObject |
getServerJSONResponse(String extraUrl) |
org.json.simple.JSONObject |
getServerJSONResponse(String extraUrl,
Map<String,String> params) |
String |
toString() |
createContentState, createSchema, dispose, ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getInfo, getLockingManager, getLogger, getNames, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, removeSchema, removeSchema, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, setNamespaceURI, updateSchema, updateSchemapublic ArcGISDataStore(URL url)
public String getCurrentVersion() throws IOException
IOExceptionpublic int getCurrentMajorVersion()
throws IOException
IOExceptionpublic org.json.simple.JSONObject getServerJSONResponse(String extraUrl) throws IOException
IOExceptionpublic org.json.simple.JSONObject getServerJSONResponse(String extraUrl, Map<String,String> params) throws IOException
IOExceptionpublic org.json.simple.JSONObject getLayerJSON(String id) throws IOException
IOExceptionprotected List<org.opengis.feature.type.Name> createTypeNames() throws IOException
createTypeNames in class org.geotools.data.store.ContentDataStoreIOExceptionprotected org.geotools.data.store.ContentFeatureSource createFeatureSource(org.geotools.data.store.ContentEntry ce)
throws IOException
createFeatureSource in class org.geotools.data.store.ContentDataStoreIOExceptionpublic org.opengis.referencing.crs.CoordinateReferenceSystem getCRS()
Copyright © 2016. All rights reserved.