POST
|
I got it to work by changing the workspace environments to the default gdb. I ran the tool and didn't select any options for cell size and it ran using MAXOF which I guess is the default. Oddly enough, when I ran it again, I selected a cell size of 50 and it failed with the error that I didn't set the size. I'm pretty sure something is up with it and I think it may be related to this thread. python - Multiprocessing issues with ArcPy - Geographic Information Systems Stack Exchange
... View more
04-09-2017
10:13 AM
|
0
|
1
|
833
|
POST
|
I used the syntax from the help file and pretty much got the same thing. I wonder if anyone else is having problems running the weighted sum tool. Can you try? I am using 10.4 >>> # Import system modules ... import arcpy ... from arcpy import env ... from arcpy.sa import * ... ... # Set environment settings ... env.workspace = "C:/SpatialAnalysisClassProject/LR911Calls.gdb" ... ... # Set local variables ... inRaster1 = "ZPublicHousing" ... inRaster2 = "ZCrimeCalls" ... inRaster3 = "ZPovertyRate" ... WSumTableObj = WSTable([[inRaster1, "VALUE", 0.33], [inRaster2, "VALUE", 0.33], ... [inRaster3, "VALUE", 0.33]]) ... ... # Check out the ArcGIS Spatial Analyst extension license ... arcpy.CheckOutExtension("Spatial") ... ... # Execute WeightedSum ... outWeightedSum = WeightedSum(WSumTableObj) ... ... # Save the output ... outWeightedSum.save("C:/SpatialAnalysisClassProject/LR911Calls.gdb/weightsumout") ... Runtime error Traceback (most recent call last): File "<string>", line 20, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Functions.py", line 6787, in WeightedSum in_weighted_sum_table) File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Utils.py", line 53, in swapper result = wrapper(*args, **kwargs) File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\sa\Functions.py", line 6784, in Wrapper out_raster) File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 010050: Cell size is not set. Failed to execute (WeightedSum).
... View more
04-09-2017
09:34 AM
|
0
|
2
|
833
|
POST
|
Are you still having this issue? I am having an issue with it...
... View more
04-09-2017
09:30 AM
|
0
|
0
|
1396
|
POST
|
I'm not so great at python...but like this? If so, it still failed. It fails when I run the stand alone tools, too. And thank you for your reply! ... import arcpy ... arcpy.env.cellSize = "50" ... ... # Local variables: ... PolytoPointCensus = "PolytoPointCensus" ... ZCrimeCalls = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZCrimeCalls" ... PolytoPointCensus__3_ = "PolytoPointCensus" ... ZPoverty_Rate = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPovertyRate" ... PolytoPointCensus__2_ = "PolytoPointCensus" ... ZPublic_Housing = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPublicHousing" ... Weighte_ZCri1 = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\Weighte_ZCri1" ... ... # Process: Crime calls Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus, "ZCrimeCalls", ZCrimeCalls, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Poverty Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus__3_, "ZPovRate", ZPoverty_Rate, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Public Housing Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus__2_, "ZPublicHousing", ZPublic_Housing, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Weighted Sum ... # tempEnvironment0 = arcpy.env.cellSize ... tempEnvironment1 = arcpy.env.mask ... arcpy.env.mask = "Little Rock Municipal Boundary" ... arcpy.gp.WeightedSum_sa("C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZCrimeCalls VALUE 0.33;C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPovertyRate VALUE 0.33;C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPublicHousing VALUE 0.33", Weighte_ZCri1) ... # arcpy.env.cellSize = tempEnvironment0 ... arcpy.env.mask = tempEnvironment1 ... ... Runtime error Traceback (most recent call last): File "<string>", line 35, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 010050: Cell size is not set. Failed to execute (WeightedSum).
... View more
04-08-2017
07:42 PM
|
0
|
4
|
833
|
POST
|
I cannot run a weighted sum or overlay because I get the message that I don't have the cell size set--but I do in fact have it set. Here's the python for my entire process (copied from a model)--and you can see that I set it. Anyone else having this issue? ... # Import arcpy module ... import arcpy ... ... ... # Local variables: ... PolytoPointCensus = "PolytoPointCensus" ... ZCrimeCalls = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZCrimeCalls" ... PolytoPointCensus__3_ = "PolytoPointCensus" ... ZPoverty_Rate = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPovertyRate" ... PolytoPointCensus__2_ = "PolytoPointCensus" ... ZPublic_Housing = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPublicHousing" ... Weighte_ZCri1 = "C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\Weighte_ZCri1" ... ... # Process: Crime calls Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus, "ZCrimeCalls", ZCrimeCalls, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Poverty Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus__3_, "ZPovRate", ZPoverty_Rate, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Public Housing Kernel Density ... arcpy.gp.KernelDensity_sa(PolytoPointCensus__2_, "ZPublicHousing", ZPublic_Housing, "50", "5280", "SQUARE_MAP_UNITS", "DENSITIES", "PLANAR") ... ... # Process: Weighted Sum ... tempEnvironment0 = arcpy.env.cellSize ... arcpy.env.cellSize = "50" ... tempEnvironment1 = arcpy.env.mask ... arcpy.env.mask = "Little Rock Municipal Boundary" ... arcpy.gp.WeightedSum_sa("C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZCrimeCalls VALUE 0.33;C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPovertyRate VALUE 0.33;C:\\SpatialAnalysisClassProject\\LR911Calls.gdb\\ZPublicHousing VALUE 0.33", Weighte_ZCri1) ... arcpy.env.cellSize = tempEnvironment0 ... arcpy.env.mask = tempEnvironment1 ... ... Runtime error Traceback (most recent call last): File "<string>", line 36, in <module> File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\geoprocessing\_base.py", line 506, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 010050: Cell size is not set. Failed to execute (WeightedSum).
... View more
04-08-2017
04:55 PM
|
0
|
6
|
2255
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|