geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
412 stars 487 forks source link

East West extents flipped in Dublin Core #8255

Closed ByronCinNZ closed 5 days ago

ByronCinNZ commented 1 month ago

Describe the bug The result of setting a BBOX in Dublin Core reverses then East and West coordinate values.

To Reproduce Steps to reproduce the behavior:

  1. Create a new Dublin core record
  2. in the advanced editor select the extents for Australia either by drawing a box or selecting it from "Countries"
  3. Change to XML view - the extents are recorded with the West value in East and vice versa
  4. <dc:coverage>North -9.2402, South -54.75, East 112.92, West 159.11. Australia</dc:coverage>

Expected behavior The result should look like: <dc:coverage>North -9.2402, South -54.75, East 159.11, West 112.92. Australia</dc:coverage>

GeoNetwork version 4.2.5 Same result in GeoNetwork 4.4.4

ByronCinNZ commented 1 month ago

Fixed the issue by correcting the coordinate parsing in mapservice.js swapping the values in lines 766 and 769 (GN 4.2.5) Working code looks like this -

getDcExtent: function (extent, location) {
           if (angular.isArray(extent)) {
             var dc =
              "North " +
              extent[3] +
            ", " +
            "South " +
            extent[1] +
            ", " +
            "East " +
            extent[2] +
            ", " +
            "West " +
            extent[0];
          if (location) {
            dc += ". " + location;
          }
          return dc;
        } else {
          return "";
        }
      },

`