Class QueryParameters


  • public final class QueryParameters
    extends Object
    Represents the input parameters for a query.
    Since:
    100.0.0
    • Constructor Detail

      • QueryParameters

        public QueryParameters()
        Creates a new instance.
        Since:
        100.0.0
    • Method Detail

      • getGeometry

        public Geometry getGeometry()
        Gets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship.
        Returns:
        the the geometry to use.
        Since:
        100.0.0
      • setGeometry

        public void setGeometry​(Geometry geometry)
        Sets the geometry that will be used to perform a spatial query, along with the indicated spatial relationship. This can be used in addition to an attribute query. FeatureTable.hasGeometry() must be true to use this method.
        Parameters:
        geometry - the geometry to use.
        Since:
        100.0.0
      • getSpatialRelationship

        public QueryParameters.SpatialRelationship getSpatialRelationship()
        Gets the spatial relationship.
        Returns:
        the spatial relationship.
        Since:
        100.0.0
      • setSpatialRelationship

        public void setSpatialRelationship​(QueryParameters.SpatialRelationship spatialRelationship)
        Sets the spatial relationship to compare a given geometry to the geometry of a feature table's feature.
        Parameters:
        spatialRelationship - the spatial relationship
        Throws:
        IllegalArgumentException - if input is null
        Since:
        100.0.0
      • getOutSpatialReference

        public SpatialReference getOutSpatialReference()
        Gets the spatial reference of the feature geometry in the result.
        Returns:
        the spatial reference of the feature geometry in the result
        Since:
        100.0.0
      • setOutSpatialReference

        public void setOutSpatialReference​(SpatialReference outSR)
        Sets the spatial reference of the feature geometry in the result.
        Parameters:
        outSR - the spatial reference of the feature geometry in the result. If null, then the output spatial reference is same as the spatial reference of the input geometry.
        Since:
        100.0.0
      • getInSpatialReference

        public SpatialReference getInSpatialReference()
        Gets the spatial reference of the set geometry.
        Returns:
        the spatial reference of the set geometry. If no geometry is set, then null.
        Since:
        100.0.0
      • setReturnGeometry

        public void setReturnGeometry​(boolean returnGeometry)
        Sets whether to return geometries of features in the query result. By default, is true. Excluding geometries may be recommended for queries to a service in order to reduce the amount of information received over a network.
        Parameters:
        returnGeometry - true to return geometries in the result; otherwise false.
        Since:
        100.0.0
      • isReturnGeometry

        public boolean isReturnGeometry()
        Gets whether geometries of features are returned in the query result.
        Returns:
        true if geometries are returned in the result; false otherwise
        Since:
        100.0.0
      • getObjectIds

        public List<Long> getObjectIds()
        Gets a mutable list of object IDs of the features to be queried. By default this list is empty. Add to this list to query for an object ID.
        Returns:
        the object IDs of the features to be queried
        Since:
        100.0.0
      • getOrderByFields

        public List<QueryParameters.OrderBy> getOrderByFields()
        Gets a mutable list of OrderBy objects, indicating the fields the results are sorted by, and the order in which they are sorted. By default this list is empty. Add instances of OrderBy to this list to sort the query result.
        Returns:
        a mutable list of OrderBy objects
        Since:
        100.0.0
      • setMaxFeatures

        public void setMaxFeatures​(int maxFeatures)
        Sets the maximum number of features to be included in the result. If 0, then there is no limit set on the number of features.
        Parameters:
        maxFeatures - the maximum number of features to be included in the result
        Throws:
        IllegalArgumentException - if input is less than 0
        Since:
        100.0.0
      • getMaxFeatures

        public int getMaxFeatures()
        Gets the maximum number of features to be included in the result.
        Returns:
        the maximum number of features to be included in the result.
        Since:
        100.0.0
      • setResultOffset

        public void setResultOffset​(int resultOffset)
        Sets the offset of results to fetch.

        If providing a result offset to support paging of results, you must also set a maximum features value. If result offset is set, but maximum features is not, the offset will be ignored.

        For consistent ordering of results, include a QueryParameters.OrderBy in the list provided by getOrderByFields().

        Parameters:
        resultOffset - the offset of results to fetch
        Since:
        100.2.1
      • getResultOffset

        public int getResultOffset()
        Gets the offset of results to fetch.

        If providing a result offset to support paging of results, you must also set a maximum features value. If result offset is set, but maximum features is not, the offset will be ignored.

        Returns:
        the offset of results to fetch
        Since:
        100.2.1
      • setTimeExtent

        public void setTimeExtent​(TimeExtent timeExtent)
        Sets the time extent of the query. The time extent can be null to indicate an infinite extent.
        Parameters:
        timeExtent - the time extent
        Since:
        100.3.0
      • getTimeExtent

        public TimeExtent getTimeExtent()
        Returns the time extent of the query.
        Returns:
        the time extent, or null if no time extent is set
        Since:
        100.3.0
      • getMaxAllowableOffset

        public double getMaxAllowableOffset()
        Gets the maximum allowable offset used for generalizing geometries returned by the query operation. The default is 0. If 0 is specified the value is not passed to the server in the query operation. The offset is in the units of the outSpatialReference. If an outSpatialReference is not defined, the spatial reference of the service is used.
        Returns:
        the maximum allowable offset
        Since:
        100.4.0
      • setMaxAllowableOffset

        public void setMaxAllowableOffset​(double maxAllowableOffset)
        Sets the maximum allowable offset used for generalizing geometries returned by the query operation. The default is 0. If 0 is specified the value is not passed to the server in the query operation. The offset is in the units of the outSpatialReference. If an outSpatialReference is not defined, the spatial reference of the service is used.
        Parameters:
        maxAllowableOffset - the maximum allowable offset
        Since:
        100.4.0