com.supermap.data
类 GeoLineM
- java.lang.Object
-
- com.supermap.data.Geometry
-
- com.supermap.data.GeoLineM
-
-
构造器概要
构造器 构造器和说明 GeoLineM()构造一个新的 GeoLineM 对象。GeoLineM(GeoLineM geoLineM)根据给定的 GeoLineM 对象构造一个与其完全相同的新对象。GeoLineM(PointMs pointMs)根据指定的参数来构造一个 GeoLineM 的新对象。
-
方法概要
所有方法 静态方法 实例方法 具体方法 限定符和类型 方法和说明 intaddPart(PointMs pointMs)向路由对象追加一个子对象。voidcalculateNoM(boolean isIgnoreGap)通过插值计算得到无 M 值处点对象的 M 值。booleancalibrateLineM(GeoLineM geoLineM, CalibrateMode method, boolean isIgnoreGap)根据给定的路由对象线段来校正路由对象。booleancalibrateLineM(PointMs pointMs, CalibrateMode method, boolean isIgnoreGap)根据路由点串校正路由对象的 M 值。static GeoLineMclip(GeoLineM geometry, GeoRegion clipGeometry)根据给定的裁剪区域对指定的路由对象进行裁剪。GeoLineMclone()返回当前 GeoLineM 对象的一个拷贝。GeoLineconvertToLine()将该路由对象转换为二维线几何对象,成功返回线几何对象。GeoRegionconvertToRegion()将该路由对象转换为面几何对象,成功返回面几何对象。voiddispose()释放对象所占用的资源。booleanextrapolateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, CalibrateMode method)对路由对象的 BEFORE 与 AFTER 位置处的 M 值进行插值。Point2DfindPointOnLineByDistance(double distance)在路由上以指定的距离找点,查找的起始点为二维线的起始点。doublegetDistanceAtM(double measure)返回指定 M 值对应的点对象到路由对象起点的距离。doublegetDistanceAtM(double measure, boolean isIgnoreGap)返回指定 M 值对应的点对象到路由对象起点的距离。doublegetDistanceAtM(double distance, int subIndex, boolean isIgnoreGap)返回指定 M 值对应的点对象到指定路由子对象起点的距离。doublegetLength()返回路由对象的长度,单位与数据集的单位相同。doublegetMAtDistance(double distance)返回指定距离处的点对象的 M 值。doublegetMAtDistance(double distance, boolean isIgnoreGap)返回指定距离处的点对象的 M 值。doublegetMAtDistance(double distance, int subindex, boolean isIgnoreGap)返回指定距离处的点对象的 M 值。doublegetMAtPoint(Point2D point2D, double tolerance, boolean isIgnoreGap)返回路由对象指定点处的 M 值。doublegetMaxM()返回最大线性度量值。doublegetMinM()返回最小线性度量值。PointMsgetPart(int index)用于返回线对象中指定序号的子对象的点串,成功返回该路由点对象,失败返回空值。intgetPartCount()返回路由对象的子对象个数。Point2DgetPointAtDistance(double distance)返回指定距离处对应的点对象。Point2DgetPointAtDistance(double distance, boolean isIgnoreGap)返回指定距离处对应的点对象。Point2DgetPointAtM(double measure)返回指定 M 值对应的点对象。Point2DgetPointAtM(double measure, double offset, boolean isIgnoreGap)返回指定 M 值对应的点对象。GeoLinegetSubCurveAtM(double fromMeasure, double toMeasure)返回指定 M 值范围的路由对象线段对应的线对象。GeoLineMgetSubLineMAtM(double startMeasure, double endMeasure)返回指定起始 M 值和终止 M 值对应的路由对象。intindexOf(PointMs part)返回指定路由点集合所表示的子对象在此路由对象中的序号。booleaninsertPart(int index, PointMs pointMs)用于往路由对象中的指定位置插入一个路由子对象,成功则返回 true,否则返回 false。booleaninterpolateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, CalibrateMode method)对路由对象的 INTERVAL 位置处的 M 值进行插值。booleanjoint(GeoLineM otherLineM)连接两条路由对象,使当前路由对象的尾节点与另一路由对象的首节点相连。static GeoLineMmakeLineM(GeoLine geoLine, PointMs pointMs)由指定的线对象和路由点集合来生成新的路由对象。Geometrymirror(Point2D startPoint, Point2D endPoint)返回当前路由对象关于指定线段对称的几何对象,即获取路由对象的镜像。voidoffset(double dx, double dy)将此路由对象偏移指定的量。voidoffsetMeasure(double measure)按照 M 值偏移量整体修改路由对象的 M 值。booleanremovePart(int index)删除路由对象中的指定序号的子对象。booleanreverse()改变该路由对象各个子对象的方向。booleanreverseMOrder()将路由对象的 M 值倒序排列,即改变刻度标记的方向。voidrotate(Point2D basePoint, double angle)以指定点为基点将此路由对象旋转指定的角度,逆时针为正方向,角度以度为单位。voidsetMAsDistance(double originM)按照距离重新设置路由对象的 M 值。voidsetMAsDistance(double originM, double scale)按照距离重新设置路由对象的 M 值。voidsetMAsDistance(double originM, double scale, boolean isIgnoreGap)按照距离重新设置路由对象的 M 值。booleansetMAtPoint(Point2D point2D, double measure)设置路由对象指定点处的 M 值。booleansetMAtPoint(Point2D point2D, double measue, double tolerance, WhereToCalibrate wheretocalibrate)设置路由对象指定点处的 M 值。booleansetPart(int index, PointMs pointMs)在指定的位置上修改二维线子对象,成功则返回 true。booleansplit(Point2D splitPoint, GeoLineM geoLineM1, GeoLineM geoLineM2)根据指定的点对象来分割路由对象。static GeoLineMunion(GeoLineM geolineM, GeoLineM otherLineM)将两条路由对象合并为一条新的路由对象。booleanupdateM(int fromIndex, int toIndex, double fromMeasure, double toMeasure, WhereToCalibrate wheretoCalibrate, CalibrateMode calibrateMode)更新路由对象的 M 值。booleanupdateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, WhereToCalibrate whereToCalibrate, CalibrateMode method)更新路由对象的 M 值。
-
-
-
构造器详细资料
-
GeoLineM
public GeoLineM()
构造一个新的 GeoLineM 对象。
-
GeoLineM
public GeoLineM(GeoLineM geoLineM)
根据给定的 GeoLineM 对象构造一个与其完全相同的新对象。- 参数:
geoLineM- 指定的 GeoLineM 对象。
-
GeoLineM
public GeoLineM(PointMs pointMs)
根据指定的参数来构造一个 GeoLineM 的新对象。- 参数:
pointMs- 构成路由的路由点集合。
-
-
方法详细资料
-
getLength
public double getLength()
返回路由对象的长度,单位与数据集的单位相同。- 返回:
- 路由对象的长度。
- Default:
- 默认值为 0。
-
getPartCount
public int getPartCount()
返回路由对象的子对象个数。对于简单对象的该方法的返回值为1,路由对象清空后,该方法的返回值为0。
- 返回:
- 路由对象的子对象个数。
- Default:
- 默认值为 0。
-
getMaxM
public double getMaxM()
返回最大线性度量值。- 返回:
- 最大线性度量值。
- Default:
- 默认值为 0。
-
getMinM
public double getMinM()
返回最小线性度量值。- 返回:
- 最小线性度量值。
- Default:
- 默认值为 0。
-
addPart
public int addPart(PointMs pointMs)
向路由对象追加一个子对象。- 参数:
pointMs- 子对象的路由点串。- 返回:
- 如果成功,返回添加子对象的序号。
-
removePart
public boolean removePart(int index)
删除路由对象中的指定序号的子对象。当序号为负值或者不小于
getPartCount()方法的返回值时抛出 IndexOutOfBoundsException。- 参数:
index- int 指定的子对象索引号。- 返回:
- 删除成功,返回 true;否则返回 false。
-
convertToRegion
public GeoRegion convertToRegion()
将该路由对象转换为面几何对象,成功返回面几何对象。对于没有封闭的路由对象,转换为面几何对象时,会把首尾自动连起来。
- 返回:
- GeoRegion 转换成功返回面几何对象。
- 抛出:
java.lang.UnsupportedOperationException- 当此GeoLineM对象实例的某个子对象的点数少于3时。
-
findPointOnLineByDistance
public Point2D findPointOnLineByDistance(double distance)
在路由上以指定的距离找点,查找的起始点为二维线的起始点。有关详情,请参考GeoLine.findPointOnLineByDistance()方法。 当传入的距离大于路由的总长度,返回路由的末端点。- 参数:
distance- 指定的距离。单位与该路由对象所属数据集的单位相同。- 返回:
- Point2D 查找成功返回点,否则返回 null。
- 抛出:
java.lang.IllegalArgumentException- 当传入的为负值时。
-
getPart
public PointMs getPart(int index)
用于返回线对象中指定序号的子对象的点串,成功返回该路由点对象,失败返回空值。- 参数:
index- 子对象的序号。- 返回:
- PointMs 线对象中指定序号的子对象的点串。
-
insertPart
public boolean insertPart(int index, PointMs pointMs)用于往路由对象中的指定位置插入一个路由子对象,成功则返回 true,否则返回 false。- 参数:
index- 插入的位置,缺省则从0开始。pointMs- 插入对象的路由点串。- 返回:
- boolean 成功则返回 true,否则返回 false。
- 抛出:
java.lang.IndexOutOfBoundsException- 当序号为负值或者不小于getPartCount()方法的返回值时。
-
indexOf
public int indexOf(PointMs part)
返回指定路由点集合所表示的子对象在此路由对象中的序号。- 参数:
part- 指定的路由点集合对象。- 返回:
- 指定路由点集合所表示的子对象在此路由对象中的序号。如果该子对象不存在,就返回-1。
-
convertToLine
public GeoLine convertToLine()
将该路由对象转换为二维线几何对象,成功返回线几何对象。- 返回:
- 转换成功返回线几何对象。
-
reverse
public boolean reverse()
改变该路由对象各个子对象的方向。即将组成各子对象的点串的顺序进行颠倒。- 返回:
- 成功则返回 true,否则返回 false。
-
setPart
public boolean setPart(int index, PointMs pointMs)在指定的位置上修改二维线子对象,成功则返回 true。- 参数:
index- 被修改的子对象的序号。pointMs- 子对象的点串。- 返回:
- 成功返回 true,否则返回 false。
-
mirror
public Geometry mirror(Point2D startPoint, Point2D endPoint)
返回当前路由对象关于指定线段对称的几何对象,即获取路由对象的镜像。- 参数:
startPoint- 指定的线段的起点。endPoint- 指定的线段的终点。- 返回:
- 路由对象的镜像。
-
clone
public GeoLineM clone()
返回当前 GeoLineM 对象的一个拷贝。
-
reverseMOrder
public boolean reverseMOrder()
将路由对象的 M 值倒序排列,即改变刻度标记的方向。- 返回:
- boolean 一个布尔值,表示改变刻度标记方向是否成功,成功则返回 true,否则返回 false。
-
offset
public void offset(double dx, double dy)将此路由对象偏移指定的量。
-
offsetMeasure
public void offsetMeasure(double measure)
按照 M 值偏移量整体修改路由对象的 M 值。- 参数:
measure- 指定的 M 值偏移量。
-
rotate
public void rotate(Point2D basePoint, double angle)
以指定点为基点将此路由对象旋转指定的角度,逆时针为正方向,角度以度为单位。
-
setMAsDistance
public void setMAsDistance(double originM)
按照距离重新设置路由对象的 M 值。- 参数:
originM- 起始点的 M 值。
-
setMAsDistance
public void setMAsDistance(double originM, double scale)按照距离重新设置路由对象的 M 值。- 参数:
originM- 起始点的 M 值。scale- M 值的缩放比例。若缩放比例为 2,则路由对象的 M 值为实际距离的 2 倍。
-
setMAsDistance
public void setMAsDistance(double originM, double scale, boolean isIgnoreGap)按照距离重新设置路由对象的 M 值。- 参数:
originM- 起始点的 M 值。scale- M 值的缩放比例。若缩放比例为 2,则路由对象的 M 值为实际距离的 2 倍。isIgnoreGap- 是否忽略路由对象子对象间的间隔。
-
getPointAtM
public Point2D getPointAtM(double measure)
返回指定 M 值对应的点对象。- 参数:
measure- 指定的 M 值。- 返回:
- 指定 M 值对应的点对象。
-
getPointAtM
public Point2D getPointAtM(double measure, double offset, boolean isIgnoreGap)
返回指定 M 值对应的点对象。- 参数:
measure- 指定的 M 值。offset- M 值的偏移量。若 measure = 10,offset = 2,则指定 M 值范围为[8,12]。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 指定 M 值对应的点对象。
-
getPointAtDistance
public Point2D getPointAtDistance(double distance)
返回指定距离处对应的点对象。- 参数:
distance- 指定的距离。该距离指的是该点到路由线路起点的距离。单位与该路由对象所属数据集的单位相同。- 返回:
- 指定距离处对应的点对象。
-
getPointAtDistance
public Point2D getPointAtDistance(double distance, boolean isIgnoreGap)
返回指定距离处对应的点对象。- 参数:
distance- 指定的距离。该距离指的是该点到路由线路起点的距离。单位与该路由对象所属数据集的单位相同。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 指定距离处对应的点对象。
-
getSubLineMAtM
public GeoLineM getSubLineMAtM(double startMeasure, double endMeasure)
返回指定起始 M 值和终止 M 值对应的路由对象。- 参数:
startMeasure- 指定的起始 M 值。endMeasure- 指定的终止 M 值。- 返回:
- 指定的起始 M 值和终止 M 值对应的路由对象。
-
getMAtDistance
public double getMAtDistance(double distance)
返回指定距离处的点对象的 M 值。- 参数:
distance- 指定的距离。该距离指的是该点到路由线路起点的距离。单位与该路由对象所属数据集的单位相同。- 返回:
- 指定距离处的点对象的 M 值。
-
getMAtDistance
public double getMAtDistance(double distance, boolean isIgnoreGap)返回指定距离处的点对象的 M 值。- 参数:
distance- 指定的距离。该距离指的是该点到路由线路起点的距离。单位与该路由对象所属数据集的单位相同。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 指定距离处的点对象的 M 值。
-
getMAtDistance
public double getMAtDistance(double distance, int subindex, boolean isIgnoreGap)返回指定距离处的点对象的 M 值。- 参数:
distance- 指定的距离。该距离指的是到路由线路起点的距离。单位与该路由对象所属数据集的单位相同。subindex- 待返回的路由子对象的序号。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 指定距离处的点对象的 M 值。
-
getDistanceAtM
public double getDistanceAtM(double measure)
返回指定 M 值对应的点对象到路由对象起点的距离。- 参数:
measure- 指定的 M 值。- 返回:
- 指定 M 值对应的点对象到路由对象起点的距离。单位与该路由对象所属数据集的单位相同。
-
getDistanceAtM
public double getDistanceAtM(double measure, boolean isIgnoreGap)返回指定 M 值对应的点对象到路由对象起点的距离。- 参数:
measure- 指定的 M 值。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 指定 M 值对应的点对象到路由对象起点的距离。单位与该路由对象所属数据集的单位相同。
-
getDistanceAtM
public double getDistanceAtM(double distance, int subIndex, boolean isIgnoreGap)返回指定 M 值对应的点对象到指定路由子对象起点的距离。- 参数:
distance- 指定的 M 值。subIndex- 指定的路由子对象的索引值。isIgnoreGap- 指定是否忽略子对象之间的距离。- 返回:
- 指定 M 值对应的点对象到指定路由子对象起点的距离。单位与该路由对象所属数据集的单位相同。
-
setMAtPoint
public boolean setMAtPoint(Point2D point2D, double measure)
设置路由对象指定点处的 M 值。- 参数:
point2D- 指定的点对象。measure- 给定的 M 值。- 返回:
- 一个布尔值,表示设置是否成功,true 表示成功,false 表示失败。
-
setMAtPoint
public boolean setMAtPoint(Point2D point2D, double measue, double tolerance, WhereToCalibrate wheretocalibrate)
设置路由对象指定点处的 M 值。- 参数:
point2D- 指定的点对象。measue- 给定的 M 值。tolerance- 容限值。用于判断指定的点是否在路由对象上,若点到路由对象垂足的距离大于该值,则视为指定的点无效,不执行设置。单位与该路由对象所属数据集的单位相同。wheretocalibrate- 对路由(线路)对象 M 值进行校正的位置类型,对于位置的定义请参见 WhereToCalibrate 枚举。- 返回:
- 一个布尔值,表示设置是否成功,true 表示成功,false 表示失败。
-
getMAtPoint
public double getMAtPoint(Point2D point2D, double tolerance, boolean isIgnoreGap)
返回路由对象指定点处的 M 值。- 参数:
point2D- 指定的点对象。tolerance- 容限值。用于判断指定的点是否在路由对象上,若点到路由对象垂足的距离大于该值,则视为指定的点无效,不执行返回。单位与该路由对象所属数据集的单位相同。isIgnoreGap- 是否忽略子对象之间的间距。- 返回:
- 路由对象指定点处的 M 值。
-
getSubCurveAtM
public GeoLine getSubCurveAtM(double fromMeasure, double toMeasure)
返回指定 M 值范围的路由对象线段对应的线对象。- 参数:
fromMeasure- 起始 M 值。toMeasure- 终止 M 值。- 返回:
- 指定 M 值区间对应的线对象。
-
union
public static GeoLineM union(GeoLineM geolineM, GeoLineM otherLineM)
将两条路由对象合并为一条新的路由对象。- 参数:
geolineM- 用于合并的路由对象。otherLineM- 用于合并的另一路由对象。- 返回:
- 一个布尔值,表示合并是否成功,true 表示成功,false 表示失败。
-
joint
public boolean joint(GeoLineM otherLineM)
连接两条路由对象,使当前路由对象的尾节点与另一路由对象的首节点相连。与合并(union() 方法)的处理不同,连接(joint() 方法)的处理方式如下图所示:

