Class GeoprocessingLinearUnit
Corresponds to GPLinearUnit parameter type in the service REST specification.
Geoprocessing tasks support a set of linear units defined inGeoprocessingLinearUnit.Unit
.
When a linear unit parameter is created with one of the supported GeoprocessingLinearUnit.Unit
the value is sent to the service using defined linear unit type.
When a geoprocessing linear unit parameter is created with a LinearUnit
, the value is converted to
meters if the type is not supported. For example if the provided linear unit is international miles, the value
is converted to meters since only US Survey Miles unit is supported in geoprocessing. After
a geoprocessing linear unit is created, the used linear unit type can be checked by calling
getLinearUnit()
.
When a geoprocessing linear unit is created with a supported linear unit, then no conversion takes place and the value is sent to the service using the defined type.
When a geoprocessing linear unit is returned as a output parameter, you can get the LinearUnit
using
the getLinearUnit()
method.
- Since:
- 100.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The list of geoprocessing linear unit types.Nested classes/interfaces inherited from class com.esri.arcgisruntime.tasks.geoprocessing.GeoprocessingParameter
GeoprocessingParameter.Type
-
Constructor Summary
ConstructorDescriptionCreates an instance.GeoprocessingLinearUnit
(double distance) Creates an instance.GeoprocessingLinearUnit
(double distance, LinearUnit linearUnit) Creates an instance.GeoprocessingLinearUnit
(double distance, LinearUnitId linearUnitId) Creates an instance.GeoprocessingLinearUnit
(double distance, GeoprocessingLinearUnit.Unit unit) Creates an instance with a distance and a directly supported unit - no conversion will be applied to the distance value.GeoprocessingLinearUnit
(LinearUnit linearUnit) Creates an instance.GeoprocessingLinearUnit
(LinearUnitId linearUnitId) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the distance value.Returns the linear unit that is used by the Geoprocessing service.getUnit()
Returns the unit.void
setDistance
(double distance) Sets the distance value.void
Sets the unit.
-
Constructor Details
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit()Creates an instance. Defaults to unit of meters and distance of 0.0.- Since:
- 100.0.0
-
GeoprocessingLinearUnit
public GeoprocessingLinearUnit(double distance) Creates an instance. Defaults to unit of meters.- Parameters:
distance
- the distance value- Since:
- 100.0.0
-
GeoprocessingLinearUnit
Creates an instance. The distance defaults to 0.0. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. UsegetLinearUnit()
to find out the actual unit being used and any distance set withsetDistance(double)
will be interpreted as being in that unit.- Parameters:
linearUnit
- the distance unit- Throws:
IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
Creates an instance. The distance defaults to 0.0. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters.- Parameters:
linearUnitId
- the distance unit- Throws:
IllegalArgumentException
- if linearUnitId is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
Creates an instance with a distance and a directly supported unit - no conversion will be applied to the distance value.- Parameters:
distance
- the distance valueunit
- the unit- Throws:
IllegalArgumentException
- if unit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
Creates an instance. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. This means that the distance property will return a different value to that set.- Parameters:
distance
- the distance valuelinearUnit
- the distance unit- Throws:
IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
GeoprocessingLinearUnit
Creates an instance. Note that if the given linear unit does not correspond to any of the values inGeoprocessingLinearUnit.Unit
, the unit will be changed to meters. This means that the distance property will return a different value to that set.- Parameters:
distance
- the distance valuelinearUnitId
- the ID of the distance unit- Throws:
IllegalArgumentException
- if linearUnitId is null- Since:
- 100.0.0
-
-
Method Details
-
getUnit
Returns the unit.- Returns:
- the unit
- Since:
- 100.0.0
-
getLinearUnit
Returns the linear unit that is used by the Geoprocessing service. This will be a linear unit that corresponds to an entry inGeoprocessingLinearUnit.Unit
.- Returns:
- the linear unit
- Since:
- 100.0.0
-
setUnit
Sets the unit. Changing the unit does not cause the distance value to be converted to the new unit.- Parameters:
unit
- the unit to set- Throws:
IllegalArgumentException
- if linearUnit is null- Since:
- 100.0.0
-
getDistance
public double getDistance()Returns the distance value.- Returns:
- the distance
- Since:
- 100.0.0
-
setDistance
public void setDistance(double distance) Sets the distance value. The distance will be interpreted to be in the unit returned bygetLinearUnit()
.- Parameters:
distance
- the distance- Since:
- 100.0.0
-