POST
|
Mr. Patterson this is what I get if I do it manually <Result 'true'>. I have no idea what that means but it doesn't delete anything. I tried also to pass the name to a variable and put the variable at Delete_management but with no result also. What can be reason for that?
... View more
01-20-2016
12:42 PM
|
0
|
2
|
386
|
POST
|
Hello I have a loop in which if the statement is TRUE I want to delete the last element and add the new. I am posting a part of the code because as many times I tried it, still it doesn't delete the shp and the rasters. Any help is much appreciated. Thanks elif arithmos >= valueslist[num_pnts2 - 1]:
OM = n - 1
#VIEWSHED = "view" + str(OM)
#POINT = "point" + str(OM) + ".shp"
arcpy.Delete_management("point" + str(OM) + ".shp", "")
arcpy.Delete_management("view" + str(OM), "") In a few words at this part of the code, the last element will be for n=4 ,view4 and I want to delete the (OM = 4-1 => OM = 3) view3.
... View more
01-20-2016
08:14 AM
|
0
|
6
|
2290
|
POST
|
From the tests I runned until now for 5 points: 1. Always the first row of the viewshed tool is the non visible area. 2. If you run the viewshed tool for each of the 5 points separately you will have different visible and non visible areas than if you run the shp with the 5 points at once in the viewshed, however the non visible area remain always the same, the first row with value "0". 3, If you run the process from the observer points you will get the pixels that are visible from each point "the raster that can be seen only by the specific observer" which fits with the viewshed if you run it separately for one point (1.) each time, but it has very big differences with the viewshed that comes up if you run the viewshed tool with input the shp where all points are together in one file (2.) ! So the non visible area is always the first row even if you run the viewshed for 1 point or for 15. ! Still remains unknown why the viewshed raster has less rows than the number of points you used.
... View more
01-15-2016
05:26 AM
|
0
|
1
|
1381
|
POST
|
I understand what you mean but can't I choose as an input also a shp with maximum 15 points to run the viewshed? I think that I can do it, from 1-15 points right? My problem is that the viewshed for the 15 points for example it will appear a viewshed raster with only 7 rows in which I won't know which correspond to which point and that's ok, but also I don't know what row is that that represents the invisible area. Is it the first row with value 0 always?
... View more
01-14-2016
04:13 PM
|
0
|
1
|
1381
|
POST
|
You remember well Mr Patterson, no it's not that with the tabular points. I am confused with the fact that I have built an application to run several viewsheds for 1, 2, 3..15 points, and of course in the viewshed I get, I don't have always 2,3,4,....16 rows as the number of points + the invisible area are, but less, and moreover I am asking to esnure that, the invisible area is always in the first row of the viewshed?
... View more
01-14-2016
04:09 PM
|
0
|
3
|
1381
|
POST
|
Hello, I am facing a problem with viewshed analysis, when I am using > 1 point till 15, not all tthe points are represented at the viewshed (i am using points as nodes not as points in a polyline) which is logic, but the most important is that I am a bit confused with, which is the non visible area.Is it always the first row with the value 0?
... View more
01-14-2016
01:11 PM
|
0
|
9
|
4798
|
POST
|
thank you, I didn't want to update it I was just want to take the value, I will just pass it to a txt.
... View more
01-12-2016
10:55 AM
|
0
|
0
|
574
|
POST
|
Hi I have severous viewsheds (view1, view2, view3 etc) and I want to calculate the percent of visible areas per viewshed. I have the following code but I always get zero "0" at the second for loop and i have been trying that for hours, any help? Thanks in advance import arcpy
import os
from arcpy import env
from arcpy.sa import *
#workspace = arcpy.GetParameterAsText(0)
arcpy.env.workspace = "C:Visibility/Calc_View/View"
ras = arcpy.ListRasters("view*", "GRID")
#cellsize = arcpy.GetParameterAsText(1)
fields = ["VALUE", "COUNT"]
for r in ras:
with arcpy.da.UpdateCursor(r, fields) as cursor:
total = 0
for row in cursor:
total = total + row[1]
print r, total
C = arcpy.da.UpdateCursor(r, fields, """"VALUE" = 1""")
for row in C:
percent = row[1] / total
print r, percent
... View more
01-12-2016
08:26 AM
|
0
|
4
|
2461
|
POST
|
speachless!! Jermaine Gordon You Are God (Official Music Video) Lord I Surrender Album - YouTube
... View more
12-17-2015
06:31 AM
|
0
|
0
|
950
|
POST
|
Hello, I have the following code that I am trying to make it work as a tool. If I pass the paths to variables it works perfectly but when I pass them as Tool Parameters when I don't have any result. I don't know what to correct, but there must be some problem with the combination of tool parameter name + "the file a create". I tried also to import it to variable outside tool and then import the variable for use in the tool but nothing changed. This is the code: import arcpy
import os
from arcpy import env
from arcpy.sa import *
workspace = arcpy.GetParameterAsText(0)
values = arcpy.GetParameterAsText(1)
num_pnts = int(values)
demodel = arcpy.GetParameterAsText(2)
outReclass = Reclassify(demodel, "Value", RemapRange([[100,300,1],[301,500,0]]), "NODATA")
outReclass.save(workspace + "rcls")
n = 0
for i in range(num_pnts):
n += 1
# Spatially Balanced Points
arcpy.CreateSpatiallyBalancedPoints_ga(workspace + "rcls", 1, workspace + "point" + str(n))
inRaster = workspace + "rcls"
inObserverFeatures = "point" + str(n) + ".shp"
outViewshed = Viewshed(inRaster, inObserverFeatures)
outViewshed.save(workspace + "view" + str(n))
... View more
12-17-2015
05:39 AM
|
0
|
2
|
3252
|
POST
|
Problem solved at line 40 at the variable inRaster, it must be imported the path of the reclassified raster like that: inRaster = "C:/Results/ArcMap/Visibility/Calc_View/rcls" I don't know why, it is the first time I am doing it, but only by that it works.
... View more
12-16-2015
03:56 AM
|
1
|
0
|
828
|
POST
|
I tried it your way but although I put again workspace = ... and the makeRasterLayer_management("rcls", "rclsLayer, "") I get only an Parameters are not valid. ERROR 000865: Input raster: rcls does not exist. Failed to execute (MakeRasterLayer). The code after the reclassification can run only if I put rcls to the table of contents, something influences that but I don't know why?
... View more
12-16-2015
03:11 AM
|
0
|
0
|
828
|
POST
|
Neil I also tried to put inRaster = "outReclass" .... .... but with no result.
... View more
12-16-2015
02:37 AM
|
0
|
1
|
828
|
POST
|
Hello I have the following code (its a bit big but very simple), and the problem I am facing is that I cannot pass the raster rcls to the Create Spatially Balanced tool, unless I add it to Table of Contents (lines 32- 42). I am building a new tool, so I don't want to interrupt the proccess by adding something to the Talbe of Contents, cracking my tool to 2 tools. The "values" and "num_pnts" variable (line 13-14) show the number of points that will be created. Thanks in advance. import arcpy
import os
from arcpy import env
from arcpy.sa import *
#workspace = arcpy.GetParameterAsText(0)
workspace = "C:/Results/ArcMap/Visibility/Calc_View/"
# arithmos simion kai viewsheds
#value = arcpy.GetParameterAsText(1)
values = 2
num_pnts = int(values)
#height_val = arcpy.GetParameterAsText(2)
height_val = 100
height = int(height_val)
#demodel = arcpy.GetParameterAsText(3)
#demMAXResult = arcpy.GetRasterProperties_management(demodel, "MAXIMUM")
#demMAXResult = arcpy.GetRasterProperties_management(demodel, "MINIMUM")
demMAXResult = arcpy.GetRasterProperties_management("C:/Results/ArcMap/Visibility/Calc_View/tin2ras3g_1", "MAXIMUM")
demMINResult = arcpy.GetRasterProperties_management("C:/Results/ArcMap/Visibility/Calc_View/tin2ras3g_1", "MINIMUM")
demMAX = demMAXResult.getOutput(0)
demMIN = demMINResult.getOutput(0)
LIMIT = float(demMAX) - height
# Reclassify
outReclass = Reclassify("tin2ras3g_1", "Value", RemapRange([[float(demMIN),LIMIT,1],[LIMIT,demMAX,0]]), "NODATA")
outReclass.save("C:/Results/ArcMap/Visibility/Calc_View/rcls")
n = 0
for i in range(num_pnts):
n += 1
# Spatially Balanced Points
inRaster = "rcls"
outPoints = "C:/Results/ArcMap/Visibility/Calc_View/point" + str(n)
arcpy.CreateSpatiallyBalancedPoints_ga(inRaster, 1, outPoints)
... View more
12-15-2015
08:15 AM
|
0
|
6
|
3278
|
Title | Kudos | Posted |
---|---|---|
1 | 04-05-2015 02:15 PM | |
1 | 12-16-2015 03:56 AM | |
1 | 11-26-2015 02:56 AM | |
1 | 04-03-2015 08:39 AM | |
1 | 02-26-2016 02:24 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|