ArcGIS. Portal
(ArcGIS v1.0.2)
View Source
An ArcGIS Portal. This may refer to an ArcGIS Online endpoint or an ArcGIS Enterprise installation.
Summary
Types
A portal item ID
The configuration of an ArcGIS portal necessary for its use, in particular the base_url
A function that transforms raw ArcGIS results into a more prefereable form. Both one- and two-arity functions are supported, with the two arity receiving a map of metadata including such things as the spatial reference if available.
Functions
Returns the default portal. The portal (if any) defined in the application configuration will be used, with ArcGIS Online used as the ultimate fallback.
Discovers the version, type (:online or :enterprise), etc. of a portal and returns a new %ArcGIS.Portal{} with this information
Performs an HTTP GET request, checking for errors.
Create a t:Portal.t/0 from its base URL.
Performs an HTTP POST request, checking for errors.
Returns information about the Portal using the self query
Types
@type aggregate() :: %{type: aggregate_type(), field: String.t(), name: String.t()}
@type aggregate_type() :: :avg | :count | :max | :min | :sum
@type form_data() :: map()
@type get_options() :: request_option()
@type id() :: String.t()
A portal item ID
@type portal_options() :: [portal_option()]
@type portal_type() :: :online | :enterprise | :unknown
@type post_options() :: request_option()
@type query_option() :: {:is_features_query?, boolean()} | {:aggregates, [aggregate()]} | {:fields, [String.t()]} | {:geometry?, boolean()} | {:limit, non_neg_integer()} | {:offset, non_neg_integer()} | {:order_by, order_by_field() | [order_by_field()]} | {:response_format, response_format()} | {:where, String.t()}
@type request_option() :: portal_option() | query_option() | {:transform, transform_fn()}
@type request_options() :: [request_option()]
@type response_format() :: :geojson | :htmnl | :json | :pbf
@type t() :: %ArcGIS.Portal{ base_url: URI.t(), help_url: URI.t() | :unknown, type: portal_type(), verify_tls: boolean(), version: portal_version() }
The configuration of an ArcGIS portal necessary for its use, in particular the base_url
@type transform_fn() :: (source :: map() -> transformed :: term()) | (source :: map(), metadata :: map() -> transformed :: term())
A function that transforms raw ArcGIS results into a more prefereable form. Both one- and two-arity functions are supported, with the two arity receiving a map of metadata including such things as the spatial reference if available.
Functions
@spec default_portal() :: t()
Returns the default portal. The portal (if any) defined in the application configuration will be used, with ArcGIS Online used as the ultimate fallback.
@spec discover((portal_url :: String.t()) | t(), options :: [portal_option()]) :: {:ok, t()} | {:error, reason :: String.t()}
Discovers the version, type (:online or :enterprise), etc. of a portal and returns a new %ArcGIS.Portal{} with this information
@spec geometry_module_for(esri_type :: String.t(), z? :: boolean(), m? :: boolean()) :: geometry_struct :: atom()
@spec geometry_module_for(esri_type :: String.t(), z? :: boolean(), m? :: boolean()) :: geometry_struct :: atom()
@spec geometry_module_for(esri_type :: String.t(), z? :: boolean(), m? :: boolean()) :: geometry_struct :: atom()
@spec geometry_module_for(esri_type :: String.t(), z? :: boolean(), m? :: boolean()) :: geometry_struct :: atom()
@spec get(t(), resource :: String.t() | URI.t(), [get_options()]) :: {:ok, ArcGIS.Portal.ResultSet.t() | map() | term()} | {:error, reason :: String.t()}
Performs an HTTP GET request, checking for errors.
If the results are paged, then an %ArcGIS.Portal.ResultSet{} with the next offset and results is returned.
Queries that result in a single, unpaged response are returned as a map.
Passing in a transform function with the transform option allows processing the returned data into a
preferred shape (e.g. a struct) when the query is successful. In the case of responses with multiple results,
the transform function will be applied to each result.
Create a t:Portal.t/0 from its base URL.
@spec post(t(), resource :: String.t() | URI.t(), form_data(), [post_options()]) :: {:ok, ArcGIS.Portal.ResultSet.t() | map() | term()} | {:error, reason :: String.t()}
Performs an HTTP POST request, checking for errors.
If the results are paged, then an %ArcGIS.Portal.ResultSet{} with the next offset and results is returned.
Queries that result in a single, unpaged response are returned as a map.
Passing in a transform function with the transform option allows processing the returned data into a
preferred shape (e.g. a struct) when the query is successful. In the case of responses with multiple results,
the transform function will be applied to each result.
@spec self(t(), options :: [portal_option()]) :: {:ok, map()} | {:error, reason :: String.t()}
Returns information about the Portal using the self query