POST
|
In the Symbology window, click on the down arrow next to the word More. That will open a pop-up window where you can then edit all symbols.
... View more
01-09-2024
06:11 AM
|
2
|
1
|
276
|
POST
|
As DanPatterson suggested, it may be that your fields in the excel table are still not numeric. General format doesn't always work. Whenever I have had this issue, I had to format the XY fields as numeric. Or just do as you did and convert to .csv.
... View more
01-09-2024
06:06 AM
|
0
|
0
|
627
|
POST
|
The S coordinates range from 0 to 550,000 meters (the routed distance of the river) while the N coordinates are +/- 0 to 600 meters depending on side of the river. It occurred to me after stepping away from my computer for a bit, that I can convert the SN coordinates to UTM based on an arbitrary starting point near the start of the river. Converting the SN to UTM coordinates and then importing into ArcPro worked!
... View more
01-06-2024
09:57 PM
|
0
|
0
|
363
|
POST
|
Any tips or ideas are very welcome! I converted XY coordinates for sample sites within a river to SN coordinates based on distance along a river centerline (routed river) and distance from the river centerline (Locate Features along route). See below figure from a publication on this. I now want to run ordinary kriging with anisotropy however I first need to figure out how to spatially reference the SN coordinates. The S coordinates range from 0 to 550,000 meters while the N coordinates are +/- 0 to 600 meters depending on side of the river. I have been tinkering around with creating a new GCS and have searched the ESRI Community Resources and web for tips and tutorials. The ESRI page on Defining New Coordinate Systems is quite vague. https://pro.arcgis.com/en/pro-app/3.1/help/mapping/properties/define-a-new-coordinate-system.htm. Below is a screen capture of one of my attempts to create a GCS. After creating this (and other attempts), when I tried to display the SN coordinates, that fails due to invalid geometry.
... View more
01-06-2024
07:28 AM
|
0
|
2
|
424
|
POST
|
One option would be to convert the four points into a polygon and use the polygon in your map.
... View more
01-05-2024
07:39 AM
|
0
|
0
|
347
|
POST
|
I am converting XY coordinates to SN coordinates (orthogonal curvilinear coordinates) for points within a stream. The purpose is basically to straighten out the stream to take into account the linear nature. One end of the riverline is set as S=0, N=0. S increases with the length of the river centerline. N increases with distance from the centerline. N values are positive on the right side of the line and negative on the left side. I could highlight all points on the right or left side to manually assign these .... but I have thousands of points. Is there a way to automate the assignment for whether the points are on the right or left side of a centerline?
... View more
01-04-2024
02:24 PM
|
0
|
2
|
485
|
POST
|
Thank you! I suspected that it was something simple.
... View more
08-07-2012
08:19 AM
|
0
|
0
|
2160
|
POST
|
I am multiplying several .tif files by set values and adding the results together using raster calculator in arcgis 10.1. If I manually load the files into raster calculator, the calculation completes. Unfortunately I need to do this several hundred times so I would like to automate the process. I created a model in model builder (and it worked) and then exported the code to python to see the format. Here is that coding # Import arcpy module import arcpy # Check out any necessary licenses arcpy.CheckOutExtension("spatial") # Local variables: RT_v4_2027_0_albers_tif = "RT_v4_2027_0_albers.tif" RT_v4_2027_1_albers_tif = "RT_v4_2027_1_albers.tif" RT_v4_2027_2_albers_tif = "RT_v4_2027_2_albers.tif" rt_sum_2027_100_tif = "Y:\\RT_annual\\rt_sum_2027_100.tif" # Process: Raster Calculator arcpy.gp.RasterCalculator_sa("((\"%RT_v4_2027_0_albers.tif%\" * 31) + (\"%RT_v4_2027_1_albers.tif%\" * 28) + (\"%RT_v4_2027_2_albers.tif%\" * 31)) * 100", rt_sum_2027_100_tif) As a first step toward automating I then tried to calculate the above for the next set of files using this code: # Import arcpy module import arcpy # Check out any necessary licenses arcpy.CheckOutExtension("spatial") # Local variables: RT_v4_2028_0_albers_tif = "Y:\\RT_albers\\RT_v4_2028_0_albers.tif" RT_v4_2028_1_albers_tif = "Y:\\RT_albers\\RT_v4_2028_1_albers.tif" RT_v4_2028_2_albers_tif = "Y:\\RT_albers\\RT_v4_2028_2_albers.tif" rt_sum_2028_100_tif = "Y:\\RT_annual\\rt_sum_2028_100.tif" arcpy.gp.RasterCalculator_sa("((\"%RT_v4_2028_0_albers_tif%\" * 31) + (\"%RT_v4_2028_1_albers_tif%\" * 28) + (\"%RT_v4_2028_2_albers_tif%\" * 31)) * 100", rt_sum_2028_100_tif) I get the following error whether I run the script in the ArcGIS python window or in IDLE: Runtime error Traceback (most recent call last): File "<string>", line 24, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) ExecuteError: ERROR 000539: Error running expression: rcexec() Traceback (most recent call last): File "<expression>", line 1, in <module> File "<string>", line 8, in rcexec AttributeError: 'str' object has no attribute 'save' Failed to execute (RasterCalculator). Why does this script seem to be looking for an attribute called 'save'? Any suggestions would be greatly appreciated.
... View more
08-02-2012
01:35 PM
|
0
|
2
|
5973
|
POST
|
Are you running the python script in IDLE? Is it possible that a newer version of Python was installed? If you are using a shell to run the python script, check the pathways that are being used (in the IDLE shell, look under the File menu for path browser). I ran into a problem after upgrading to 10.1 but when I opened a .py file, my computer defaulted to python 2.6 instead of python 2.7 which is used by 10.1.
... View more
06-27-2012
11:08 AM
|
0
|
0
|
361
|
POST
|
I am having the same problem in IDLE and it started after loading the pre-release for 10.1. I followed the directions to make sure the pathways in the Desktop10.1.pth file were correct as indicated on this site (http://resources.arcgis.com/en/help/main/10.1/index.html#//002z00000008000000) but that did not help. I rebooted just in case but that did not resolve anything. I have searched various online sites but have not found any other solution. In IDLE import os works. Import arcpy does work in the python window of ArcCatalog. How would I check to see if the IDLE Python shell has access to the arcpy directory?
... View more
06-27-2012
10:54 AM
|
0
|
0
|
361
|
POST
|
I am still not quite understanding why there appears to be a lock that did not used to happen but have found a clumsy work around. For whatever reason, my script will run two files and then throw the read-only error. When I changed Sebastian's code from: if count%30 == 0: # this is modulus operator, so should be true the first iteration and every 30 iterations thereafter. to if count%2 == 0: python will continue to run and place 2 zone stats tables in sequentially numbered new folders. Not a great solution but at least the bleeping thing is running. Thank you again! I'll check back in case you think of something else that could lead to the lock issue I have encountered. Follow up: my 'solution' only worked for about 10 files and the read only error returned.
... View more
04-11-2012
11:33 AM
|
0
|
0
|
888
|
POST
|
Thanks to both of you for the quick response. I incorporated the code provided by Sebastian and I think it is running correctly but I get the same error message as before (see below). What made me think it could be a memory issue is that the python code would run for a few files and then throw the below error message. If I delete the partially created table, and close the python shell (am running IDLE, but error also happens when just using command prompt), and the python script - I can reopen the script and run it using the very same file that threw the error. However, the number of files that were processed continued to decline and now it will not run at all. It is true that the files are read only but the script was working previously with read only files. It may help to know that I am calculating zonal stats for NHD catchments by NHD region using the NHD regional catchment grids and a climate raster for the conterminous US - so fairly large spatial summaries. I'll try the splittext option because you are correct Curtis, the strip option does not always work. File "F:\Data\Reg09\attributetifsReg09.py", line 56, in <module>
arcpy.gp.ZonalStatisticsAsTable_sa(region, "VALUE", raster, out+name+".dbf","DATA", "ALL")
<class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function.
Workspace or data source is read only.
Workspace or data source is read only. [The F:\Data\Reg09\update1\ workspace is read only.]
ERROR 010067: Error in executing grid expression. Zonal statistics program failed
Failed to execute (ZonalStatisticsAsTable).
ERROR 999999: Error executing function.
Workspace or data source is read only.
Workspace or data source is read only. [The F:\Data\Reg09\update1\ workspace is read only.]
ERROR 010067: Error in executing grid expression. Zonal statistics program failed
Failed to execute (ZonalStatisticsAsTable).
... View more
04-11-2012
10:08 AM
|
0
|
0
|
888
|
POST
|
I am running into memory issues as described in this thread. I see where Curtis and Sebastian recommend and provide coding to create a temporary folder/workspace but am not sure how to work that into the python code I am using. To use ListRasters, I had the impression that you needed to set the env.workspace to the folder containing the raster files. My python code is below....any suggestions on how to modify this code? I should add that sometimes this script runs and sometimes not. I think the issue is memory but just saw something about a search curser. Not sure what that is. Thank you, Jodi import arcpy, os, tempfile, shutil, sys, time, traceback
from arcpy import env
from arcpy.sa import *
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
# Set the current workspace, this is folder that contains the .tif files for climate variables
arcpy.env.workspace = "F:\\Data\\Reg09\\tifs"
# Set Geoprocessing environments
arcpy.env.overwriteOutput = True
#Set Local variables
region =('F:\\Data\\NHD\\grids\\reg09_lambi') # this is the folder with the NHD catchment grid (raster)
out = "F:\\Data\\Reg09\\update\\"
rasterList = arcpy.ListRasters("*", "TIF")
for raster in rasterList:
name = os.path.basename(raster).strip(".tif") # removes .tif from the file name
arcpy.env.cellSize = "MINOF"
arcpy.gp.ZonalStatisticsAsTable_sa(region, "VALUE", raster, out+name+".dbf","DATA", "ALL")
print" Raster " + str(raster) + " processing completed at " + time.asctime( time.localtime(time.time()) )
... View more
04-11-2012
07:26 AM
|
0
|
0
|
828
|
POST
|
Did you ever resolve this issue? I am fighting the same problem.
... View more
03-06-2012
12:12 PM
|
0
|
0
|
1624
|
POST
|
I have looked at several posts here and on other sites but have not found a solution to the problem I am having with this python script. In this script I use 2 nested 'for' loops to extract a series of variables by month (month = 0 - 11) from 5 netcdf files and then mosaic together each extracted variable. The script runs but after processing about 3 variables, I get the following error statement: ExecuteError: ERROR 999999: Error executing function. Failed to copy raster dataset Failed to execute (MosaicToNewRaster). My suspicion is that the cache memory has been exceeded. I tried using arcpy.Delete_management(SCRATCH) but then received the error that the scratch space no longer existed after only one variable was processed. Maybe I am putting that statement in the wrong place? Any other suggestions?
# Import arcpy module
import arcpy
import os
# Set Geoprocessing environments
arcpy.env.scratchWorkspace = "C:\\WORKSPACE\\Process_4"
SCRATCH = arcpy.env.scratchWorkspace
# Script arguments
ENA = arcpy.GetParameterAsText(0)
if ENA == '#' or not ENA:
ENA = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_ena_eh5_2030-2034_avg_trim_v4.nc" # provide a default value if unspecified
NRM = arcpy.GetParameterAsText(1)
if NRM == '#' or not NRM:
NRM = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_nrm_eh5_2030-2034_avg_trim_v4.nc" # provide a default value if unspecified
PNW = arcpy.GetParameterAsText(2)
if PNW == '#' or not PNW:
PNW = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_pnw_eh5_2030-2034_avg_trim_v4.nc" # provide a default value if unspecified
PSW = arcpy.GetParameterAsText(3)
if PSW == '#' or not PSW:
PSW = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_psw_eh5_2030-2034_avg_trim_v4.nc" # provide a default value if unspecified
SRM = arcpy.GetParameterAsText(4)
if SRM == '#' or not SRM:
SRM = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\srf_srm_eh5_2030-2034_avg_trim_v4.nc" # provide a default value if unspecified
Output_Location = arcpy.GetParameterAsText(5)
if Output_Location == '#' or not Output_Location:
Output_Location = "F:\\GISdata\\Projects\\USGSClimateChange\\climateproj\\summary\\" # provide a default value if unspecified
#Variable list
for variable in ['T33', 'TA', 'TAMAX', 'TAMIN', 'TOTRNF', 'ET', 'RT','RNFS']:
# SCRATCH = arcpy.env.scratchWorkspace I attempted to place SCRATCH within the loop thinking that it would be recreated. Nope.
#Month Iteration
for month in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]:
ENA_Layer = SCRATCH +"\\ENA"+variable+str(month)
NRM_Layer = SCRATCH +"\\NRM"+variable+str(month)
PNW_Layer = SCRATCH +"\\PNW"+variable+str(month)
PSW_Layer = SCRATCH +"\\PSW"+variable+str(month)
SRM_Layer = SCRATCH +"\\SRM"+variable+str(month)
# Process: Make NetCDF Raster Layer (169)
arcpy.MakeNetCDFRasterLayer_md(ENA, variable, "x", "y", ENA_Layer, "", "time "+ str(month), "BY_INDEX")
# Process: Make NetCDF Raster Layer (157)
arcpy.MakeNetCDFRasterLayer_md(NRM, variable, "x", "y", NRM_Layer, "", "time "+ str(month), "BY_INDEX")
# Process: Make NetCDF Raster Layer (145)
arcpy.MakeNetCDFRasterLayer_md(PNW, variable, "x", "y", PNW_Layer, "", "time "+ str(month), "BY_INDEX")
# Process: Make NetCDF Raster Layer (133)
arcpy.MakeNetCDFRasterLayer_md(PSW, variable, "x", "y", PSW_Layer, "", "time "+ str(month), "BY_INDEX")
# Process: Make NetCDF Raster Layer (121)
arcpy.MakeNetCDFRasterLayer_md(SRM, variable, "x", "y", SRM_Layer, "", "time "+ str(month), "BY_INDEX")
# Process: Mosaic To New Raster (25)
arcpy.MosaicToNewRaster_management("\"" + ENA_Layer +";"+ NRM_Layer +";"+ PNW_Layer +";"+ PSW_Layer +";"+ SRM_Layer +"\"", Output_Location, variable+"_"+str(month)+"2032", "PROJCS['WGS_1984_Lambert_Conformal_Conic',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['false_easting',0.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',-102.3000030517578],PARAMETER['standard_parallel_1',30.0],PARAMETER['standard_parallel_2',60.0],PARAMETER['latitude_of_origin',52.0],UNIT['Kilometer',1000.0]]", "", "1", "1", "MEAN", "FIRST")
arcpy.Delete_management(SCRATCH)
... View more
02-02-2012
05:31 AM
|
0
|
1
|
710
|
Title | Kudos | Posted |
---|---|---|
2 | 01-09-2024 06:11 AM |
Online Status |
Offline
|
Date Last Visited |
03-20-2024
07:17 PM
|