Skip to main content
2 votes
Accepted

rio.to_raster returns ValueError: cannot convert float NaN to integer

Adjust this line in your code and it works grid = make_geocube(vector_data=points, measurements=['some_value'], resolution=(1, 1), fill = -9999) Reason being that nodata management is still a bit ...
LisanAlGIS's user avatar
2 votes
Accepted

Create multiband raster in Python from X, Y

You're doing a lot of unnecessary looping. You can create your random values in a single array and you don't need a dataframe. import numpy as np import rasterio as rio from rasterio.transform import ...
user2856's user avatar
  • 67.7k
1 vote
Accepted

Create filtered file out of overlapping coordinates

If the coordinates are exactly the same in both dataframes (same number of decimal places etc.), use merge with how="inner", to find the matching rows: Merge DataFrame or named Series ...
Bera's user avatar
  • 76.2k
1 vote

Colorizing polygons based on a user-defined color scheme determined by the column value

You make a geopandas data frame based on your 'states.shp' file, and a pandas data frame from your 'population_density.csv' file. Out of that big geopandas data frame you could make a smaller one, ...
Ratislaus's user avatar
  • 229
1 vote

df.spatial.to_featureclass produces an empty shapefile

I can't reproduce your error in ArcGis Pro 3.2.
Xeppit's user avatar
  • 1,365
1 vote
Accepted

Merging a DataFrame with a GeoDataFrame based on two keys

You have no column named NAME in your right df, that is why you get KeyError. Use left_on and right_on to specify both column names: import pandas as pd import geopandas as gpd df = pd.DataFrame(data=...
Bera's user avatar
  • 76.2k

Only top scored, non community-wiki answers of a minimum length are eligible