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

Can't rasterize a MultiLineString with shape = :polygon? #743

Open
asinghvi17 opened this issue Sep 19, 2024 · 2 comments
Open

Can't rasterize a MultiLineString with shape = :polygon? #743

asinghvi17 opened this issue Sep 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@asinghvi17
Copy link
Collaborator

From geocompjl:

julia> california_raster1 = Rasters.rasterize(
           last,
           california_borders; # GI.MultiLineString
           fill = 1,
           res = 0.5, shape = :polygon
       )
ERROR: MethodError: no method matching Rasters.Edges(::GeoInterface.MultiLineStringTrait, ::GeoInterface.Wrappers.MultiLineString{…}, ::Tuple{…}; allocs::Rasters.Allocs{…})

Closest candidates are:
  Rasters.Edges(::Any, ::Any, ::Any) got unsupported keyword argument "allocs"
   @ Rasters ~/.julia/dev/Rasters/src/methods/burning/edges.jl:43
  Rasters.Edges(::Union{GeoInterface.AbstractCurveTrait, GeoInterface.AbstractMultiPolygonTrait, GeoInterface.AbstractPolygonTrait}, ::Any, ::Any; allocs, kw...)
   @ Rasters ~/.julia/dev/Rasters/src/methods/burning/edges.jl:48
  Rasters.Edges(::Any, ::Any; kw...)
   @ Rasters ~/.julia/dev/Rasters/src/methods/burning/edges.jl:47

Stacktrace:
  [1] Rasters.Edges(geom::GeoInterface.Wrappers.MultiLineString{…}, dims::Tuple{…}; kw::@Kwargs{})
    @ Rasters ~/.julia/dev/Rasters/src/methods/burning/edges.jl:47
  [2] _burn_polygon!(B::Raster{…}, trait::GeoInterface.MultiLineStringTrait, geom::GeoInterface.Wrappers.MultiLineString{…}; fill::Bool, boundary::Symbol, geomextent::Extent{…}, verbose::Bool, allocs::Rasters.Allocs{…}, kw::@Kwargs{})
    @ Rasters ~/.julia/dev/Rasters/src/methods/burning/polygon.jl:20

does this just need a dispatch or update?

@asinghvi17 asinghvi17 changed the title Can't rasterize a MultiLineString as a polygon? Can't rasterize a MultiLineString with shape = :polygon? Sep 19, 2024
@rafaqz
Copy link
Owner

rafaqz commented Sep 23, 2024

Currently you can make a polygon a line but not the opposite.

@rafaqz rafaqz added the enhancement New feature or request label Nov 5, 2024
@rafaqz
Copy link
Owner

rafaqz commented Nov 5, 2024

We should at least improve the errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants