|
POST
|
Guess that doesn't apply then. Hopefully this post is in time for ESRI to look into it before the release of 3.4 (didn't know it was even available yet). R_
... View more
07-02-2013
07:20 AM
|
0
|
0
|
1363
|
|
POST
|
It uses the file extention to determine what type of table/file you are trying to create. If you are trying to write the dbf inside a FGDB, then you are most the way there. Just drop the .dbf extension from the filename and it will create a FGDB table instead and will let you save it there. R_
... View more
07-02-2013
07:16 AM
|
0
|
0
|
1898
|
|
POST
|
env.workspace = FD_addr # DEM/DSM raster locations raster_list = arcpy.ListRasters("*", "ALL") # adds DEM/DSM raster is where I got the information that you were using a DEM (Digital Elevation Model by USGS). What I meant by using ArcMap tools, was not actually using the raster calculator, but the spatial analys "Con" tool. What I would do is open ArcMap, open the catalog window, right-click on Toolbox (or My Toolboxes) folder and choose "New" Model. Then, drag the sa.Con tool onto the model (if you can't find it, open the search window in ArcMap, select Tools, and type in Con, hit enter) double click the Con icon and fill in the parameters, click save and run the model. If you get the results you want, open the model, choose file, export python script. This will give you a starting point, might have to clean up the syntax, etc. (i.e. Arc accepts "-" in path, python does not) and should give you an idea of how to code the "tool". R_ Noticed this uses the gp.Con_sa tool not the sa.Con tool. however, it is 10.1 that dumps this code out, and don't see ANY documentation for it.
... View more
07-01-2013
04:19 PM
|
0
|
0
|
1555
|
|
POST
|
Your raster is a raster, it is the symbology chosen in your mapping application that determines what "colors" are assigned to which raster value. I am assuming you are using ArcMap to view your created rasters. you should be able to open the ArcMap Advanced Settings Utililty, go to the Raster tab and set the default resampling mode, then go to the Symbols/Graphics tab and set the Default color Ramp to the one you want. Then close ArcMap and re-open. Now, when you add rasters to it, it should, by default, load with the color ramp and resampling mode that you set as the default in the settings. R_
... View more
07-01-2013
03:47 PM
|
0
|
0
|
1862
|
|
POST
|
And here's my script... #This script is designed to remove legacy accuracy data from a file
#geodatabase if updated accuracy data exists. Legacy accuracy data are
#stored in each feature class under the following field names: B, C,
#D, E, F, G, H, I, J, K, and L. Current accuracy data is stored in a
#field called A. The script evaluates the value in the A field, if the
#value is greater than zero and not null the data in the legacy fields
#for that record need to be set to zero or Null if it is a string
#field.
import arcpy
#Define a workspace
arcpy.env.workspace = r"C:\Example.gdb"
#Create a list of feature classes
fcList = arcpy.ListFeatureClasses()
#Assign variable fields
fields = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]
#Loop through each feature class and set to zero or Null the values in
#the legacy accuracy fields (B-L) if data exists in the A field for
#that record
for fc in fcList:
with arcpy.da.UpdateCursor(fc,fields) as cursor: # the code below is for the da.cursor, not original cursor, so I assumed you meant this one.
for row in cursor:
if (row[0] > 0 and row[0] is not None): # this is how to test for NULL in python
row[1] = 0
row[2] = 0
row[3] = 0
row[4] = 0
row[5] = 0
row[6] = 0
row[7] = None
row[8] = None
row[9] = None
row[10] = None
row[11] = None
cursor.updateRow(row) #indent this so it updates the row before next row in cursor
Any direction would be appreciated! Thanks. Kerry Can't really test it now, but might be due to loading the fileds in as tuple rather than a list. Also, python doesn't have if x == Null, need to test for is or is not None. Of course, all this code assumes that all your fields in the fields list are numeric, otherwise, would need quotes (except for the None's). Also, this won't perform the update "if data exists for field A", but if there is a numeric value in field A that is greater than 0. if (str(row[0]) is not None: if (len(str(row[0])) >= 1: would be a couple possible tests for if A has data (including zeros) R_
... View more
07-01-2013
03:07 PM
|
0
|
0
|
1213
|
|
POST
|
Not really sure how to see Arcmessages as I do everything in the command line, and not really familiar with the Arc command window/python tools. How are you running this? In the command window, or making a script tool or what? If running in console window, after it runs, if you type:
print elevation
print raster0
print raster1
do you get any results? also, can you create the elevation raster that you are after within arcmap using the tools? I am wondering if it is creating an empty output, so is not saving it. I would make sure that it is possible to do what you are trying using arcmap tools/model and get the desired output. then work on the python code (export from the model builder and modify). Might also look into the DEM format. I have tried to use this in the past for certain tasks, and found that it does not support state plane coordinates. Perhaps one of the input rasters is not supported or valid for this operation? If you can do the raster calculations in ArcMap, then that would rule this out as well. R_
... View more
07-01-2013
02:45 PM
|
0
|
0
|
1555
|
|
POST
|
I'm trying to make a tool for end users to use in Arc, and I want to make the SQL statement a variable. So far I have this:
Where_Clause= """"GRIDCODE"=6"""
yourvar = 6
Where_Clause= arcpy.AddFieldDelimiters(Quakesim_lyr,"GRIDCODE") + " = â??" + yourvar + "â??" # this if GRIDCODE is actually string
Where_Clause= arcpy.AddFieldDelimiters(Quakesim_lyr,"GRIDCODE") + " = " yourvar ## this if GRIDCODE is numeric
arcpy.SelectLayerByAttribute_management ("Quakesim_lyr", "NEW_SELECTION", Where_Clause)
which works fine in Python, but when I run it as a tool in arc, I'm getting Invalid Statement errors, even though the statement is the same. Any advice? Bonus points if you can help me with the next step, which would be to replace the '6' with a variable that I could change. Could try something like above to code your where clause using a variable. though thanos_cp78's is more elegant. Guess I need to learn how to use the .format stuff.... R_
... View more
07-01-2013
02:03 PM
|
0
|
0
|
1396
|
|
POST
|
This is set with the <symbols> tag at the bottom of the config file and can be set individually for lines, points, and polygons (fill and outline).
<symbols>
<simplefillsymbol color="0xff0000" alpha="0.0">
<outline color="0x00FFFF" alpha="0.8" width="2" />
</simplefillsymbol>
<!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol
defined for your point results NOT BOTH. picturemarkersymbol will override
simplemarkersymbol if you do not have it commented out. -->
<!-- <simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.5"
xoffset="0" yoffset="0" angle="0"> <outline style="solid" color="0x000000"
alpha="1" width="1"/> </simplemarkersymbol> -->
<picturemarkersymbol url="assets/images/i_search.png" height="20" width="20" xoffset="1" yoffset="1" />
<simplelinesymbol color="0x00FFFF" alpha="0.8" width="2" />
</symbols>
Also, if you are running version at least 3.0.8 or newer, the symbology can be set differently for each layer searched using the <symbology> tag.
<symbology>
<simplefillsymbol color="0x00FFFF" alpha="0">
<outline color="0x00FFFF" alpha="1.0" width="2" />
</simplefillsymbol>
</symbology>
For points, you can select a standard marker (red square, diamond, triangle, etc), or a picture marker symbol. Furthur information on these settings is in the XML configuration.pdf file included with the eSearch download. R_
... View more
07-01-2013
12:47 PM
|
0
|
0
|
4862
|
|
POST
|
Are you talking about the color ramp when you load into ArcMap? If so, can you change it to what you want in the symbology properties? Also, if so, not sure you can assign this to the mosaic itself. When my ArcMap started loading .tiff files as greyscale by default (I had to go into symbology and change color ramp) it was an ArcMap setting that had gotten corrupted. Had to wipe my ESRI registry folder and re-buid it. R_
... View more
07-01-2013
11:50 AM
|
0
|
0
|
3411
|
|
POST
|
Since you mentioned the field calculator, does that mean you have no issus doing this in ArcMap, or do you need code? If so, in ArcMap, load the FC, right-click and select open attribute table. then, in the upper left of the table, under the drop down arrow, you will see Find and Replace. This will let you find a value and replace with another in all or just selected columns. Should be what you want unless you are after code.
... View more
07-01-2013
10:59 AM
|
0
|
0
|
879
|
|
POST
|
You didn't say what version you are running. If 10.1, look at da.walk ( http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000023000000 ). has an example near bottom of how to iterate through all rasters in the workspace (except for back_up, but can remove that). Basically, it makes a python "list" of your rasters that meet the criteria, that you can use/iterate through for your con statements. R_
... View more
07-01-2013
10:41 AM
|
0
|
0
|
607
|
|
POST
|
The forward slash is not supported in part of the filename for saveaslayerfile tool. In fact, I can't even name a dataset with a slash in it. That must have been added in the TOC of the MXD itself? In any case, it appears as if you are getting the list of layers from the current mxd, so suspect you have no control over the name in the TOC (would be easiest just to not have the slash in the name), so. Could do something like this that would replace any forward slashes with an underscore (this is what ArcMap does if you right-click on that same layer in the MXD and select save as layer file).
# Change Feature Classes to Relative Path Lyr files
import arcpy, csv, os
from arcpy import env
env.overwriteOutput = True
mxd = arcpy.mapping.MapDocument("CURRENT")
messageStr = str(mxd)
arcpy.AddMessage(messageStr)
arcpy.env.workspace = "C:\\GeneralWorkData\\ArcGIS Test Data\\Test Data From,to Martin B\\Relative_Paths_Lyr_Files"
for fc in arcpy.mapping.ListLayers(mxd):
fc = str(fc)
out_layer = fc.replace("\\","_") + ".lyr"
arcpy.SaveToLayerFile_management(fc,out_layer,"RELATIVE")
messageStr = out_layer
arcpy.AddMessage(messageStr)
R_ If this doesn't work, then perhaps you are running into this issue (from the help docs) that will also throw the 000732 error: An invalid subtype on the dataset. To fix this, go to the feature class properties, then click the Subtypes tab and reenter the default subtype code. If the default is 0, click the cell with 0 and reenter that same value. Then apply the change by clicking OK. You will now be able to use the dataset.
... View more
07-01-2013
10:14 AM
|
0
|
0
|
1288
|
|
POST
|
Jeff, Hard to test as your crossdomain is blocking me. However, curious if you still have the issues if you set the mapswitcherwidget.xml layerlist tag to false? <layerlist visible="false"> since the TOC widget is not designed to run with it set to true? R_ Guess it is only blocking the gis1:6080 stuff.
... View more
07-01-2013
09:17 AM
|
0
|
0
|
4694
|
|
POST
|
I don't see them on the print either. Workaround is to use Robert's Export Map widget. It captures them. http://www.arcgis.com/home/item.html?id=12430e982e534fdabe15635828405e45 R_ More testing, the "basic" print task seems to print them. It is when you use the print server ExportWebMapTask that it doesn't print the added icons.
... View more
07-01-2013
07:33 AM
|
0
|
0
|
1943
|
|
POST
|
I copied the 3.1 version directly from my widgets folder in FlashBuilder and pasted into the widgets folder in my 3.3 version. Seems to be working just fine. R_
... View more
07-01-2013
07:30 AM
|
0
|
0
|
2997
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-14-2026 04:00 PM | |
| 1 | 09-14-2022 07:53 AM | |
| 1 | 09-14-2022 08:23 AM | |
| 1 | 05-21-2026 08:53 AM | |
| 1 | 05-14-2026 04:28 PM |
| Online Status |
Online
|
| Date Last Visited |
a week ago
|