ArcGIS.Feature (ArcGIS v1.0.2)

View Source

Access to features in an ArcGIS feature service.

Summary

Functions

Deletes features from a layer using a where clause

Create a new feature struct from a map of data, such as returned by ArcGIS

Add, update, and/or delete features from one or more layers. Defaults to rolling back on failure.

Query features in a Feature Service layer or table

Conforms a list of features to ArcGIS requirements, making them appropriate for e.g. use in mutations

Types

feature_geometry()

@type feature_geometry() :: map()

features_by_global_id()

@type features_by_global_id() :: [String.t()]

features_by_id()

@type features_by_id() :: [non_neg_integer()]

mutate_option()

@type mutate_option() ::
  {:rollback_on_failure, boolean()}
  | {:upload_format, upload_format()}
  | {:use_global_ids, boolean()}

mutate_options()

@type mutate_options() :: [ArcGIS.Portal.request_option() | mutate_option()]

mutations()

@type mutations() :: %{
  optional(:create) => [t()],
  optional(:updates) => [t()],
  optional(:delete) => features_by_id() | features_by_global_id()
}

mutations_by_layer_id()

@type mutations_by_layer_id() :: %{required(non_neg_integer()) => mutations()}

t()

@type t() :: %{
  attributes: %{required([key :: String.t()]) => term()},
  geometry: feature_geometry()
}

An ArcGIS feature made up of attributes and geometry

upload_format()

@type upload_format() :: :json | :pbf

Functions

delete(service, layer_id, where_clause, options \\ [])

@spec delete(
  ArcGIS.Feature.Service.t(),
  layer_id :: non_neg_integer(),
  where_clause :: String.t(),
  options :: ArcGIS.Portal.request_options()
) ::
  {:ok, ArcGIS.Portal.ResultSet.t()}
  | {:ok, term()}
  | {:error, reason :: String.t()}

Deletes features from a layer using a where clause

from_map(data, metadata)

@spec from_map(source :: map(), metadata :: map()) :: t()

Create a new feature struct from a map of data, such as returned by ArcGIS

mutate(service, mutations, options \\ [])

@spec mutate(
  ArcGIS.Feature.Service.t(),
  mutations :: mutations_by_layer_id(),
  options :: mutate_options()
) ::
  {:ok, ArcGIS.Portal.ResultSet.t()}
  | {:ok, term()}
  | {:error, reason :: String.t()}

Add, update, and/or delete features from one or more layers. Defaults to rolling back on failure.

query(feature_service, layer_id, options \\ [])

@spec query(
  ArcGIS.Feature.Service.t(),
  layer_id :: non_neg_integer(),
  ArcGIS.Portal.request_options()
) ::
  {:ok, ArcGIS.Portal.ResultSet.t()} | {:error, term()}

Query features in a Feature Service layer or table

sanitize(features, layer_id, service)

@spec sanitize(
  features :: [t()],
  layer_id :: non_neg_integer(),
  service :: ArcGIS.Feature.Service.t()
) ::
  [t()]

Conforms a list of features to ArcGIS requirements, making them appropriate for e.g. use in mutations