Skip to content

is it possible to use make_geocube with paramter option all_touched = true? #97

Answered by snowman2
oswald1234 asked this question in Q&A
Discussion options

You must be logged in to vote

https://gis.stackexchange.com/a/427961/144357

You want to follow the pattern demonstrated here: https://corteva.github.io/geocube/stable/examples/rasterize_point_data.html

from functools import partial
from geocube.rasterize import rasterize_image

roads = make_geocube(
    vector_data=roads,
    measurements=['train_id'],
    resolution=(10,-10),
    rasterize_function=partial(rasterize_image, all_touched=True),
)

Also see: https://corteva.github.io/geocube/stable/geocube.html#geocube.rasterize.rasterize_image

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oswald1234
Comment options

Answer selected by oswald1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants