Skip to content

Method name for setting a CRS #3

Closed

Description

@benbovy

Several options:

  1. .proj.set_crs(...): like in Xvec and currently implemented
  2. .proj.write_crs(...): like in rioxarray
  3. .proj.assign_crs(...): like in odc-geo

I have a slight preference for option 3. This is more consistent with methods like Xarray assign_coords that also return new Dataset or DataArray objects with new or replaced coordinates.

Activity

  1. scottyhq commented on Dec 4, 2024

    @scottyhq
    Collaborator

    I have a slight preference for option 3. This is more consistent with methods like Xarray assign_coords that also return new Dataset or DataArray objects with new or replaced coordinates.

    I agree! Would be great to align as much as possible with existing Xarray methods and syntax

  2. benbovy commented on Dec 5, 2024

    @benbovy
    MemberAuthor

    I also wonder whether we should have a allow_override=False option or no option, i.e., in the latter case just leave the responsibility to the user that assign_crs(spatial_ref=crs) may overwrite any existing CRS.

    odc-geo's assign_crs() docstrings says "Assign CRS for a non-georegistered array or dataset" but I don't see anything that prevent overwriting an existing CRS in the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions