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

Cellarea crashes Julia on engineering crs #895

Open
evetion opened this issue Feb 14, 2025 · 8 comments
Open

Cellarea crashes Julia on engineering crs #895

evetion opened this issue Feb 14, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@evetion
Copy link

evetion commented Feb 14, 2025

using Rasters, Proj, ArchGDAL
r = Raster("https://github.com/Deltares/Geomorphometry.jl/releases/download/v0.6.0/saba.tif")
cellarea(r)
@evetion evetion added the bug Something isn't working label Feb 14, 2025
@asinghvi17
Copy link
Collaborator

Can confirm...that seems bad

@asinghvi17
Copy link
Collaborator

cellarea(Planar(), r) works as expected. The problem is that this CRS has no geographic CRS backing it and so there is no way to go to lat/long. We need to detect that in the main function and dispatch...

@rafaqz
Copy link
Owner

rafaqz commented Feb 14, 2025

Probably has to be Proj or GDAL to kill Julia?

@asinghvi17
Copy link
Collaborator

Yes the stacktrace points to Proj

@tiemvanderdeure
Copy link
Collaborator

This must be a Proj issue, right? Seems like it segfaults if it can't do a conversion and always_xy = true.

using Rasters, Proj, ArchGDAL
r = Raster("https://github.com/Deltares/Geomorphometry.jl/releases/download/v0.6.0/saba.tif"; lazy = true)

transform = Proj.Transformation(crs(r), EPSG(4326)) # errors
transform = Proj.Transformation(crs(r), EPSG(4326); always_xy = true) # segfaults

But also this CRS seems to be invalid? ArchGDAL.importCRS(crs(r)) gives ERROR: Failed to export this SRS to PROJ.4 format (Failure.)

@evetion
Copy link
Author

evetion commented Feb 15, 2025

It's a local engineering CRS. Should be valid, but you can't transform it. It should error though, not crash, and not sure if that's a bug at the Julia side of Rasters, Proj or PROJ itself.

@rafaqz
Copy link
Owner

rafaqz commented Feb 15, 2025

It's pretty hard for Rasters to cause a segfault, and really Proj should protect other packages from this

@tiemvanderdeure
Copy link
Collaborator

I made an issue in Proj, think it should be handled there

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

4 participants