home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 808747264

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/5075#issuecomment-808747264 https://api.github.com/repos/pydata/xarray/issues/5075 808747264 MDEyOklzc3VlQ29tbWVudDgwODc0NzI2NA== 18444902 2021-03-27T15:10:59Z 2021-03-27T15:10:59Z NONE

Below my code ``` import geopandas import rioxarray from geocube.api.core import make_geocube

Read input_vector and create a GeoDataFrame

vector_in = geopandas.read_file(input_vector)

Read raster data

raster_in = rioxarray.open_rasterio(input_raster)

Create GeoCube

out_grid = make_geocube( vector_data=vector_in, measurements=["id"], like=raster_in, ) out_grid.to_netcdf("rasterized_vector.nc")

Add raster_in to geocube

out_grid["process_value"] = raster_in out_grid.to_netcdf("out_grid_process_value.nc") ``` Here there are two netCDF with output data.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  841012076
Powered by Datasette · Queries took 0.809ms · About: xarray-datasette