Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.
Open
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
15 changes: 2 additions & 13 deletions app/services/export/GeoJsonExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,13 @@ private ArrayNode getCoordinates(ArrayNode locations) {
private ArrayNode getLocations(JsonNode node) {

ArrayNode locations = new ArrayNode(JsonNodeFactory.instance);
String[] traverse = new String[]{
"mentions", "member", "agent", "participant", "provider", "publisher", "creator", "isRelatedTo"
};

if (node.isArray()) {
for (JsonNode entry : node) {
locations.addAll(getLocations(entry));
}
} else if (node.isObject()) {
if (node.has("location")) {
locations.addAll((ArrayNode) node.get("location"));
} else {
for (String property : traverse) {
if (node.has(property)) {
locations.addAll(getLocations(node.get(property)));
}
}
}
} else if (node.isObject() && node.has("location")) {
locations.addAll((ArrayNode) node.get("location"));
}

return locations;
Expand Down
26 changes: 8 additions & 18 deletions public/json/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@
},
"location": {
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place"
}
Expand Down Expand Up @@ -1233,15 +1232,9 @@
"$ref": "#/definitions/iso-8601-date"
},
"location": {
"title": "Action.location",
"description": "ResourceIndex.Action.edit.addressMessage",
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place",
"_display": {
"collapsed": true
}
"$ref": "#/definitions/Place"
}
},
"instrument": {
Expand Down Expand Up @@ -1650,15 +1643,9 @@
}
},
"location": {
"title": "Service.location",
"description": "ResourceIndex.Service.edit.info",
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place",
"_display": {
"collapsed": true
}
"$ref": "#/definitions/Place"
}
},
"about": {
Expand Down Expand Up @@ -2094,7 +2081,6 @@
},
"location": {
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place"
}
Expand Down Expand Up @@ -2484,7 +2470,6 @@
},
"location": {
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place"
}
Expand Down Expand Up @@ -2845,7 +2830,6 @@
},
"location": {
"type": "array",
"maxItems": 1,
"items": {
"$ref": "#/definitions/Place"
}
Expand Down Expand Up @@ -3112,6 +3096,12 @@
"$ref": "#/definitions/LocalizedString",
"_display": { "rows": 5 }
},
"location": {
"type": "array",
"items": {
"$ref": "#/definitions/Place"
}
},
"url": {
"title": "Product.url",
"description": "descriptions.Product.url",
Expand Down