From 4654e8dc9b028677694d7a2726521ce267275396 Mon Sep 17 00:00:00 2001 From: Richard Hallett Date: Thu, 25 Mar 2021 18:44:32 +0100 Subject: [PATCH] Fix writing of multiple geolocationpolygons --- lib/bolognese/datacite_utils.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/bolognese/datacite_utils.rb b/lib/bolognese/datacite_utils.rb index fd3f8417..b46608f5 100644 --- a/lib/bolognese/datacite_utils.rb +++ b/lib/bolognese/datacite_utils.rb @@ -368,13 +368,14 @@ def insert_geo_locations(xml) xml.northBoundLatitude(geo_location.dig("geoLocationBox", "northBoundLatitude")) end end - if geo_location["geoLocationPolygon"] - xml.geoLocationPolygon do - geo_location["geoLocationPolygon"].each do |polygon_point| - xml.polygonPoint do - xml.pointLatitude(polygon_point["pointLatitude"]) - xml.pointLongitude(polygon_point["pointLongitude"]) + geo_location["geoLocationPolygon"].each do |geo_location_polygon| + xml.geoLocationPolygon do + geo_location_polygon.each do |polygon_point| + xml.polygonPoint do + xml.pointLatitude(polygon_point.dig("polygonPoint", "pointLatitude")) + xml.pointLongitude(polygon_point.dig("polygonPoint", "pointLongitude")) + end end end end