Split Raster doesn't split into rows

527
3
Jump to solution
07-22-2022 09:26 AM
Labels (3)
BeckB
by
New Contributor III

I'm using ArcGIS Pro 3.0, though I only updated from 2.7.3 yesterday. I have ArcPy code to split large rasters into 4 equal corners: a top left, a top right, a bottom left, and a bottom right. Up until I updated, this code worked perfectly, but since the update, the tool has ignored the parameter to split the raster into columns and rows, and instead just splits it into columns.

Here is my original code:

#names and folders
nulltif2016 = r"G:\My Drive\work\Northern Animal Ecology Lab\sentineltif\evi2016null"
listnulltif2016 = glob.glob(nulltif2016 + r"\*.tif")
foldersplitcorners2016 = r"G:\My Drive\work\Northern Animal Ecology Lab\sentineltif\evi2016split"

#create name
for fp in listnulltif2016:
    fn = os.path.basename(fp)[:-4]
    date = fn[-8:]
    namesplitcorners2016 = "split" + date + "c"    
    #apply splitraster
    arcpy.management.SplitRaster(fp, foldersplitcorners2016, namesplitcorners2016, "NUMBER_OF_TILES", "TIFF", "", "2 2")

 

 

After the update, this produced 2 columns and 1 row, like a book. The code produced the same result when it was "2 4", which leads me to believe that it isn't reading the row parameter anymore.

Any advice on how this could be fixed would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
BeckB
by
New Contributor III

Hello,

Thank you very much for your reply. As an update, I realized that it was an issue with my environment settings. For some reason, the input rasters had absurdly large extents that went past the bounds of my processing extent, so it seemed as if the tool was malfunctioning. Thank you for your help!

View solution in original post

0 Kudos
3 Replies
JING_Li
New Contributor

Hello Beck,

I wrote a similar script based on yours. Then tested with my own data in Pro 3.0. I don't see the issue you described. The rasters are split into equal parts based on the input. The input rasters I'm using are couple tif rasters in a folder. What is your source data format? 

Since I cannot reproduce the issue, I might need your help to narrow down the issue. Would you mind try with the Split Raster tool only( take the python part out of the story) to narrow down the issue? If the tool is working, we know there is something wrong with ArcPy.  If the tool does not work, we know the tool itself has some issue.

Next, if the tool does not work, could you try the Split Raster tool on a smaller data? You can use Copy Raster tool to copy a portion of your input raster (use Extent setting in Environments tab of the Copy Raster tool) and then run Split Raster tool on it. This can help further narrow down the issue.

Last but not the least, is it possible to share your data?

0 Kudos
BeckB
by
New Contributor III

Hello,

Thank you very much for your reply. As an update, I realized that it was an issue with my environment settings. For some reason, the input rasters had absurdly large extents that went past the bounds of my processing extent, so it seemed as if the tool was malfunctioning. Thank you for your help!

0 Kudos
JING_Li
New Contributor

Thanks for the updates. 

0 Kudos