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

geometrycolumns argument not respected in rasterize #744

Closed
asinghvi17 opened this issue Sep 19, 2024 · 1 comment · Fixed by #745
Closed

geometrycolumns argument not respected in rasterize #744

asinghvi17 opened this issue Sep 19, 2024 · 1 comment · Fixed by #745

Comments

@asinghvi17
Copy link
Collaborator

asinghvi17 commented Sep 19, 2024

From geocompj,

I pass geometrycolumn as a kwarg but it doesn't seem to be hooked up somewhere...

 julia> california_raster2 = Rasters.rasterize(
           last, 
           california;
           geometrycolumn = :geom,
           fill = 1,
           res = 0.5,
           boundary = :center,
       )
ERROR: ArgumentError: Expected geometries in the column `geometry`, but no such column found.
Stacktrace:
 [1] _get_geometries(data::DataFrame, ::Nothing)
   @ Rasters ~/.julia/dev/Rasters/src/utils.jl:201
 [2] Rasters.Rasterizer(trait::Nothing, data::DataFrame; fill::Int64, geometrycolumn::Nothing, kw::@Kwargs{…})
   @ Rasters ~/.julia/dev/Rasters/src/methods/rasterize.jl:167
 [3] Rasterizer
   @ ~/.julia/dev/Rasters/src/methods/rasterize.jl:166 [inlined]
 [4] #Rasterizer#488
   @ ~/.julia/dev/Rasters/src/methods/rasterize.jl:150 [inlined]
 [5] Rasterizer
   @ ~/.julia/dev/Rasters/src/methods/rasterize.jl:149 [inlined]
 [6] rasterize(data::DataFrame; to::Nothing, fill::Int64, threaded::Bool, geometrycolumn::Symbol, kw::@Kwargs{…})
   @ Rasters ~/.julia/dev/Rasters/src/methods/rasterize.jl:432

julia> california
1×7 DataFrame
 Row │ geom                       GEOID   NAME        REGION  AREA       total_pop_10  total_pop_15 
     │ IGeometr…                  String  String      String  Float64    Float64       Float64      
─────┼──────────────────────────────────────────────────────────────────────────────────────────────
   1 │ Geometry: wkbMultiPolygon  06      California  West    4.09747e5     3.66373e7     3.84215e7

I know California is a special snowflake, but I live here now damnit

@asinghvi17
Copy link
Collaborator Author

Ah the stacktrace makes it a bit clearer. I will PR a fix.

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

Successfully merging a pull request may close this issue.

1 participant