Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix toString for complex arcgis geometries #2417

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading