Skip to content

Convenient methods in RasterLayer #91

@wang-boyu

Description

@wang-boyu

What's the problem this feature will solve?

  1. Load/save raster cell values directly from/to files.
  2. Get random coordinates within cells based on cell coordinates. In situations like population in the same cell, they don't need to have exactly the same coordinates.

Describe the solution you'd like

  1. Have a RasterLayer.from_file(file_path, name, compression) class method to create RasterLayer with cell attribute name. The file can optionally be a gzip file.
    Similarly for saving to files: RasterLayer.to_file(file_path, compression).
  2. Implement a raster_layer.get_random_coord(cell.pos) method.

Additional context

See comments from #90 (comment) and #90 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions