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

Crs extraction #122

Merged
merged 8 commits into from
Mar 12, 2021
Merged

Crs extraction #122

merged 8 commits into from
Mar 12, 2021

Conversation

SbastianGarzon
Copy link
Collaborator

@SbastianGarzon SbastianGarzon commented Feb 19, 2021

Fixes #85 #113 #84 #24

@nuest nuest merged commit 2b777c5 into o2r-project:master Mar 12, 2021
@SbastianGarzon SbastianGarzon changed the title WIP Crs extraction Crs extraction Mar 19, 2021
Copy link
Member

@nuest nuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few minor comments.

geoextent/lib/extent.py Show resolved Hide resolved

bbox = [minlon, minlat, maxlon, maxlat]
bbox = [min_lon, min_lat, max_lon, max_lat]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a link to some CRS documentation or GDAL documentation why we choose this coordinate order? I KNOW I will wonder if this is reasonable in a few years time...

return "4326"
else:
raise Exception('The csv file from ' + filePath + ' has no WGS84 CRS')
param = hf.searchForParameters(elements, ["crs", "srsID", "EPSG"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you ever come across a CSV file in the wild where this was successful?

@@ -112,7 +112,7 @@ def transformingIntoWGS84(crs, coordinate):

def transformingArrayIntoWGS84(crs, pointArray):
'''
Function purpose: transforming SRS into WGS84 (EPSG:4978; used by the GPS satellite navigation system) from an array \n
Function purpose: transforming SRS into WGS84 (EPSG 4326; used by the GPS satellite navigation system) from an array \n
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove "used by the GPS..." - that's unnecessary information here.

def test_jpge_2000_extract_bbox():
result = geoextent.fromFile("tests/testdata/jpge2000/MSK_SNWPRB_60m.jp2", bbox=True)
assert result['bbox'] == pytest.approx([-74.09868, 4.434354, -73.10649, 5.425259], abs=tolerance)
assert result['crs'] == "4326"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an assertion here that there is a user visible warning/log that you're defaulting to 4326 (if that is the case here, or elsewhere).

def test_invalid_bbox_and_flip():
result = geoextent.fromFile('tests/testdata/csv/cities_NL_case_flip.csv', bbox=True)
assert result['bbox'] == pytest.approx([4.3175, 5.0, 95.0, 53.217222], abs=tolerance)
assert result['crs'] == "4326"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an assertion for the warning log that a flip was made.

@@ -0,0 +1,11 @@
Name,no_Latitude,EPSG,no_Longitude,NumberOfCitizens,TimeStamp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For flipping, wouldn't it make the test a bit more realistic that the coordinate names are "x" and "y" ? VERY minor issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for JPEG2000
2 participants