Skip to content

Commit

Permalink
fix toString for complex geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega committed Sep 25, 2024
1 parent 07a69b0 commit 094c06d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,16 @@ public static Geometry createInstanceFromJson(JsonObject json) throws ArcgisExce
*/
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"points\": [");
sb.append("[");
for (int i = 0; i < this.points.size(); i++) {
sb.append("[");
double[] array = points.get(i);
double[] array = points.get(i);
for (double value : array) {
sb.append(" ").append(value).append(",");
}
sb.setLength(sb.length() - 2);
sb.append(" ],");
}
sb.setLength(sb.length() - 2);
sb.append(" ]}");
sb.append(" ]");
return sb.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,21 @@ public static Geometry createInstanceFromJson(JsonObject json) throws ArcgisExce
*/
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"paths\": [");
sb.append("[");
for (int i = 0; i < this.paths.size(); i++) {
List<double[]> innerList = this.paths.get(i);
sb.append("[");
for (int j = 0; j < innerList.size(); j++) {
sb.append(" [");
sb.append("[");
double[] array = innerList.get(j);
for (double value : array) {
sb.append(" ").append(value).append(",");
}
sb.append(" ]");
sb.setLength(sb.length() - 2);
sb.append(" ],");
}
sb.append(" ]");
}
sb.setLength(sb.length() - 2);
sb.append(" ]}");
sb.append(" ]");
return sb.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,21 @@ public static Geometry createInstanceFromJson(JsonObject json) throws ArcgisExce
*/
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ \"rings\": [");
sb.append("[");
for (int i = 0; i < this.rings.size(); i++) {
List<double[]> innerList = this.rings.get(i);
sb.append("[");
for (int j = 0; j < innerList.size(); j++) {
sb.append(" [");
sb.append("[");
double[] array = innerList.get(j);
for (double value : array) {
sb.append(" ").append(value).append(",");
}
sb.append(" ]");
sb.setLength(sb.length() - 2);
sb.append(" ],");
}
sb.append(" ]");
}
sb.setLength(sb.length() - 2);
sb.append(" ]}");
sb.append(" ]");
return sb.toString();
}

Expand Down

0 comments on commit 094c06d

Please sign in to comment.