|
POST
|
Hi Phil, Although the question might seem easy, there is no standard tool in ArcGIS to create this type of output. The Solar Radiation tools in ArcGIS can evaluated the polygon derived in your analysis: ArcGIS Help (10.2, 10.2.1, and 10.2.2) For questions like yours, a python script might be an option. I created a start for you based on a script "sunpos.py" downloaded from: https://raw.githubusercontent.com/minopret/sunpos/master/sunpos.py The idea is to iterate over a date interval. During the iteration there is a second loop over a time interval. I would suggest that you avoid getting near to sunrise and sunset since this would create an angle so small that you would have to clear a lot of forest. Based on the location provided (lat, lon values in script) the altitude and azimuth are returned for each date, time. To make this data manageable, I rounded azimuth to a whole number and create a dictionary to hold the minimum altitude values of the sun. At the end the dictionary is sorted and can be used (not yet implemented) to translate to distance of clearing forest. The azimuth and distance should be translated to a geographic location and can be combined to create a polygon for logging.
import sunpos
# downloaded from: https://raw.githubusercontent.com/minopret/sunpos/master/sunpos.py
import collections
from datetime import date, timedelta
# setting
start_date = date(2014, 5, 15)
end_date = date(2014, 9, 30)
start_time = 9 # 9 am
end_time = 17 # 5 pm
time_interval = 1 # 0.25 = every 15 minutes
lat = 4.5
lon = -74
dct = {}
d = start_date
delta = timedelta(days=1)
while d <= end_date:
t = start_time
while t <= end_time:
alt, azi = sunpos.time_and_location_to_sun_alt_azimuth(d.year, d.month, d.day, t, lat, lon)
azi2 = round(azi)
if azi2 in dct:
if alt < dct[azi2]:
dct[azi2] = alt
else:
dct[azi2] = alt
# update dictionary (rounded azimuth vs min altitud)
t += time_interval
d += delta
odct = collections.OrderedDict(sorted(dct.items()))
# now you have a list of angles that you could translate to a distance
print "azimuth\taltitud"
for azi, alt in odct.items():
print "{0}\t{1}".format(azi, alt if alt <= 90 else 360 - alt)
Hope this helps you a bit. Kind regards, Xander
... View more
09-28-2014
11:21 AM
|
0
|
6
|
3264
|
|
POST
|
Hola Fernando, El Network Analyst es una extensión para ArcGIS que permite el análisis de redes. La extensión viene con muchas herramientas. En el enlace abajo puedes encontrar más información en español: Ayuda de ArcGIS (10.2, 10.2.1 y 10.2.2) El Make Route Event Layer (Crear capa de eventos de ruta (Referencia lineal)) es una herramienta usado frecuentemente en el análisis de rutas. No hace parte de la extensión Network Analyst, pero es una herramienta estándar. En el enlace abajo encuentras más información sobre esta herramienta: Ayuda de ArcGIS (10.2, 10.2.1 y 10.2.2) En el enlace abajo puedes encontrar una guía para determinar la mejor ruta: Ayuda de ArcGIS (10.2, 10.2.1 y 10.2.2) Cordialmente, Xander
... View more
09-28-2014
10:53 AM
|
0
|
0
|
641
|
|
POST
|
I guess an easy way to do it if you have multiple points is to create a TAB separated text file and add the data using the "Add Layer from File": Kind regards, Xander Or have look at: ArcGIS Online Learning & Help Resources | ArcGIS Blog Create maps and apps—Help | ArcGIS https://engineering.purdue.edu/watersheds/iwlaprojects/IWLA%202013/ArcGIS%20Online%20Guide%201-%20Site%20Locations%20Map…
... View more
09-28-2014
10:27 AM
|
1
|
0
|
472
|
|
POST
|
Hi Sean, Basically the error is telling you that the date (2007-05-07) is not a float (decimal value). The other thing is that your code will result in a list that holds a precipitation value, a date, a precipitation value, a date, etc. It would probably be more appropriate to work with a nested list like this:
date = data[0]
prec = float(data[1])
lst_date_prec = [date, prec]
month = int(date.split("-")[1])
if month in lst_months:
growing.append(lst_date_prec)
This results i a list where each item contains a list of a precipitation value and the corresponding date. It really depends on what you want to do with the list... Kind regards, Xander
... View more
09-27-2014
09:39 AM
|
1
|
2
|
3237
|
|
POST
|
Hi Jeff, The link below has a nice discussion on the topic and also lists some (commercial) software: Looking for interpolation tool to produce river bathymetry (topography) from sections - Geographic Information Systems S… I have worked on some projects for the Dutch Ministry of Transport, Public Works and Water Management and a specialist developed his own interpolation for in house use. Quite an interesting job he did. And like that there will be many more examples. Don't worry about sending original data. As long as the structure is the same, you can send some dummy data. The idea is to have something to program against. Kind regards, Xander
... View more
09-26-2014
02:19 PM
|
0
|
0
|
3325
|
|
POST
|
Although Neil's snippet allows for determining the percentage of NoData in a raster, Steve provides a solution that does exactly what you are looking for and does not require Spatial Analyst. To show a little what you can do with it, here's a litte sample:
import arcpy
ras = r"D:\Xander\LineasTransmision\Modelo\fgdb\RastersModelo.gdb\cmp_totexl02a"
props = ['MINIMUM', 'MAXIMUM', 'MEAN', 'STD', 'ALLNODATA', 'ANYNODATA', 'UNIQUEVALUECOUNT']
for prop in props:
try:
print "{0}: {1}".format(prop, arcpy.GetRasterProperties_management(ras, prop))
except Exception as e:
print "{0}: {1}".format(prop, e)
Returns:
# MINIMUM: 22
# MAXIMUM: 396
# MEAN: 97,7094252332071
# STD: 51,5918279932734
# ALLNODATA: 0
# ANYNODATA: 1
# UNIQUEVALUECOUNT: 327
So you will just have to test for the property "ALLNODATA" and when the result is '1', skip that raster. Kind regards, Xander
... View more
09-26-2014
12:09 PM
|
5
|
9
|
4097
|
|
POST
|
Hi Jeff, I don't think this method or any of the interpolation methods available in ArcGIS, will give you the result you are anticipating. This type of interpolation requires specialized software. You mentioned you have access to such a tool, but require 3D polylines as input. If you are willing to provide a sample of your input data, I can have a look at it and write some python script to create the 3D polylines. If that tool doesn't work, I would probably create some code to use the centerline of the river and the borders of the river itself to create parallel lines following the river and cross those with the depth information to create 3D lines following the river and use those for the interpolation (through a TIN). While I write this, I would say that you are not the first person to confront this type of problem. I'll give my friend (the Internet) a visit and get back to you if I find something useful... Kind regards, Xander
... View more
09-26-2014
11:05 AM
|
0
|
2
|
3325
|
|
POST
|
Hi Ben, You're absolutely right, you can use Python for this purpose too and the syntax will be slightly different. It depend on where the code is executed. Your script sample would work as standalone too (after including the import and setting the workspace). The syntax that was returned by the Raster Calculator Tool uses the existence of the TOC and how the rasters are called there (example: "mytif.tif - Band_1"). In your script you use the slash, and that indicates that the TIFF is considered a dataset and the bands are rasters within the dataset. A small script to explain what I mean:
import arcpy
import os
folder = r"D:\Xander\GeoNet\TIFF_CON"
arcpy.env.workspace = folder
lst_ds = arcpy.ListDatasets()
for ds in lst_ds:
print "dataset: {0}".format(ds)
arcpy.env.workspace = os.path.join(folder, ds)
lst_ras = arcpy.ListRasters()
for ras in lst_ras:
print "raster: {0}".format(ras)
Results in:
dataset: mytif.tif
raster: Band_1
raster: Band_2
raster: Band_3
raster: Band_4
My folder where the TIFF resides is my initial workspace. When I list the datasets in that workspace it will find the TIFF, setting the TIFF as workspace allows me to list the rasters (the bands inside the TIFF). If you would like to access the rasterbands without setting the workspace to your TIFF you would have to "join" the folder, dataset (TIFF) and each rasterband:
redband = os.path.join(folder, NameOfYourTIFF, "Band_1")
And yes, defining raster objects allows for much easier syntax. For instance I you want to sum 3 rasters without defining the individual rasters as raster objects you would have to use a nested arcpy.sa.Plus tool. If you define the rasters as raster objects you can simply use the + sign to sum them. Kind regards, Xander
... View more
09-25-2014
05:41 AM
|
0
|
0
|
3297
|
|
POST
|
maybe this thread is of any help: execute raster calculator geoprocessing tool from vb.net It contains some links to the Help pages too. Kind regards, Xander
... View more
09-24-2014
03:52 PM
|
0
|
1
|
887
|
|
POST
|
Hi Edmond, The small image you placed on top of your screen shot is an image from pre 10.0. Since 10.0 the toolbar has been stripped. All the functionality you are looking for (and more) can be found in the Spatial Analyst Toolbox: Kind regards, Xander
... View more
09-24-2014
03:48 PM
|
1
|
2
|
3022
|
|
POST
|
Hi Ben, I tried it with a screen dump saved as TIFF and it worked for me: Executing: RasterCalculator Con(("mytif.tif - Band_1"==255) & ("mytif.tif - Band_2"==255) & ("mytif.tif - Band_3"==255), 1, 0) D:\Xander\tmp\NIData.gdb\bla Start Time: Wed Sep 24 14:28:01 2014 Con((Raster(r"mytif.tif - Band_1")==255) & (Raster(r"mytif.tif - Band_2")==255) & (Raster(r"mytif.tif - Band_3")==255), 1, 0) Succeeded at Wed Sep 24 14:28:08 2014 (Elapsed Time: 7,00 seconds) If you look closely the bands in my TIFF are called differently. I did not add the TIFF to the TOC, but the bands inside the TIFF to the TOC. There is no need to use spaces right around the equal sings (that used to be necessary when using float rasters, but the bands are integer). Kind regards, Xander
... View more
09-24-2014
12:32 PM
|
1
|
2
|
3297
|
|
POST
|
There should be a star "Correct Answer" that you can press next to the post that answered you question.
... View more
09-24-2014
12:14 PM
|
0
|
6
|
3237
|
|
POST
|
Hi Dan, Could you post the code you are using? It seems something is not right with the import statement(s). The def does not include any import of arcpy, if arcpy is not imported globally it will not be available inside the def... Kind regards, Xander
... View more
09-24-2014
09:12 AM
|
0
|
0
|
2445
|
|
POST
|
Hi Sean, you´re welcome. Can you mark the question as answered? Kind regards, Xander
... View more
09-24-2014
07:43 AM
|
0
|
8
|
3237
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|