|
POST
|
Hi Bill, Are you running specific tools when the geoprocessing runs in the foreground? Take a look at the section 'System tools may execute in foreground even when background is enabled' in the following link: http://resources.arcgis.com/en/help/main/10.2/index.html#//00210000003q000000
... View more
12-30-2013
01:42 AM
|
0
|
0
|
1300
|
|
POST
|
Hi Katie, You could use the following: import arcpy
import pythonaddins
class ComboBoxClass1(object):
"""Implementation for UserData_addin.combobox (ComboBox)"""
def __init__(self):
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", "NAME = " + selection)
arcpy.RefreshActiveView()
def onFocus(self, focused):
self.mxd = arcpy.mapping.MapDocument('current')
global layer
layer = arcpy.mapping.ListLayers(self.mxd, "Stream_Temperatures")[0]
self.items = []
with arcpy.da.SearchCursor(layer, ["SampleYear"]) as cursor:
for row in cursor:
self.items.append(row[0]) If the 'Stream_Temperatures' field is a TEXT field, you wlil need to change the query to: arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", "NAME = '" + selection + "'")
... View more
12-27-2013
10:28 AM
|
0
|
0
|
4028
|
|
POST
|
You will just need to add "\\" to your FullOutFile variable. Ex: FullOutFile = OutLocation + "\\" + OutFile Previously you were trying to save the output to: Q:\LFP_GLOBAL\OUTPUT.gdbCDF The above will save write the correct path: Q:\LFP_GLOBAL\OUTPUT.gdb\CDF
... View more
12-27-2013
06:41 AM
|
0
|
0
|
1012
|
|
POST
|
Add the following to the end of your code: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] lyr = arcpy.mapping.Layer(layername) arcpy.mapping.AddLayer(df, lyr) arcpy.RefreshTOC() arcpy.RefreshActiveView()
... View more
12-27-2013
06:31 AM
|
0
|
0
|
3382
|
|
POST
|
Hello, Can you provide the path to your SDE connection file?
... View more
12-23-2013
08:42 AM
|
0
|
0
|
2648
|
|
POST
|
No...they are external groups. Do you have ArcGIS Server with Image Extension? The Image Extension allows you to publish mosaic datasets to ArcGIS Server as either a map or image service. ArcGIS Desktop 9.3 will be able to consume these 10.0 services. If you do not have ArcGIS Server with this extension, can you provide some more details? 1. What type of rasters are you trying to mosaic (i.e. SIDs, TIFFs, etc)? 2. What type of geodatabase are you trying to mosaic these rasters to (i.e. File, Personal, SDE)?
... View more
12-23-2013
07:08 AM
|
0
|
0
|
2360
|
|
POST
|
That was my mistake. I sent the wrong script. I've attached the correct one.
... View more
12-23-2013
05:10 AM
|
0
|
1
|
3301
|
|
POST
|
Hi Manojraj, What I usually do is create a polygon from the map click. Ex: query.geometry = pointToPolygon(map, evt.mapPoint.x, evt.mapPoint.y, 200);
function pointToPolygon(map, pointX, pointY, tolerance){
var xmin = pointX - tolerance;
var ymin = pointY - tolerance;
var xmax = pointX + tolerance;
var ymax = pointY + tolerance;
var extent = new Extent(xmin, ymin, xmax, ymax, map.spatialReference)
var polygon = new Polygon(new SpatialReference({wkid:102100}));
polygon.addRing([[extent.xmin, extent.ymin], [extent.xmin, extent.ymax], [extent.xmax, extent.ymax], [extent.xmax, extent.ymin]]);
return polygon
}
... View more
12-23-2013
04:59 AM
|
0
|
0
|
789
|
|
POST
|
You won't have to make any changes to the parameters. The script should run on a feature class with the input as a 'Table View' and the output type as 'Required'.
... View more
12-23-2013
02:39 AM
|
0
|
0
|
3301
|
|
POST
|
Hello, In your MakeRasterLayer function, it doesn't look like you have the 'imgname' variable defined to anything. Try the following instead: arcpy.MakeRasterLayer_management(in_img_path, layername, "#")
... View more
12-23-2013
02:23 AM
|
0
|
0
|
3382
|
|
POST
|
Hi Jon, Not sure how the user is entering the start and end date, but if they enter it as '12/23/2013', you could use the dateutil module to convert this to YYYYMMDD. Ex: import dateutil from dateutil import parser startDate = '12/23/2013' print parser.parse(startDate).strftime('%Y%m%d')
... View more
12-23-2013
02:05 AM
|
0
|
0
|
1870
|
|
POST
|
Hi Ravindra, You will want to place an 'r' in front of the path to your sde connection file. Ex: desc = arcpy.Describe(r"C:\TEMP\sdeCon\connection.sde")
conPop = desc.connectionProperties() Take a look at the following link for more information on setting paths: http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000000r000000
... View more
12-23-2013
01:53 AM
|
0
|
0
|
1374
|
|
POST
|
Thanks a lot guys. I tried the print NPPEquation and it works fine. "Min NPP1" is one of the values in the filter list. The thing is that I've set the output raster dataset to include the name of the NPPEquation ("Min NPP" for example). So I guess is not the right approach to have spaces in the string variable names. Not sure if there is a way round that... Cheers Toni Toni, You can use an IF statement to replace the space using python's replace method. Example: if " " in NPPEquation:
NPPEquation = NPPEquation.replace(" ", "_")
... View more
12-20-2013
10:01 AM
|
0
|
0
|
1838
|
|
POST
|
Hi Ian, Attached is a toolbox with an added python script. The script will export a table, or feature class's table, to a CSV or XLS file. You can publish this as an ArcGIS Server GP Service, and then use the Geoprocessor class to run this in your application.
... View more
12-20-2013
08:32 AM
|
0
|
0
|
3301
|
|
POST
|
Glad this is working. Also, wanted to point out, in case you were wondering, the difference between Raster Layer and Raster Dataset is that Raster Layer will allow your tool to have a dropdown and choose a raster within your current map document.
... View more
12-20-2013
04:32 AM
|
0
|
0
|
2682
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|