提交 c8d9c301 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use CoordinateSequence.getX() and getY()

上级 c754b3b4
...@@ -425,14 +425,13 @@ public final class JTSUtils { ...@@ -425,14 +425,13 @@ public final class JTSUtils {
private static void addRing(CoordinateSequence sequence, Target target, int size) { private static void addRing(CoordinateSequence sequence, Target target, int size) {
// 0 or 4+ are valid // 0 or 4+ are valid
if (size >= 4) { if (size >= 4) {
double startX = toCanonicalDouble(sequence.getOrdinate(0, X)), double startX = toCanonicalDouble(sequence.getX(0)), startY = toCanonicalDouble(sequence.getY(0));
startY = toCanonicalDouble(sequence.getOrdinate(0, Y));
addCoordinate(sequence, target, 0, size, startX, startY); addCoordinate(sequence, target, 0, size, startX, startY);
for (int i = 1; i < size - 1; i++) { for (int i = 1; i < size - 1; i++) {
addCoordinate(sequence, target, i, size); addCoordinate(sequence, target, i, size);
} }
double endX = toCanonicalDouble(sequence.getOrdinate(size - 1, X)), double endX = toCanonicalDouble(sequence.getX(size - 1)), //
endY = toCanonicalDouble(sequence.getOrdinate(size - 1, Y)); endY = toCanonicalDouble(sequence.getY(size - 1));
/* /*
* TODO OGC 06-103r4 determines points as equal if they have the * TODO OGC 06-103r4 determines points as equal if they have the
* same X and Y coordinates. Should we check Z and M here too? * same X and Y coordinates. Should we check Z and M here too?
...@@ -445,8 +444,8 @@ public final class JTSUtils { ...@@ -445,8 +444,8 @@ public final class JTSUtils {
} }
private static void addCoordinate(CoordinateSequence sequence, Target target, int index, int total) { private static void addCoordinate(CoordinateSequence sequence, Target target, int index, int total) {
addCoordinate(sequence, target, index, total, toCanonicalDouble(sequence.getOrdinate(index, X)), addCoordinate(sequence, target, index, total, toCanonicalDouble(sequence.getX(index)),
toCanonicalDouble(sequence.getOrdinate(index, Y))); toCanonicalDouble(sequence.getY(index)));
} }
private static void addCoordinate(CoordinateSequence sequence, Target target, int index, int total, double x, private static void addCoordinate(CoordinateSequence sequence, Target target, int index, int total, double x,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论