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

Plot example doesn't work in Julia 1.6.4 #83

Closed
maarten-keijzer opened this issue Dec 6, 2021 · 3 comments
Closed

Plot example doesn't work in Julia 1.6.4 #83

maarten-keijzer opened this issue Dec 6, 2021 · 3 comments

Comments

@maarten-keijzer
Copy link
Contributor

maarten-keijzer commented Dec 6, 2021

On my machine (MacOS)

julia> using GeoArrays

julia> using Plots

julia> fn = download("https://github.com/yeesian/ArchGDALDatasets/blob/master/pyrasterio/RGB.byte.tif?raw=true")
"/var/folders/cq/80lc4bfd5qg0k4q1j8zc67lh0000gn/T/jl_KTUIxD"

julia> ga = GeoArrays.read(fn)
791x718x3 Array{Union{Missing, UInt8}, 3} with AffineMap([300.0379266750948 0.0; 0.0 -300.041782729805], [101985.0, 2.826915e6]) and CRS PROJCS["UTM Zone 18, Northern Hemisphere",GEOGCS["Unknown datum based upon the WGS 84 ellipsoid",DATUM["Not_specified_based_on_WGS_84_spheroid",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH]]

julia> plot(ga)
ERROR: UndefVarError: coords not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/GeoArrays/oqARi/src/plot.jl:10 [inlined]
[2] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, ga::GeoArray)
@ GeoArrays ~/.julia/packages/RecipesBase/qpxEX/src/RecipesBase.jl:289
[3] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/Bxu2O/src/user_recipe.jl:36
[4] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~/.julia/packages/RecipesPipeline/Bxu2O/src/RecipesPipeline.jl:70
[5] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
@ Plots ~/.julia/packages/Plots/qbc7U/src/plot.jl:208
[6] plot(args::Any; kw::Any)
@ Plots ~/.julia/packages/Plots/qbc7U/src/plot.jl:91
[7] plot(args::Any)
@ Plots ~/.julia/packages/Plots/qbc7U/src/plot.jl:85
[8] top-level scope
@ REPL[8]:1

===

Changing line 10 in plot.jl from:

coords = coords(ga, Vertex())

to

coords = GeoArrays.coords(ga, Vertex())

fixes the issue

@visr
Copy link
Collaborator

visr commented Dec 6, 2021

Ah yes good catch, it's not a good idea to use a variable name that is the same as the exported coords function.

Maybe for consistency it's best to change the variable name (and its uses in the same function) to c, like here?

c = coords(ga, Vertex())

Would you be willing to submit that patch?

@maarten-keijzer
Copy link
Contributor Author

No problem, pull request submitted.

@evetion
Copy link
Owner

evetion commented Dec 8, 2021

Fixed by #84 👍🏻

@evetion evetion closed this as completed Dec 8, 2021
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