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

d_create error #10

Open
jdemaigret opened this issue Apr 13, 2021 · 2 comments
Open

d_create error #10

jdemaigret opened this issue Apr 13, 2021 · 2 comments

Comments

@jdemaigret
Copy link

When running makewindera5(year=2018) (step 6 in the readme), the following error message pops up:

ERROR: UndefVarError: d_create not defined

It seems that the function d_create has been replaced with create_dataset even the latest downloadable versions of the HDF5.jl file.

I'm currently using JuliaPro 1.5.4-1 IDE, with HDF5.jl file version v0.15.4 on Windows 10.

@FabsOliveira
Copy link

FabsOliveira commented May 1, 2021

Simply replacing d_create with create_dataset and adequating the syntax (just like in #9) did not work either. Got this error now:

ERROR: GDALError (CE_Failure, code 10):
        Pointer 'hDS' is NULL in 'GDALGetGeoTransform'.

Stacktrace:
  [1] gdaljl_errorhandler(class::GDAL.CPLErr, errno::Int32, errmsg::Cstring)
    @ GDAL ~/.julia/packages/GDAL/SEaao/src/error.jl:36
  [2] gdalgetgeotransform
    @ ~/.julia/packages/GDAL/SEaao/src/gdal_h.jl:1109 [inlined]
  [3] getgeotransform!(dataset::ArchGDAL.Dataset, transform::Vector{Float64})
    @ ArchGDAL ~/.julia/packages/ArchGDAL/CUiBS/src/dataset.jl:641
  [4] getgeotransform
    @ ~/.julia/packages/ArchGDAL/CUiBS/src/dataset.jl:646 [inlined]
  [5] (::GlobalEnergyGIS.var"#10#11"{Int64})(dataset::ArchGDAL.Dataset)
    @ GlobalEnergyGIS ~/Documents/GitHub/GlobalEnergyGIS/src/rasterize_shapefiles.jl:53
  [6] read(f::GlobalEnergyGIS.var"#10#11"{Int64}, args::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ ArchGDAL ~/.julia/packages/ArchGDAL/CUiBS/src/context.jl:216
  [7] read
    @ ~/.julia/packages/ArchGDAL/CUiBS/src/context.jl:214 [inlined]
  [8] readraster(infile::String, extentflag::Symbol, dim::Int64)
    @ GlobalEnergyGIS ~/Documents/GitHub/GlobalEnergyGIS/src/rasterize_shapefiles.jl:51
  [9] readraster (repeats 2 times)
    @ ~/Documents/GitHub/GlobalEnergyGIS/src/rasterize_shapefiles.jl:71 [inlined]
 [10] getwindatlas()
    @ GlobalEnergyGIS ~/Documents/GitHub/GlobalEnergyGIS/src/make_auxiliary_datasets.jl:353
 [11] makewindera5(; year::Int64, windatlas_only::Bool)
    @ GlobalEnergyGIS ~/Documents/GitHub/GlobalEnergyGIS/src/makewindera5.jl:14
 [12] top-level scope

Seems something with the way the command ArchGDAL. Maybe some syntax change there too? Can't figure that one out 😞

@niclasmattsson
Copy link
Owner

Thank you for reporting. You're correct, apparently HDF.jl changed its API. The d_create error has now been fixed on latest master. Please update and try again.

@FabsOliveira, that GDALerror is probably a "file not found" error in disguise. My guess is that it's related to a recent update of the WDPA database (i.e. protected areas), which changed the internal naming of the shapefiles. I fixed this a few weeks ago, although you may have to download and rasterize the latest version of the database:

download_datasets("WDPA")
rasterize_protected()

If this doesn't help, please open a separate issue with the command that produces the error.

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

No branches or pull requests

3 participants