Class WfsFeatureTable
- java.lang.Object
-
- com.esri.arcgisruntime.data.FeatureTable
-
- com.esri.arcgisruntime.ogc.wfs.WfsFeatureTable
-
- All Implemented Interfaces:
RemoteResource
,Loadable
,PopupSource
public final class WfsFeatureTable extends FeatureTable implements RemoteResource
Represents a table in a Web Feature Service.- Since:
- 100.5.0
-
-
Constructor Summary
Constructors Constructor Description WfsFeatureTable(WfsLayerInfo wfsLayerInfo)
Creates a WFS feature table with the given WfsLayerInfo object.WfsFeatureTable(String url, String tableName)
Creates a WFS feature table with the given URL and table name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OgcAxisOrder
getAxisOrder()
Gets the axis order, which defines how coordinates are interpreted.Credential
getCredential()
Gets theCredential
that is set on the network-enabled resource.ServiceFeatureTable.FeatureRequestMode
getFeatureRequestMode()
Gets the mode defining when features are requested from the service.OgcAxisOrder
getFilterAxisOrder()
Gets the axis order of the filter, which determines how coordinates are ordered when sent to the server as part of spatial queries (those that specify a geometry).WfsLayerInfo
getLayerInfo()
Gets the WFS layer metadata.SpatialReference
getPreferredSpatialReference()
Gets the preferred spatial reference of the WFS feature table.RequestConfiguration
getRequestConfiguration()
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.String
getUri()
Gets the URL used to create the WFS feature table.ListenableFuture<FeatureQueryResult>
populateFromServiceAsync(QueryParameters query, boolean clearCache, Iterable<String> outFields)
Executes an asynchronous method that populates the table with the results of a query.ListenableFuture<FeatureQueryResult>
populateFromServiceAsync(String xmlRequest, boolean clearCache)
Executes an asynchronous method that populates the table with the results of the XML query.void
setAxisOrder(OgcAxisOrder axisOrder)
Sets the axis order, which defines how coordinates are interpreted.void
setCredential(Credential credential)
Sets aCredential
to be used by the network-enabled resource in the event of an authentication challenge.void
setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode featureRequestMode)
Sets the mode defining when features are requested from the service.void
setFilterAxisOrder(OgcAxisOrder filterAxisOrder)
Sets the axis order of the filter, which determines how coordinates are ordered when sent to the server as part of spatial queries (those that specify a geometry).void
setPreferredSpatialReference(SpatialReference spatialReference)
Sets the preferred spatial reference for the WFS feature table.void
setRequestConfiguration(RequestConfiguration requestConfiguration)
Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.-
Methods inherited from class com.esri.arcgisruntime.data.FeatureTable
addDoneLoadingListener, addFeatureAsync, addFeaturesAsync, addLoadStatusChangedListener, canAdd, cancelLoad, canDelete, canEditGeometry, canUpdate, createFeature, createFeature, deleteFeatureAsync, deleteFeaturesAsync, getDisplayName, getExtent, getFeatureLayer, getField, getFields, getGeometryType, getLayer, getLoadError, getLoadStatus, getPopupDefinition, getSpatialReference, getTableName, getTotalFeatureCount, hasGeometry, hasM, hasZ, isEditable, isPopupEnabled, loadAsync, onDoneLoadingInternal, queryExtentAsync, queryFeatureCountAsync, queryFeaturesAsync, queryStatisticsAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, retryLoadAsync, setDisplayName, setPopupDefinition, setPopupEnabled, updateFeatureAsync, updateFeaturesAsync
-
-
-
-
Constructor Detail
-
WfsFeatureTable
public WfsFeatureTable(String url, String tableName)
Creates a WFS feature table with the given URL and table name.- Parameters:
url
- the URL to the WFS service to connect totableName
- the name of the layer (feature type) from the service- Throws:
IllegalArgumentException
- if url or tableName are null or empty- Since:
- 100.5.0
-
WfsFeatureTable
public WfsFeatureTable(WfsLayerInfo wfsLayerInfo)
Creates a WFS feature table with the given WfsLayerInfo object.- Parameters:
wfsLayerInfo
- a WfsLayerInfo object- Throws:
IllegalArgumentException
- if wfsLayerInfo is null- Since:
- 100.5.0
-
-
Method Detail
-
getFeatureRequestMode
public ServiceFeatureTable.FeatureRequestMode getFeatureRequestMode()
Gets the mode defining when features are requested from the service.Currently, WFS feature table only supports
ServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE
but defaults toServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_CACHE
. UsesetFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode)
to set the feature request mode to manual before attempting to populate the table.- Returns:
- the feature request mode
- Since:
- 100.5.0
-
setFeatureRequestMode
public void setFeatureRequestMode(ServiceFeatureTable.FeatureRequestMode featureRequestMode)
Sets the mode defining when features are requested from the service.Currently, WFS feature table only supports
ServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE
but defaults toServiceFeatureTable.FeatureRequestMode.ON_INTERACTION_CACHE
. Set the feature request mode to manual before attempting to populate the table.- Parameters:
featureRequestMode
- the feature request mode- Throws:
IllegalArgumentException
- if featureRequestMode is null- Since:
- 100.5.0
- See Also:
ServiceFeatureTable.FeatureRequestMode
-
getLayerInfo
public WfsLayerInfo getLayerInfo()
Gets the WFS layer metadata.- Returns:
- a WfsLayerInfo object
- Since:
- 100.5.0
-
getPreferredSpatialReference
public SpatialReference getPreferredSpatialReference()
Gets the preferred spatial reference of the WFS feature table.- Returns:
- the preferred spatial reference of this WfsFeatureTable
- Since:
- 100.5.0
-
setPreferredSpatialReference
public void setPreferredSpatialReference(SpatialReference spatialReference)
Sets the preferred spatial reference for the WFS feature table.If the preferred spatial reference isn't available from the service, the table will fail to load. Specify a preferred spatial reference that matches the map or scene's spatial reference to avoid automatic reprojection. The preferred spatial reference cannot be changed on a loaded table.
- Parameters:
spatialReference
- the preferred spatial reference- Throws:
IllegalArgumentException
- if spatialReference is null- Since:
- 100.5.0
- See Also:
SpatialReference
-
getAxisOrder
public OgcAxisOrder getAxisOrder()
Gets the axis order, which defines how coordinates are interpreted.Some WFS services return coordinates in (x,y) order, while others use (y,x). Setting this property to
OgcAxisOrder.SWAP
will result in all coordinates in geometries being swapped from what was sent by the server. Setting toOgcAxisOrder.NO_SWAP
will cause coordinates to be interpreted as-is. AxisOrder can be changed on an already-loaded table, but that change will only affect future calls topopulateFromServiceAsync(String, boolean)
orpopulateFromServiceAsync(QueryParameters, boolean, Iterable)
. Features that are already in the table will not be modified. Defaults toOgcAxisOrder.AUTO
. In this mode, Runtime will make its best guess using heuristics that are optimized for good results with the most popular WFS servers.- Returns:
- the axis order type
- Since:
- 100.5.0
-
setAxisOrder
public void setAxisOrder(OgcAxisOrder axisOrder)
Sets the axis order, which defines how coordinates are interpreted.Some WFS services return coordinates in (x,y) order, while others use (y,x). Setting this property to
OgcAxisOrder.SWAP
will result in all coordinates in geometries being swapped from what was sent by the server. Setting toOgcAxisOrder.NO_SWAP
will cause coordinates to be interpreted as-is. Defaults toOgcAxisOrder.AUTO
. In this mode, Runtime will make its best guess using heuristics that are optimized for good results with the most popular WFS servers.- Parameters:
axisOrder
- the axis order to use for this service- Throws:
IllegalArgumentException
- if axisOrder is null- Since:
- 100.5.0
- See Also:
OgcAxisOrder
-
getFilterAxisOrder
public OgcAxisOrder getFilterAxisOrder()
Gets the axis order of the filter, which determines how coordinates are ordered when sent to the server as part of spatial queries (those that specify a geometry).Some WFS services expect coordinates to be sent in (x,y) order, while others use (y,x). Use
OgcAxisOrder.SWAP
to send coordinates in (y,x) order. UseOgcAxisOrder.NO_SWAP
to send coordinates in (x,y) order. Defaults toOgcAxisOrder.AUTO
.- Returns:
- the axis order of the filter
- Since:
- 100.5.0
-
setFilterAxisOrder
public void setFilterAxisOrder(OgcAxisOrder filterAxisOrder)
Sets the axis order of the filter, which determines how coordinates are ordered when sent to the server as part of spatial queries (those that specify a geometry).Some WFS services expect coordinates to be sent in (x,y) order, while others use (y,x). Use
OgcAxisOrder.SWAP
to send coordinates in (y,x) order. UseOgcAxisOrder.NO_SWAP
to send coordinates in (x,y) order. Defaults toOgcAxisOrder.AUTO
- Parameters:
filterAxisOrder
- the filter axis order to use for this service- Throws:
IllegalArgumentException
- if filterAxisOrder is null- Since:
- 100.5.0
- See Also:
OgcAxisOrder
-
getUri
public String getUri()
Gets the URL used to create the WFS feature table.- Specified by:
getUri
in interfaceRemoteResource
- Returns:
- the service url of the WFS feature table
- Since:
- 100.5.0
-
populateFromServiceAsync
public ListenableFuture<FeatureQueryResult> populateFromServiceAsync(QueryParameters query, boolean clearCache, Iterable<String> outFields)
Executes an asynchronous method that populates the table with the results of a query. The table must be inServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE
mode.WFS is only compatible with a subset of possible queries defined by QueryParameters. The where clause only works when the table is backed by a service powered by GeoServer. Spatial queries (those that specify geometries) must use the Intersects spatial relationship.
- Parameters:
query
- the query to execute or default (empty) QueryParameters to get all features from the serviceclearCache
- true if this table should be cleared when this method is called, false if the result of the query should be appended to this tableoutFields
- the names of the fields to be populated or null/empty for the default set of fields- Returns:
- a ListenableFuture that represents the result of the query; the results will replace or be appended to this
table. The ListenableFuture indicates if the query
isDone()
; also allows cancellation. Callingget()
on the returned future may throw an ExecutionException with its cause set toIOException
if a network request fails. - Throws:
IllegalArgumentException
- if query is null- Since:
- 100.5.0
-
populateFromServiceAsync
public ListenableFuture<FeatureQueryResult> populateFromServiceAsync(String xmlRequest, boolean clearCache)
Executes an asynchronous method that populates the table with the results of the XML query. The table must be inServiceFeatureTable.FeatureRequestMode.MANUAL_CACHE
mode.The XML query must be made against the same feature type represented by the WFS feature table. The schema of the query result must match or be a subset of the schema of the table.
- Parameters:
xmlRequest
- an XML string representing the complete GetFeature request including but not limited to filters, joins, and aliasesclearCache
- if true, clears existing table data before populating with the query result; if false, the result of the query should be appended to this table- Returns:
- a ListenableFuture that represents the result of the query; the results will replace or be appended to this
table. The ListenableFuture indicates if the query
isDone()
; also allows cancellation. Callingget()
on the returned future may throw an ExecutionException with its cause set toIOException
if a network request fails. - Throws:
IllegalArgumentException
- if xmlRequest is null or empty- Since:
- 100.5.0
-
getCredential
public Credential getCredential()
Description copied from interface:RemoteResource
Gets theCredential
that is set on the network-enabled resource.Only applicable if the resource is secured.
- Specified by:
getCredential
in interfaceRemoteResource
- Returns:
- the Credential, or null if there is none
-
setCredential
public void setCredential(Credential credential)
Description copied from interface:RemoteResource
Sets aCredential
to be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.Only applicable if the resource is secured.
- Specified by:
setCredential
in interfaceRemoteResource
- Parameters:
credential
- the Credential to be used for authentication
-
getRequestConfiguration
public RequestConfiguration getRequestConfiguration()
Description copied from interface:RemoteResource
Gets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
.- Specified by:
getRequestConfiguration
in interfaceRemoteResource
- Returns:
- the
RequestConfiguration
used to modify network requests
-
setRequestConfiguration
public void setRequestConfiguration(RequestConfiguration requestConfiguration)
Description copied from interface:RemoteResource
Sets theRequestConfiguration
used to modify the parameters of network requests made by thisRemoteResource
. If not set, the globalRequestConfiguration
will be used (seeRequestConfiguration.getGlobalRequestConfiguration()
).- Specified by:
setRequestConfiguration
in interfaceRemoteResource
- Parameters:
requestConfiguration
- the RequestConfiguration used to modify network requests
-
-