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

feature to dataset #46

Open
MAfarrag opened this issue May 9, 2023 · 1 comment
Open

feature to dataset #46

MAfarrag opened this issue May 9, 2023 · 1 comment
Labels
bug Something isn't working feature collection feature collection class

Comments

@MAfarrag
Copy link
Member

MAfarrag commented May 9, 2023

FeatureCollection.to_dataset
when converting a feature collection object (vector) to a dataset and using a dataset as a parameter, not a cell_size, if the dataset does not have the same top left corner as the polygon, the conversion will not work.

To Reproduce
Steps to reproduce the behavior:

  1. try to convert the top brown polygon into a raster and use the bottom raster as a parameter to the to_dataset method
    image
  • the result dataset will be identical to the input dataset

image

Expected behavior
the resulting dataset should cover only the polygon

Additional context
possible error, when using a dataset as an input, the function uses it as a source for the number of columns, rows, cell_size, and the pivot point (top left corner, point 1), so if the original pivot point (point 2 ) of the polygon is out of the created domain (blue) of the newly created raster gdal can not create an array that fits the original polygon (green)

image

@MAfarrag MAfarrag added bug Something isn't working feature collection feature collection class labels May 9, 2023
@MAfarrag
Copy link
Member Author

MAfarrag commented May 9, 2023

to replicate the error
test case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature collection feature collection class
Projects
None yet
Development

No branches or pull requests

1 participant