0

I need to generate a time series of data over different grids in ArcGIS. Here I am intersecting the raster file from a polygon shapefile of irregular shape, which gives a final raster file as shown in figure.

enter image description here

Here, I want to generate a raster file which assign the values to Grid 1, 2, and 3 from the partially intersected raster.

Once I could do this, I will be getting the raster something like shown below.

enter image description here I am trying to this as I have center grid points for all the polygon and I could extract values to those point by doing this, and have a time series.

1

After spending one whole night I could solve the problem, hope it will help my other colleagues,

Step 1: Convert the raster to points

Step 2: "Spatial Join" the polygon grid shape file shown with the generated shape file.

Step 3: A new polygon grid shape file will be created that will have the raster values as required.

Step 4: Convert the obtained polygon shape file to raster for further processing.

Below is the arcpy code for Step 2

import arcpy

join_features = 'Path/To/Point.shp'
target_features = 'Path/To//Fishnet.shp'
out_feature_class = 'Path/To/Fishnet_spatial_join.shp'

arcpy.SpatialJoin_analysis(target_features, join_features, out_feature_class)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.