Skip to content

Commit

Permalink
Merge pull request #99 from MITLibraries/GDT-116-fix-wkt-coords
Browse files Browse the repository at this point in the history
Fix order of coordinates in WKT string
  • Loading branch information
ghukill authored Jan 22, 2024
2 parents dea8457 + 3764556 commit b37fb43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions harvester/records/fgdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def _dcat_bbox(self) -> str:
lat_lon_envelope = ", ".join(
[
min(bbox_data["westbc"]).strip(),
max(bbox_data["southbc"]).strip(),
max(bbox_data["eastbc"]).strip(),
min(bbox_data["northbc"]).strip(),
max(bbox_data["northbc"]).strip(),
min(bbox_data["southbc"]).strip(),
]
)
return f"ENVELOPE({lat_lon_envelope})"
Expand Down
4 changes: 2 additions & 2 deletions harvester/records/iso19139.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def _dcat_bbox(self) -> str:
lat_lon_envelope = ", ".join(
[
min(bbox_data["westBoundLongitude"]).strip(),
max(bbox_data["southBoundLatitude"]).strip(),
max(bbox_data["eastBoundLongitude"]).strip(),
min(bbox_data["northBoundLatitude"]).strip(),
max(bbox_data["northBoundLatitude"]).strip(),
min(bbox_data["southBoundLatitude"]).strip(),
]
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_records/test_fgdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def test_fgdc_record_required_gbl_resourceClass_sm_unhandled_value_return_none(
def test_fgdc_record_required_dcat_bbox(fgdc_source_record_required_fields):
assert (
fgdc_source_record_required_fields._dcat_bbox()
== "ENVELOPE(31.161907, 29.994131, 31.381609, 30.141311)"
== "ENVELOPE(31.161907, 31.381609, 30.141311, 29.994131)"
)


def test_fgdc_record_required_locn_geometry(fgdc_source_record_required_fields):
assert (
fgdc_source_record_required_fields._locn_geometry()
== "ENVELOPE(31.161907, 29.994131, 31.381609, 30.141311)"
== "ENVELOPE(31.161907, 31.381609, 30.141311, 29.994131)"
)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_records/test_iso19139.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def test_iso19139_record_required_gbl_resourceClass_sm_unhandled_value_return_no
def test_iso19139_record_required_dcat_bbox(iso19139_source_record_required_fields):
assert (
iso19139_source_record_required_fields._dcat_bbox()
== "ENVELOPE(88, -16.5, 138, 25.833333)"
== "ENVELOPE(88, 138, 25.833333, -16.5)"
)


def test_iso19139_record_required_locn_geometry(iso19139_source_record_required_fields):
assert (
iso19139_source_record_required_fields._locn_geometry()
== "ENVELOPE(88, -16.5, 138, 25.833333)"
== "ENVELOPE(88, 138, 25.833333, -16.5)"
)


Expand Down

0 comments on commit b37fb43

Please sign in to comment.