|
POST
|
Toni, Did you remove the 'arcpy.Raster' from the arcpy.GetParameterAsText? Also, what data type are you setting for this parameter in your script tool? For example, I had the following script: import arcpy arcpy.CheckOutExtension("Spatial") from arcpy import env env.workspace = r"C:\data\raster\dem" InputZ = arcpy.GetParameterAsText(0) env.mask = InputZ arcpy.Slope_3d("example","Slope","DEGREE","1") I then added this to a toolbox and set the parameter to a Raster Dataset: [ATTACH=CONFIG]30030[/ATTACH] When running the tool, the slope masked the raster I chose.
... View more
12-20-2013
02:42 AM
|
0
|
0
|
2680
|
|
POST
|
Hi Gwen, How are you adding your path? It seems you are using the following example: http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000021000000 import arcpy
subtypes = arcpy.da.ListSubtypes('C:/data/Boston.gdb/Boundary')
for stcode, stdict in subtypes.iteritems():
print('Code: {0}'.format(stcode))
for stkey in stdict.iterkeys():
if stkey == 'FieldValues':
print('Fields:')
fields = stdict[stkey]
for field, fieldvals in fields.iteritems():
print(' --Field name: {0}'.format(field))
print(' --Field default value: {0}'.format(fieldvals[0]))
if not fieldvals[1] is None:
print(' --Domain name: {0}'.format(fieldvals[1].name))
else:
print('{0}: {1}'.format(stkey, stdict[stkey])) When adding a path, you will want to format it one of the following ways: forward slashes 'C:/data/Boston.gdb/Boundary' begin with 'r' r'C:\data\Boston.gdb\Boundary' double back slashes 'C:\\data\\Boston.gdb\\Boundary'
... View more
12-20-2013
01:57 AM
|
0
|
0
|
1017
|
|
POST
|
It sounds like you are running into the following bug: NIM091620 "ImportError: DLL load failed: %1 is not a valid Win32 application." Error displays when ArcMap launches a 64-bit Integrated Development Environment (IDE) as Editor or Debugger and the script imports arcpy. Are you using a 64-bit IDE?
... View more
12-20-2013
01:51 AM
|
0
|
0
|
1852
|
|
POST
|
Try passing the raster as a string rather than a raster object. Ex: arcpy.env.mask = InputZ
InputZ = arcpy.GetParameterAsText(4) I also removed the parentheses for the env.mask. Not sure if this matters, but adding the parentheses will create a tuple rather than a string.
... View more
12-20-2013
01:46 AM
|
0
|
0
|
2680
|
|
POST
|
Hi Jonathan, Essentially all you will need to do is add a field to your mosaic dataset and calcualte the desired date. Is your mosaic dataset updated on a daily basis with new raster imagery? Can you describe was steps you would like to automate?
... View more
12-20-2013
01:41 AM
|
0
|
0
|
1375
|
|
POST
|
Hi Justin, Can you post the entire script? This will help understand what exactly is going on.
... View more
12-18-2013
08:32 AM
|
0
|
0
|
3246
|
|
POST
|
Hi Dragan, You could use the following in the field calculator: Pre-logic Script Code: def update(field1, field2):
if field2 == 'TRUE':
return 'Y'
elif field2 == 'FALSE':
return 'N'
else:
if field1 == 'TRUE':
return 'Y'
elif field1 == 'FALSE':
return 'N' Field3 = update( !Field1!, !Field2!) Be sure to check 'Python' at the top of the field calculator: [ATTACH=CONFIG]29982[/ATTACH]
... View more
12-18-2013
07:18 AM
|
0
|
0
|
1261
|
|
POST
|
Hi Stefan, I misunderstood what you were looking to accomplish before. You are looking to populate the elevation values that are NULL by interpolating the elevation values from the surrounding points. Is that correct? You can do this by performing the following: 1. Select all elevation values that are not NULL (i.e. NOT GelaendeH IS NULL) 2. Run the IDW tool on the selection. Before executing the tool, click on the Environments button > Processing Extent > set the Extent to the point feature class 3. Run the Interpolate Shape tool on the point feature class using the output raster from the IDW tool. A new feature class will be created 4. With the new feature class, select all elevation values that are NULL (i.e. GelaendeH IS NULL) 5. Open the attribute table > Right-click on the GelaendeH field > Calculate Geometry > Z coordinate of point
... View more
12-18-2013
04:45 AM
|
0
|
0
|
5703
|
|
POST
|
Hi Elena, If you use the PopupTemplate class for the infoTemplate, this will show the domain description. Ex: var popupTemplate = new PopupTemplate({
title: "{NAME}",
description: "{District}" // field contains domain
});
var featLyr = new FeatureLayer(featureServiceURL, {
mode: FeatureLayer.MODE_ONDEMAND,
infoTemplate: popupTemplate,
outFields: ["*"]
});
... View more
12-18-2013
02:34 AM
|
1
|
0
|
1408
|
|
POST
|
Hello, Can you post the code you are using? Don't forget to enclose the code with the tags.
... View more
12-18-2013
01:51 AM
|
0
|
0
|
1211
|
|
POST
|
Hi Ken, The input parameter for the contains method can be a point or extent, so try creating a new Extent object for the line's extent. Be sure to load the Extent and SpatialReference modules. Ex: function flashFeature(graphic) { var text; if (graphic.geometry.type == "point") { var extent = graphic.geometry; text = "Point: " + graphic.geometry.x + ", " + graphic.geometry.y; } else if (graphic.geometry.type == "polyline") { var lineExtent = graphic.geometry.getExtent(); var extent = new Extent(lineExtent.xmin, lineExtent.ymin, lineExtent.xmax, lineExtent.ymax, new SpatialReference({ wkid:102100})); text = "Line: " + extent.xmin + ", " + extent.ymin + ", " + extent.xmax + ", " + extent.ymax; } if (!map.extent.contains(extent)) { console.log("Outside current extent - " + text); } else { console.log("Inside current extent - " + text); } map.graphics.add(graphic); }
... View more
12-17-2013
10:00 AM
|
0
|
0
|
1525
|
|
POST
|
You can add the second function and make a copy of the script. One script would be to backup the database, the other would be to restore the database. You would just need to comment out restore_db(conn, db, server_backup_path) for the backup script, and backup_db(conn, db, server_backup_path) for the restore script. Another option you can use is the SQL Server Agent in SQL Server Management Studio: http://lakkireddymadhu.wordpress.com/2013/03/01/scheduling-automated-backup-using-sql-server-2008/
... View more
12-17-2013
08:15 AM
|
0
|
0
|
3688
|
|
POST
|
Hi Andrew, Try selecting your features after the event 'buffer-complete' fires. Ex: gsvc = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
gsvc.on("buffer-complete", function(result){
var symbol = new esri.symbol.SimpleFillSymbol(
esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(
esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([0,0,0,0.85]), 2
),
new dojo.Color([0,0,0,0.35])
);
var bufferGeometry = result.geometries[0];
var graphic = new Graphic(bufferGeometry, symbol);
app.map.graphics.add(graphic);
app.map.setExtent(graphic.geometry.getExtent().expand(1.4));
var query = new Query();
query.geometry = bufferGeometry;
featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW)
});
....
....
function BufferPrj(evt){
BufferDistance = document.getElementById('BufferDistanceKM').value;
if (BufferDistance.length < 1){
alert("Please enter a buffer distance")
}else{
app.map.graphics.clear();
var bufparams = new esri.tasks.BufferParameters();
bufparams.geometries = [ evt.mapPoint ];
//buffer in linear units such as meters, km, miles etc.
bufparams.distances = [ BufferDistance ];
bufparams.geodesic = true;
bufparams.bufferSpatialReference = app.map.spatialReference;
bufparams.unit = esri.tasks.GeometryService.UNIT_KILOMETER;
bufparams.outSpatialReference = app.map.spatialReference;
gsvc.buffer(bufparams);
}
}
... View more
12-17-2013
05:48 AM
|
0
|
7
|
2712
|
|
POST
|
I'm not sure what is causing this error. You may want to follow up with Tech Support. However, you can restore the database by adding another function to the previous code. Ex: def restore_db(conn_obj, db_name, server_backup_path):
cur = conn_obj.cursor()
cur.execute('RESTORE DATABASE ? FROM DISK=?', [db_name, server_backup_path + db_name + r'_sql.bak'])
while cur.nextset():
pass
cur.close()
restore_db(conn, db, server_backup_path)
... View more
12-17-2013
01:52 AM
|
1
|
0
|
3688
|
|
POST
|
Hi Curtis, Yes, the environment takes precedence over the application settings. For example, you can run the Clip tool and choose whether or not to build pyramids. In regards to the application settings, ArcMap options will not be triggered until the raster is added to ArcMap. If you have these options set to always build pyramids, and pyramids are absent, pyramids will begin to be built once the raster is added to ArcMap. 1. GP Environment > Pyramid (note, the default is NONE, according to the help) This only applies to when you are setting Pyramid Environments with scripting.
... View more
12-16-2013
10:17 AM
|
0
|
0
|
1991
|
| 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
|