Skip to content

ValueError: raster.coords should be named as coordinates:(y, x) when using proximity on xarray #601

Answered by ianthomas23
kulpojke asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kulpojke,

xrspatial.proximity is expecting an xarray.DataArray not an xarray.Dataset. You should replace

prox_agg = proximity(g)

with

prox_agg = proximity(g.value)

This is not an uncommon problem, we should probably explicitly check that arguments are DataArrays and give a more meaningful error message if they are not.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kulpojke
Comment options

@ianthomas23
Comment options

Answer selected by ianthomas23
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