Skip to content

Commit

Permalink
Merge pull request #2417 from telefonicaid/fix/polygon_multipoint_pol…
Browse files Browse the repository at this point in the history
…yline_to_string

fix toString for complex arcgis geometries
  • Loading branch information
fgalan authored Sep 25, 2024
2 parents 07a69b0 + d4eeb11 commit d6e9e78
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- [cygnus-common][arcgis] toString of complex geometry is not returning equivalent input (#2418)
- [cygnus-ngsi][arcgis] Log json geometry before create instance
- [cygnus-ngsi][arcgis] Fix CygnusRuntimeError due to Cannot invoke "java.util.List.size()" because "serverFeatures" is null (#2413)
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 d6e9e78

Please sign in to comment.