|
POST
|
2. The field name length is limited. User has to mouse over to see the full name. Please see attached screen. If I mouse over it, it says "Number of Employees"; otherwise it is cut short in display. How to fix the display? Not sure if it is supported in version 2.4, but this is now controlled in the popuprendererskin with width setting at the top of the skin code. R_
... View more
06-10-2013
04:17 PM
|
0
|
0
|
2958
|
|
POST
|
About half of over 2000? Sounds like maybe you are running into the "Maximum number of records retured by the server:" limitation which is 1000 by default in 10.1. Have you tried changing this in your service to a value larger than the number of polygons in your dataset (it is a server Parameter setting)? R_
... View more
06-10-2013
04:13 PM
|
0
|
0
|
1369
|
|
POST
|
Normally get that error when the mxd is being viewed in ArcMap or ArcCatalog at the time the script runs. Can't just close file either, need to exit ArcMap/Catalog before you run the script. Also, look in task manager and make sure there isn't a "runaway" arcmap that is "locking" the file. R_
... View more
06-10-2013
03:58 PM
|
0
|
0
|
2473
|
|
POST
|
Fraser, Just played with this a little, if you only want the two basemaps, and no choice, this is what I did. I set my first basemap to have maxscale="4000" and my second to have minscale="4000" and set both visible="true" in the main config. This way, it displays the one up until 1:4000, zoom in again and it switches to the other basemap. However, you still get the list of available basemaps to choose from, so, I went into (I'm using eMapSwitcherWidget, but MapSwitcher is similar) to the eMapSwitcherWidget.mxml, down near the bottom there is the basemapsButton id. I changed as follows: <s:Button id="basemapsButton"
includeIn="thumbnailOptions"
label="{basemapsLabel}"
rollOut="startBasemapsHideTimer(event)"
rollOver="basemapsButton_rollOverHandler(event)"
skinClass="com.esri.viewer.skins.BasemapsButtonSkin"
visible="false"/> This way, you no longer get the basemap button or options, and it will always have a basemap loaded depending on what scale they are currently at. R-
... View more
06-10-2013
03:17 PM
|
0
|
0
|
2127
|
|
POST
|
@Wayne, thanks.. I tried it both ways.. this time it ran through the process and executed the xytoline_management tool.. I checked the env and it was correct this time.. thanks for the heads up.. :0) anyways, the tool ran and the csv was converted to lines.. but then it threw another error.. same as the first.. here is the error message... Traceback (most recent call last):
File "C:\temp\GIS_projects\Sample_tripData\test.py", line 22, in <module>
arcpy.XYToLine_management(input_table,fc,"TSLONGDD","TSLATDD","TELONGDD","TELATDD","GEODESIC","TRIPSEQNUM")
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 2913, in XYToLine
raise e
ExecuteError: ERROR 999999: Error executing function.
The table was not found. [tripLines]
Failed to execute (XYToLine). here is my new updated code... # Import system modules
import arcinfo
import arcpy
import sys
if arcpy.CheckProduct("ArcInfo") == "Available":
print "ArcInfo available, processing script..."
print "importing modules and set environment...."
#overwrite pre-existing files
arcpy.env.overwriteOutput = True
#set workspace
arcpy.env.workspace = "c:\\temp\\gis_projects\\sample_tripdata\\test.gdb"
fc = "tripLines"
if arcpy.Exists(fc):
arcpy.Delete_management(fc, "FeatureClass")
featclass = "c:\\temp\\gis_projects\\sample_tripdata\\test.gdb\\tripLines" # Set local variables
print "setting data input and output variables..."
input_table = "C:\\temp\\GIS_projects\\Sample_tripData\\A6_TEMP_ATL_TRIP_HAULx.csv"
#XY To Line
print "running XY to Line Geoprocessing tool..."
arcpy.XYToLine_management(input_table,featclass,"TSLONGDD","TSLATDD","TELONGDD","TELATDD","GEODESIC","TRIPSEQNUM")
# Process to delete identical line features...
# Set the field upon which the identicals are found
fields = "Shape;TRIPSEQNUM;Shape_Length"
# Set the XY tolerance within which to identical records to be deleted
xy_tol = "0.0002 Miles"
# Set the Z tolerance to default
z_tol = "0"
print "Deleteing identical features..."
# Execute Delete Identical
arcpy.DeleteIdentical_management(fc, fields, xy_tol, z_tol)
print "Dropping leading character..."
cursor = arcpy.UpdateCursor(fc)
field = "TRIPSEQNUM"
row = cursor.next()
while row:
# set value of field to only those values after the zero value location
# I want to strip off the first character within the value of the field
row.setValue(field, row.getValue(field)[0:])
cursor.updateRow(row)
row = cursor.next()
del fc, input_table, row, cursor, out_lines, input_table, field
print "Processing Complete!"
else:
print "ArcInfo license not available"
sys.exit("ArcInfo license not available")
What happens if you make the above change in blue? If that doesn't work, what happens if you make the changes above in red? R_
... View more
06-10-2013
11:36 AM
|
0
|
0
|
2829
|
|
POST
|
Any chance you have set the file association to python (instead of Notebook.exe) for the service account? You would have to log onto the computer using this account, then go through the steps above to make sure the service account is associating the files with python. It sounds like it is associating it correctly when using your profile. Just a thought, try it and see if it helps, R_ also, as Michael said above, do you have it set to run whether logged on or not? in Win7, they use new network authentication, and I can NOT make it work with the user logged on or not as our group policy (set by the domain admins) does not allow passing the password over the network. As a "workaround", I have to leave my scripting machine logged on at all times with my service account.
... View more
06-10-2013
09:22 AM
|
0
|
0
|
2589
|
|
POST
|
One way would be to get raster properties, but, of course, you need to make sure that the raster datasets all have staticstics calculated first. Not sure if there is a faster way, as getrasterproperties is not the "fastest" method around. import arcpy
arcpy.env.workspace = "\\\\mcflight01\\MCFlightData\\HGIS\\Data\\imagery.gdb"
rasters = arcpy.ListRasters("*", "All")
for raster in rasters:
# Process: Get Raster Properties
min = arcpy.GetRasterProperties_management(raster, "MINIMUM", "")
# Process: Get Raster Properties (2)
max = arcpy.GetRasterProperties_management(raster, "MAXIMUM", "")
print "max for ",str(raster)," = ", max
print "min for ",str(raster)," = ", min The above code will list all raster data sets in the workspace, then iterate through them and print out the max/min for each dataset that has statistics. Might want to run a separate script to calculate the statistics, as it is pretty time intesive, and would not need to be run each time. You would put the math that you need here where the print statements are, and it should perform your equation on each raster dataset in the workspace. R_
... View more
06-10-2013
08:51 AM
|
0
|
0
|
833
|
|
POST
|
If you are trying to update the field on the currently selected feature(s), then CalculateField_management would do it. If itering through all the features in your FC, might iterate through with UpdateCursor, if date < current date, then update field. R_
... View more
06-10-2013
08:21 AM
|
0
|
0
|
1006
|
|
POST
|
Fraser, Just a thought, if you don't want the extra load of the listners running, the tile map switch can be handled with the built in tools. Look at the layer tag http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag_overview/01m30000000p000000/ and see for tiled layers, there is a displaylevels tag, and only the cache levels listed here will display for the map. Also, there are max/min scale you can use for the layers themselves. So, you can use the displaylevels or min/max scale to have it "turn off" the tiled layer and "turn on" the dynamic one at a particular LOD/scale. R_
... View more
06-10-2013
08:10 AM
|
0
|
0
|
2127
|
|
POST
|
Yes, you can load data from a FGDB, then publish as a mapservice only. Then, depending on whether you need a feature or dynamic service, you can load as dynamic data (type="dynamic" http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/Base/MapServer ) or type="feature" http://gis01.wch-rcc.com/ArcGIS/rest/services/Base/Base/MapServer/1 by appending the individual layer number in the url. However, as Dasa pointed out, you will not be able to "edit" this layer unless it is actually published as a FeatureService. R_
... View more
06-10-2013
07:42 AM
|
0
|
0
|
998
|
|
POST
|
So you see that it was trying to compare a single string "ELEVATION" to a list of objects. basically, could do something like:
fieldList = arcpy.ListFields(os.path.join(dirpath, filename))
for f in fieldList:
if f.name == "ELEVATION":
arcpy.AddField_management(os.path.join(dirpath, filename), "SL_ELEV", "SHORT", "", "", "", "", "NULLABLE")
arcpy.CalculateField_management(os.path.join(dirpath, filename), "SL_ELEV", "int(round( !ELEVATION!, -2))", "PYTHON")
Which is the same thing, I just used list comprehension to shorten the list, iterator, and comparison into one line instead of three. (love list comprehension, just wish I were better at it...) R_
... View more
06-06-2013
02:18 PM
|
0
|
0
|
1761
|
|
POST
|
Not sure, but could be due to not using "pytonic" paths. try:
out_lines = r"C:\temp\GIS_projects\Sample_tripData\test.gdb\trip_lines"
or
out_lines = "C:\\temp\\GIS_projects\\Sample_tripData\\test.gdb\\trip_lines"
R_
... View more
06-06-2013
01:11 PM
|
0
|
0
|
2829
|
|
POST
|
Replace the work part with this should do it:
for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"):
for filename in filenames:
if "ELEVATION" in [f.name for f in arcpy.ListFields(os.path.join(dirpath, filename))]:
arcpy.AddField_management(os.path.join(dirpath, filename), "SL_ELEV", "SHORT", "", "", "", "", "NULLABLE")
arcpy.CalculateField_management(os.path.join(dirpath, filename), "SL_ELEV", "int(round( !ELEVATION!, -2))", "PYTHON")
else:
print "no Elevation field for dataset ", filename
Of course, you can skip the else: part, only needed if you want it to do something when ELEVATION field not present. R_
... View more
06-06-2013
12:32 PM
|
0
|
0
|
1761
|
|
POST
|
Deleted my last post after re-reading. However, it looks like you can use one for loop to replace all three that you are running. might try something like: import arcpy import os, math from arcpy import env in_workspace = r"F:/Inventory_export_dev/testRnd" fcList = [] for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"): for filename in filenames: arcpy.AddField_management(os.path.join(dirpath, filename), fieldName, "SHORT", "", "", "", "", "NULLABLE") arcpy.CalculateField_management(os.path.join(dirpath, filename), "SL_ELEV", "int(round( !ELEVATION!, -2))", "PYTHON") No need to put the filenames in a list if all you are going to do is iterate through them again. Just as well do the work on the first iteration. Of course, this will errror out if any of the FC's in your in_workspace do not have the numeric ELEVATION field. R_
... View more
06-06-2013
11:59 AM
|
0
|
0
|
7101
|
|
POST
|
Looks like you are trying to round the ELEVATION variable before you have set it to anything. Need to either set it or extract it from the attributes first. Also, both your for loops are working the same data, in one you assign it to list, in the other you assign to elev. But, in both cases, you are still just itering through the values in fcList, so just as well do it in one swoop. Think you are looking for something like this:
import arcpy
import os, math
from arcpy import env
in_workspace = r"F:/Inventory_export_dev/testRnd"
fcList = []
for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"):
for filename in filenames:
fcList.append(os.path.join(dirpath, filename))
for list in fcList:
arcpy.AddField_management(list, fieldName, "SHORT", "", "", "", "", "NULLABLE")
arcpy.CalculateField_management(list, "SL_ELEV", "int(round( !ELEVATION!, -2))", "PYTHON")
Haven't tested, but should go through each FC in your fcList add the field and populate it with the round value. R_
... View more
06-06-2013
11:40 AM
|
0
|
0
|
5340
|
| 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 |
Wednesday
|