POST
|
@JulioGarrido Little late to the party here, but it looks like no one has responded to your inquiry. You can use Topo to Raster (Spatial Analyst)—ArcGIS Pro | Documentation or Create a TIN surface—ArcGIS Pro | Documentation to create a raster surface from cross-sections that has a fully populated elevation attribute field.
... View more
05-01-2024
07:57 AM
|
0
|
0
|
193
|
POST
|
Ahh okay. Yes, that script could certainly be refined to do some linear conversions based on spatial reference of the input or force a consistent projected spatial reference throughout processing regardless of the inputs. Glad you got it to work though!
... View more
08-03-2020
11:03 AM
|
0
|
0
|
2432
|
POST
|
Hi Britta Schroeder. Sorry to hear the script isn't working for you. Amazingly after 5 years I downloaded the script tool and ran it on some sample data in a geodatabase and it worked. I'm guessing that error you are seeing is due to a schema lock on the data or perhaps the environment the data are in. Additionally, you could try initiating an edit session in the script by using arcpy.da.Editor before the script enters the update cursor near the end of the script. You could also try exporting the data to a shapefile or possibly a new geodatabase and testing the script on the new export.
... View more
08-03-2020
10:36 AM
|
2
|
2
|
3119
|
POST
|
This looks great Thomas thanks. I'm not sure if the download link is working for other people, but it is downloading an empty zip file for me for some reason.
... View more
02-04-2019
07:38 AM
|
0
|
1
|
686
|
POST
|
Abdullah Anter is correct. If you use that tool instead of using your UTM grid and spatial join you can then iterate through the UTM field to select features with the same calculated UTM zone and then get the field value for the UTM zone to input into your projection tool.
... View more
02-09-2017
06:56 AM
|
0
|
0
|
666
|
POST
|
I've posted a reply on this thread that might be useful for anyone searching on this topic.
... View more
01-05-2017
08:12 AM
|
0
|
0
|
988
|
POST
|
Here is how I've used the spatial analyst tools to return a longest flow path line from the top of a watershed hope this helps: import arcpy
from arcpy.sa import *
from arcpy import env
watershed = # Path to watershed polygon
dem = # Path to DEM
fdr = # path to flow direction
env.workspace = # path to output workspace
try: intermediate = [] # Empty container for intermediate data fdrClip = ExtractByMask(fdr, watershed) # Clip the flow direction raster to the watershed polygon arcpy.SetProgressorLabel("Computing longest flow path for the basin...") flowLength = Int(FlowLength(fdrClip, "DOWNSTREAM")) # Compute a downstream flow length raster arcpy.CalculateStatistics_management(flowLength) maxValue = int(arcpy.GetRasterProperties_management(flowLength, "MAXIMUM").getOutput(0)) # Get the maximum cell value from the flow length maxCell = Con(flowLength, "1", where_clause="Value = {}".format(repr(maxValue))) # Return the maximum cell from flow length lfpRas = CostPath(maxCell, dem, fdrClip, destination_field="Value") # Use cost path to compute raster line from the max cell intermediate.append(lfpRas) rasLine = arcpy.RasterToPolyline_conversion(lfpRas, "rasLine", "ZERO", simplify="NO_SIMPLIFY") # Generate a polyline from the cost path raster intermediate.append(rasLine) lfp = arcpy.Dissolve_management(rasLine, "LongestFlowPath") # Dissolve the polyline to generate a single longest flow path line intermediate.append(lfp) finally:
# Clean up intermediate data
arcpy.SetProgressorLabel("Removing Intermediate data... ")
for data in intermediate:
arcpy.Delete_management(data)
del intermediate
... View more
01-05-2017
08:07 AM
|
1
|
1
|
4560
|
POST
|
I use the uncompressed size method in the tool validation just as a quick way to automatically select the largest raster in a TOC which is usually the watershed wide Lidar. To get the actual size of a raster with it's associated files such as .ovr and .aux.xml using the os library I've used this code: import os
raster = # Path to raster file
basename = os.path.basename(raster).split(".")[0]
rootFolder = os.path.dirname(raster)
associatedFiles = [os.path.join(rootFolder,f) for f in next(os.walk(os.path.dirname(raster)))[2] if f.split(".")[0] == basename]
if len(os.path.basename(raster).split(".")) == 1:
fileList = next(os.walk(raster))[2]
dirSize = sum([os.path.getsize(os.path.join(raster,f)) for f in fileList])
rasSize = sum([os.path.getsize(f) for f in associatedFiles]) + dirSize
else:
rasSize = sum([os.path.getsize(f) for f in associatedFiles])
def convertSize(size,precision=2):
suffixes=['B','KB','MB','GB','TB']
suffixIndex = 0
while size > 1024 and suffixIndex < 4:
suffixIndex += 1 #increment the index of the suffix
size = size/1024.0 #apply the division
return "%.*f %s"%(precision,size,suffixes[suffixIndex])
print convertSize(rasSize) The conversion part of the script was found here. The os.getsize function only returns the size of the file not the size on disk which incorporates the allocated size on the hard drive for the file metadata as seen in the properties of a file.
... View more
03-30-2016
11:02 AM
|
2
|
2
|
2219
|
POST
|
I know this is an old post, but if anyone is looking to do this with ArcMap 10x you can cast your raster as a Raster Object and use the uncompressedSize property to get the size on disk.
... View more
02-25-2016
09:15 AM
|
0
|
4
|
2219
|
POST
|
Also, the alias name does not seem to recognize a case change. So if you are attempting to change just the first letter to uppercase and it does not appear to be successful you may want to look at the workaround here.
... View more
02-16-2016
04:36 AM
|
1
|
0
|
2053
|
POST
|
Oh okay I misunderstood what Hilary was looking to do with the CSV file she uploaded. I thought she was attempting to create polygons from the lat\long points in the csv. Maybe she is attempting to generate a point feature class from the CSV and use a spatial join with one-to-many join operation on an existing polygon feature?
... View more
02-03-2016
07:29 AM
|
0
|
1
|
2751
|
POST
|
I'm a little confused as to how you would attempt to create polygon's from that CSV you uploaded. Some of the entries only have a single LAT\LONG entry so you would only have a single point for that entry. Each zip code entry needs to have 3 or more LAT\LONG entries to make a polygon.
... View more
02-03-2016
06:49 AM
|
0
|
3
|
2751
|
POST
|
It looks like you are attempting to edit the csv table. Export it to a geodatabase table from the attribute table menu: Then it will have assigned OIDs and you should be able to edit it.
... View more
02-03-2016
06:47 AM
|
0
|
0
|
2751
|
POST
|
I know this is an old thread but this seems to work for me: import os
filepath = r"C:\project_front.accdb"
os.system("start MSACCESS.EXE {}".format(filepath )) Thanks Wes, I just updated.
... View more
02-03-2016
05:45 AM
|
0
|
1
|
1253
|
POST
|
Sure. It would definitely help to know what your attribute fields are that you are trying to update. If you could either send a sample dataset of Centroid_Sites_Fbr and Centroid_Sites_Fiber or at least provide a screen shot of the full attribute tables that would help us get started. Thanks.
... View more
01-26-2016
11:57 AM
|
1
|
0
|
1125
|
Title | Kudos | Posted |
---|---|---|
1 | 01-26-2016 10:40 AM | |
1 | 10-05-2015 09:10 AM | |
1 | 01-19-2016 06:01 AM | |
1 | 01-06-2016 05:27 AM | |
1 | 12-09-2015 05:59 AM |
Online Status |
Offline
|
Date Last Visited |
05-01-2024
04:58 PM
|