- 参数:
otherLineM- 待追加的路由对象。- 返回:
- 一个布尔值,表示连接是否成功,true 表示成功,false 表示失败。
-
split
public boolean split(Point2D splitPoint, GeoLineM geoLineM1, GeoLineM geoLineM2)
根据指定的点对象来分割路由对象。- 参数:
splitPoint- 分割点,此点需要在路线对象上。geoLineM1- 分割后第一个的路由对象。geoLineM2- 分割后第二个的路由对象。- 返回:
- 一个布尔值,表示分割是否成功,true 表示成功,false 表示失败。
-
calibrateLineM
public boolean calibrateLineM(PointMs pointMs, CalibrateMode method, boolean isIgnoreGap)
根据路由点串校正路由对象的 M 值。- 参数:
pointMs- 指定的路由点串。method- 对路由对象 M 值进行校正的方式。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 一个布尔值,表示校正是否成功,true 表示成功,false 表示失败。
-
calibrateLineM
public boolean calibrateLineM(GeoLineM geoLineM, CalibrateMode method, boolean isIgnoreGap)
根据给定的路由对象线段来校正路由对象。- 参数:
geoLineM- 给定的路由对象线段。method- 对路由对象 M 值进行校正的方式。isIgnoreGap- 是否忽略子对象之间的距离。- 返回:
- 一个布尔值,表示校正是否成功,true 表示成功,false 表示失败。
-
clip
public static GeoLineM clip(GeoLineM geometry, GeoRegion clipGeometry)
根据给定的裁剪区域对指定的路由对象进行裁剪。- 参数:
geometry- 待裁剪的路由对象。clipGeometry- 给定的裁剪区域,为面区域。- 返回:
- 裁剪后的路由对象。
-
updateM
public boolean updateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, WhereToCalibrate whereToCalibrate, CalibrateMode method)
更新路由对象的 M 值。- 参数:
fromPoint- 待更新线路的起始点。toPoint- 待更新线路的终止点。fromMeasure- 待更新线路的起始点 M 值。toMeasure- 待更新线路的终止点 M 值。tolerance- 容限值。用于判断指定的起始点和终止点是否均在路由对象上,若两点到路由对象垂足的距离有其一大于该值,则视为指定的点无效,不执行更新。单位与该路由对象所属数据集的单位相同。whereToCalibrate- 对路由(线路)对象 M 值进行校正的位置类型。method- 对路由对象 M 值进行校正的方式。- 返回:
- 一个布尔值,表示更新是否成功,true 表示成功,false 表示失败。
-
updateM
public boolean updateM(int fromIndex, int toIndex, double fromMeasure, double toMeasure, WhereToCalibrate wheretoCalibrate, CalibrateMode calibrateMode)更新路由对象的 M 值。- 参数:
fromIndex- 指定的待更新路由的起始点的索引值。toIndex- 指定的待更新路由的终止点的索引值。fromMeasure- 指定的待更新路由的起始点 M 值。toMeasure- 指定的待更新路由的终止点 M 值。wheretoCalibrate- 指定的对路由对象 M 值进行校正的位置类型。calibrateMode- 指定的对路由对象 M 值进行校正的方式。- 返回:
- 一个布尔值,表示更新是否成功,如果成功返回 true,否则返回 false。
-
interpolateM
public boolean interpolateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, CalibrateMode method)
对路由对象的 INTERVAL 位置处的 M 值进行插值。关于位置的定义请参见 WhereToCalibrate 枚举。- 参数:
fromPoint- 待插值线路的起始点。toPoint- 待插值线路的终止点。fromMeasure- 待插值线路的起始点 M 值。toMeasure- 待插值线路的终止点 M 值。tolerance- 容限值。用于判断指定的起始点和终止点是否均在路由对象上,若两点到路由对象垂足的距离有其一大于该值,则视为指定的点无效,不执行插值。单位与该路由对象所属数据集的单位相同。method- 对路由对象 M 值进行校正的方式。- 返回:
- 一个布尔值,表示插值是否成功,true 表示成功,false 表示失败。
-
extrapolateM
public boolean extrapolateM(Point2D fromPoint, Point2D toPoint, double fromMeasure, double toMeasure, double tolerance, CalibrateMode method)
对路由对象的 BEFORE 与 AFTER 位置处的 M 值进行插值。关于位置的定义请参见 WhereToCalibrate 枚举。- 参数:
fromPoint- 待插值线路的起始点。toPoint- 待插值线路的终止点。fromMeasure- 待插值线路的起始点 M 值。toMeasure- 待插值线路的终止点 M 值。tolerance- 容限值。用于判断指定的起始点和终止点是否均在路由对象上,若两点到路由对象垂足的距离有其一大于该值,则视为指定的点无效,不执行插值。单位与该路由对象所属数据集的单位相同。method- 对路由对象 M 值进行校正的方式。- 返回:
- 一个布尔值,表示插值是否成功,true 表示成功,false 表示失败。
-
calculateNoM
public void calculateNoM(boolean isIgnoreGap)
通过插值计算得到无 M 值处点对象的 M 值。- 参数:
isIgnoreGap- 是否忽略子对象之间的距离。
-
-