-
Notifications
You must be signed in to change notification settings - Fork 4
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
Crs extraction #122
Conversation
There was a problem hiding this 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.
|
||
bbox = [minlon, minlat, maxlon, maxlat] | ||
bbox = [min_lon, min_lat, max_lon, max_lat] |
There was a problem hiding this comment.
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"]) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Fixes #85 #113 #84 #24