Script sometimes stuck at arcpy.SplitRaster_managementUnable to Provide Input for a MultiValue Parameter...
How do I handle a blinded enemy which wants to attack someone it's sure is there?
Why is the meaning of kanji 閑 "leisure"?
What is the reason behind this musical reference to Pinocchio in the Close Encounters main theme?
What is formjacking?
Why would you use 2 alternate layout buttons instead of 1, when only one can be selected at once
How can a kingdom keep the secret of a missing monarch from the public?
How many copper coins fit inside a cubic foot?
Coworker is trying to get me to sign his petition to run for office. How to decline politely?
Why does finding small effects in large studies indicate publication bias?
Ramanujan's radical and how we define an infinite nested radical
Have the UK Conservatives lost the working majority and if so, what does this mean?
How does the income of your target audience matter for logo design?
What if you do not believe in the project benefits?
Why write a book when there's a movie in my head?
Is it ethical to apply for a job on someone's behalf?
How should I ship cards?
Does resurrection consume material components if the target isn’t willing to be resurrected?
Stream.findFirst different than Optional.of?
Is there a way to pause a running process on Linux systems and resume later?
Why are `&array` and `array` pointing to the same address?
The Longest Chess Game
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
Can "ee" appear in Latin?
How to write painful torture scenes without being over-the-top
Script sometimes stuck at arcpy.SplitRaster_management
Unable to Provide Input for a MultiValue Parameter Script Toolarcgis python script to tool issueDebugging custom Script Tool Error 000732?Big raster (DEM) loading too long in QGISOptional script input parametersWhy does order of commands in raster processing matter?Mosaic Raster Function Error ArcGIS Pro 2How to set up 'Extent' environment variable with arcpy when using CellStatistics?Exception handling in ArcGIS ModelbuilderQGIS 3.4 Geopackage Raster Handling and DB Manager
my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management
.
import arcpy
import os
#nearly 700 rows of script
fclist: [ ...] # some fc
rasterlist = [...] # many raster
for raster in rasterlist:
rasterpro = arcpy.ProjectRaster_management(raster, "in_memory\rasterpro", 25832)
for fc in fclist:
os.makedirs(newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
arcpy.SplitRaster_management(rasterpro,
newfolder + "\" + filenamenew + "_" + os.path.basename(fc), # it is a correct path, which should work fine
filenamenew + "_" + os.path.basename(fc) + "_",
"POLYGON_FEATURES",
"#",
"NEAREST",
"#",
"#",
"#",
"#",
"#",
"#",
fc)
# some more rows of script
Most of the times it works just fine, but sometimes the script just stops there and doesn´t go on. If i restart the script, sometimes it works without problems, then sometimes the first itteration does not work. So the problem does not occur after a set number of itteration, the same Feature Class or with the same raster!
Did i do something wrong with my inputs in arcpy.SplitRaster_management
?
EDIT: If i run the script inside my Editor (Pyzo), the problem does not occur. Only if i use it inside a Toolbox in ArcGIS Pro.
arcpy raster arcgis-pro
add a comment |
my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management
.
import arcpy
import os
#nearly 700 rows of script
fclist: [ ...] # some fc
rasterlist = [...] # many raster
for raster in rasterlist:
rasterpro = arcpy.ProjectRaster_management(raster, "in_memory\rasterpro", 25832)
for fc in fclist:
os.makedirs(newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
arcpy.SplitRaster_management(rasterpro,
newfolder + "\" + filenamenew + "_" + os.path.basename(fc), # it is a correct path, which should work fine
filenamenew + "_" + os.path.basename(fc) + "_",
"POLYGON_FEATURES",
"#",
"NEAREST",
"#",
"#",
"#",
"#",
"#",
"#",
fc)
# some more rows of script
Most of the times it works just fine, but sometimes the script just stops there and doesn´t go on. If i restart the script, sometimes it works without problems, then sometimes the first itteration does not work. So the problem does not occur after a set number of itteration, the same Feature Class or with the same raster!
Did i do something wrong with my inputs in arcpy.SplitRaster_management
?
EDIT: If i run the script inside my Editor (Pyzo), the problem does not occur. Only if i use it inside a Toolbox in ArcGIS Pro.
arcpy raster arcgis-pro
1
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
They are local.
– Tim
1 hour ago
add a comment |
my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management
.
import arcpy
import os
#nearly 700 rows of script
fclist: [ ...] # some fc
rasterlist = [...] # many raster
for raster in rasterlist:
rasterpro = arcpy.ProjectRaster_management(raster, "in_memory\rasterpro", 25832)
for fc in fclist:
os.makedirs(newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
arcpy.SplitRaster_management(rasterpro,
newfolder + "\" + filenamenew + "_" + os.path.basename(fc), # it is a correct path, which should work fine
filenamenew + "_" + os.path.basename(fc) + "_",
"POLYGON_FEATURES",
"#",
"NEAREST",
"#",
"#",
"#",
"#",
"#",
"#",
fc)
# some more rows of script
Most of the times it works just fine, but sometimes the script just stops there and doesn´t go on. If i restart the script, sometimes it works without problems, then sometimes the first itteration does not work. So the problem does not occur after a set number of itteration, the same Feature Class or with the same raster!
Did i do something wrong with my inputs in arcpy.SplitRaster_management
?
EDIT: If i run the script inside my Editor (Pyzo), the problem does not occur. Only if i use it inside a Toolbox in ArcGIS Pro.
arcpy raster arcgis-pro
my problem is that my script sometimes stuck then it use arcpy.SplitRaster_management
.
import arcpy
import os
#nearly 700 rows of script
fclist: [ ...] # some fc
rasterlist = [...] # many raster
for raster in rasterlist:
rasterpro = arcpy.ProjectRaster_management(raster, "in_memory\rasterpro", 25832)
for fc in fclist:
os.makedirs(newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
arcpy.SplitRaster_management(rasterpro,
newfolder + "\" + filenamenew + "_" + os.path.basename(fc), # it is a correct path, which should work fine
filenamenew + "_" + os.path.basename(fc) + "_",
"POLYGON_FEATURES",
"#",
"NEAREST",
"#",
"#",
"#",
"#",
"#",
"#",
fc)
# some more rows of script
Most of the times it works just fine, but sometimes the script just stops there and doesn´t go on. If i restart the script, sometimes it works without problems, then sometimes the first itteration does not work. So the problem does not occur after a set number of itteration, the same Feature Class or with the same raster!
Did i do something wrong with my inputs in arcpy.SplitRaster_management
?
EDIT: If i run the script inside my Editor (Pyzo), the problem does not occur. Only if i use it inside a Toolbox in ArcGIS Pro.
arcpy raster arcgis-pro
arcpy raster arcgis-pro
edited 7 mins ago
Tim
asked 4 hours ago
TimTim
13818
13818
1
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
They are local.
– Tim
1 hour ago
add a comment |
1
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
They are local.
– Tim
1 hour ago
1
1
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:
newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:
newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
They are local.
– Tim
1 hour ago
They are local.
– Tim
1 hour ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313043%2fscript-sometimes-stuck-at-arcpy-splitraster-management%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313043%2fscript-sometimes-stuck-at-arcpy-splitraster-management%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Probably not the cause of your problems but you should use os.path.join to combine paths instead of things like this:
newfolder + "\" + filenamenew + "_" + os.path.basename(fc))
– BERA
2 hours ago
Are the rasters being sourced locally on your computer or from a network directory?
– artwork21
1 hour ago
They are local.
– Tim
1 hour ago