java.lang.Object
com.esri.arcgisruntime.geometry.GeometryBuilder
com.esri.arcgisruntime.geometry.PointBuilder
The point builder allows you to create and modify point geometries incrementally.
Point geometries are immutable and cannot be changed directly once created. The PointBuilder has a number of
constructors to allow you to create a new point, or you can edit an existing point using
setXY(double, double) or offsetBy(double, double).
Use GeometryBuilder.toGeometry() to return the new Point from the builder.
- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPointBuilder(double x, double y) Creates a new empty PointBuilder with the given x,y coordinates.PointBuilder(double x, double y, double z) Creates a new point builder with the given x,y coordinates and z value.PointBuilder(double x, double y, double z, double m) Creates a new point builder with the given x,y coordinates and z- and m values.PointBuilder(double x, double y, double z, double m, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates, z- and m values, and SpatialReference.PointBuilder(double x, double y, double z, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates, z value, and SpatialReference.PointBuilder(double x, double y, SpatialReference spatialReference) Creates a new point builder with the given x,y coordinates and SpatialReference.PointBuilder(Point point) Creates a point builder from the specified point.PointBuilder(SpatialReference spatialReference) Creates an empty point builder with the specifiedSpatialReference. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetM()Gets the current m value of the point being constructed.doublegetX()Gets the current x coordinate of the point being constructed.doublegetY()Gets the current y coordinate of the point being constructed.doublegetZ()Gets the current z value of the point being constructed.voidoffsetBy(double offsetX, double offsetY) Offsets the point by the given offsets for the x and y dimension.voidsetM(double m) Sets a new m value for the point being constructed.voidsetX(double x) Sets a new x coordinate for the point being constructed.voidsetXY(double x, double y) Sets new x,y coordinates for the point being constructed.voidsetY(double y) Sets a new y coordinate for the point being constructed.voidsetZ(double z) Sets a new z value for the point being constructed.Returns a newPointbased on the current state of this builder.Methods inherited from class com.esri.arcgisruntime.geometry.GeometryBuilder
create, create, getBuilderType, getExtent, getSpatialReference, hasCurves, hasM, hasZ, isEmpty, isSketchValid, replaceGeometry
-
Constructor Details
-
PointBuilder
Creates an empty point builder with the specifiedSpatialReference.The
SpatialReferencecannot be changed after instantiation.- Parameters:
spatialReference- the SpatialReference of the new builder- Since:
- 100.0.0
-
PointBuilder
Creates a point builder from the specified point.The
SpatialReferenceof the new point builder will match that of the specifiedPoint.- Parameters:
point- the point to initialize the new builder from- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y) Creates a new empty PointBuilder with the given x,y coordinates. The SpatialReference of the new builder will be null.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates and SpatialReference.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructedspatialReference- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y, double z) Creates a new point builder with the given x,y coordinates and z value. The SpatialReference of the new builder will be null.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructedz- the z value of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates, z value, and SpatialReference.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructedz- the z value of the point being constructedspatialReference- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
PointBuilder
public PointBuilder(double x, double y, double z, double m) Creates a new point builder with the given x,y coordinates and z- and m values. The SpatialReference of the new builder will be null.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructedz- the z value of the point being constructedm- the m value of the point being constructed- Since:
- 100.0.0
-
PointBuilder
Creates a new point builder with the given x,y coordinates, z- and m values, and SpatialReference.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructedz- the z value of the point being constructedm- the m value of the point being constructedspatialReference- the SpatialReference of the point being constructed- Since:
- 100.0.0
-
-
Method Details
-
getM
public double getM()Gets the current m value of the point being constructed.- Returns:
- the current m value
- Since:
- 100.0.0
-
setM
public void setM(double m) Sets a new m value for the point being constructed.- Parameters:
m- the new m value- Since:
- 100.0.0
-
getX
public double getX()Gets the current x coordinate of the point being constructed.- Returns:
- the current x coordinate
- Since:
- 100.0.0
-
setX
public void setX(double x) Sets a new x coordinate for the point being constructed.- Parameters:
x- the new x coordinate- Since:
- 100.0.0
-
getY
public double getY()Gets the current y coordinate of the point being constructed.- Returns:
- the current y coordinate
- Since:
- 100.0.0
-
setY
public void setY(double y) Sets a new y coordinate for the point being constructed.- Parameters:
y- the new y coordinate- Since:
- 100.0.0
-
getZ
public double getZ()Gets the current z value of the point being constructed.- Returns:
- the current z value
- Since:
- 100.0.0
- See Also:
-
setZ
public void setZ(double z) Sets a new z value for the point being constructed.The minimum z value is -6,356,752 meters, which is the approximate radius of the earth (the WGS 84 datum semi-minor axis). The maximum z value is 55,000,000 meters. Will return NAN if an error occurs.
- Parameters:
z- the new z value- Since:
- 100.0.0
- See Also:
-
setXY
public void setXY(double x, double y) Sets new x,y coordinates for the point being constructed.- Parameters:
x- the x coordinate of the point being constructedy- the y coordinate of the point being constructed- Since:
- 100.0.0
-
offsetBy
public void offsetBy(double offsetX, double offsetY) Offsets the point by the given offsets for the x and y dimension.- Parameters:
offsetX- the number of units to move the point on the x axisoffsetY- the number of units to move the point on the y axis- Since:
- 200.2.0
-
toGeometry
Returns a newPointbased on the current state of this builder. This method can be called as many times as required for any specific instance; it does not affect the state of the builder, and returns a new Point each time.- Specified by:
toGeometryin classGeometryBuilder- Returns:
- a new Point based on the current state of this builder
- Since:
- 100.0.0
-