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

Unexpected behavior for vertical datums that use 'depth' below a reference surface rather than 'height' #26

Open
Erik-Geo opened this issue Aug 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Erik-Geo
Copy link
Collaborator

Erik-Geo commented Aug 27, 2024

It is possible to convert 'surface' and 'end' in the header to depth below a reference level when changing to vertical datums like LAT NL depth (EPSG 9287) or MSL NL depth (EPSG 9288). This causes values in the end column to become higher than the surface values.

This breaks behaviour of (at least) the select_by_length method which now calculates negative lengths for all objects and also gives many unwanted validation errors if running through the header validation again.

dino = geost.read_borehole_table(path_to_dinodump)
dino.change_vertical_reference("LAT NL depth")
selection_result = dino.select_by_length(4)

selection_result will be empty!

Using negative lengths or changing back to NAP or any other vertical datum that uses 'height' rather than 'depth' are workarounds.

Suggestions:

  • To fix select_by_length: (1) Use absolute values for difference between surface and end; (2) Convert user input to negative value if the vertical datum is of 'depth'-type
  • For validation, pyproj.crs.crs.CRS has an axis_info property that includes information on Depth versus Height and positive up/down direction, which can potentially be used to select the appropriate validation schema.
@Erik-Geo Erik-Geo added the bug Something isn't working label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant