|
POST
|
1. You can use Query and the FeatureLayer selectFeatures method. Ex: var query = new Query();
query.where = "ZipCode = '" + dom.byId("btnSubmit");
query.outFields = ['ZipCode'];
query.returnGeometry = true;
query.outSpatialReference = map.spatialReference;
zipCodeLayer.on('selection-complete', zoomCountry);
zipCodeLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, zoomToZip); You will also want to render the selected feature. Ex: var selectSymbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255,200,0]), 2), new Color([255,255,0,0.40]));
var zipCodeLayer = new FeatureLayer("http://server/arcgis/rest/services/ZipCodes/MapServer/0", {
mode: FeatureLayer.MODE_SELECTION,
outFields: ["*"]
});
zipCodeLayer.setSelectionSymbol(selectSymbol);
... View more
01-09-2014
03:59 AM
|
0
|
0
|
2197
|
|
POST
|
You can add this as an ArcGISDynamicMapServiceLayer. For Dynamic Map Service Layers, you do not want to specify the index of the layer in the URL. Take a look at an example.
... View more
01-09-2014
03:39 AM
|
0
|
0
|
2317
|
|
POST
|
Hi Francesco, It doesn't look like you are specifying name for the output feature class in the Project tool. Also, you have a parameter commented out in the Project tool. Try the following: try:
for f in fcs:
inData = f
coordinateSystems = arcpy.SpatialReference(26591)
arcpy.DefineProjection_management(inData, coordinateSystems)
output = out_folder_gdb + "\\" + name_gdb + ".gdb" + "\\" + inData.split(".")[0]
coordinateSystems = arcpy.SpatialReference(32632)
arcpy.Project_management(inData, output, coordinateSystems,"Monte_Mario_Rome_To_Monte_Mario + Monte_Mario_To_WGS_1984_4")
except arcpy.ExecuteError:
print(arcpy.GetMessages(2)) Note: I used arcpy.SpatialReference and the coordinate system code to shorten the amount of text.
... View more
01-09-2014
03:19 AM
|
0
|
0
|
582
|
|
POST
|
Hi Peter, Incorporate the Upgrade Metadata tool into your script and this should create the XML file.
... View more
01-09-2014
02:06 AM
|
0
|
0
|
1534
|
|
POST
|
Hi Sri, If you are using the 10.2.1, you can use the new Alter Field tool.
... View more
01-08-2014
06:49 AM
|
1
|
0
|
1754
|
|
POST
|
Thank you both. This was a huge time saver. Really wish I was more comfortable with scripting tools. The time I could have saved. Take a look at the following training courses you can take: http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&courseid=2520 http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&courseid=2114 http://training.esri.com/gateway/index.cfm?fa=catalog.webCourseDetail&courseid=2143 http://training.esri.com/gateway/index.cfm?fa=catalog.courseDetail&CourseID=50131064_10.x
... View more
01-08-2014
02:26 AM
|
0
|
0
|
8089
|
|
POST
|
Alice, Be sure you are requesting to upgrade to 10.2.1 and not just 10.2. This tool just became available at 10.2.1.
... View more
01-08-2014
01:53 AM
|
0
|
0
|
1500
|
|
POST
|
One thing to note is that when you are adding the mosaic dataset to your MXD using the 'AddLayer' function, you are adding it as a raster layer. Therefore, be sure you create your layer file from a raster layer and not the mosaic dataset itself. If not, an error will occur when trying to run the 'UpdateLayer' function. Try the following steps: 1. Run the Make Raster Layer tool on the mosaic dataset 2. Change the symbology and then create the layer file from the raster layer added to ArcMap 3. Execute the following code: mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
GeoDatabaseNameAndLocation = r"G:\Documents\GIS\HydstraData\HydstraMeasurementsDeep\Contours_Daily_20130601_20130605.gdb"
LayerFileNameAndLocation_WSE_Surface = r"G:\Documents\GIS\HydstraData\Template_WSE_Surface.lyr"
arcpy.AddMessage(LayerFileNameAndLocation_WSE_Surface)
CurrentSurface = os.path.join(GeoDatabaseNameAndLocation,"WSE_RasterMosaicDataset")
arcpy.AddMessage(CurrentSurface)
Surface_lyr = arcpy.mapping.Layer(CurrentSurface)
arcpy.mapping.AddLayer(df, Surface_lyr, "BOTTOM")
updateLayer = arcpy.mapping.ListLayers(mxd, "WSE_RasterMosaicDataset", df)[0]
sourceLayer = arcpy.mapping.Layer(LayerFileNameAndLocation_WSE_Surface)
arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer)
... View more
01-07-2014
09:29 AM
|
0
|
0
|
2844
|
|
POST
|
Also, if you upgrade to 10.2.1, there is a new tool called Add Geometry Attributes that will do this.
... View more
01-07-2014
07:14 AM
|
0
|
0
|
1500
|
|
POST
|
Hi Jake, Try building pyramids on the raster dataset (right-click on the raster in the Catalog window > Build Pyramids).
... View more
01-07-2014
06:27 AM
|
0
|
0
|
2476
|
|
POST
|
Hi Alice, You can do this using the UpdateCursor. You can specify a coordinate system that's in meters. Ex: fc = "Points"
sr = arcpy.SpatialReference(3032)
with arcpy.da.UpdateCursor(fc, ["SHAPE@XY", "XCOORD", "YCOORD"], "", sr) as cursor:
for row in cursor:
row[1] = row[0][0]
row[2] = row[0][1]
cursor.updateRow(row)
del row, cursor You can find the code of your coordinate system within the data frame properties > Coordinate System tab: [ATTACH=CONFIG]30312[/ATTACH]
... View more
01-07-2014
02:35 AM
|
0
|
0
|
1500
|
|
POST
|
Hi Jason, Here is a script you can run:
import arcpy
from arcpy import env
env.workspace = r"C:\DATA"
for shapefile in arcpy.ListFeatureClasses("*"):
name = shapefile.split(".")[0]
arcpy.AddField_management(shapefile, "RTENO", "TEXT")
arcpy.CalculateField_management(shapefile, "RTENO", '"' + name + '"', "PYTHON") You will just need to change the 'env.workspace' to the directory path of your shapefiles. Don't forget to include the 'r' before the path.
... View more
01-06-2014
02:33 AM
|
5
|
2
|
8089
|
|
POST
|
Hi Matt, The parameterType parameter is actually 'Read-only'. Take a look at the following link: http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000000v000000 What you can do is set both parameter 7 & 8 to 'Optional' under the 'Parameters' tab. That way when one of the parameters is disabled, the tool will not error upon execution.
... View more
01-06-2014
01:52 AM
|
0
|
0
|
1544
|
|
POST
|
You can use the Import XML Workspace Document function.
... View more
01-03-2014
07:16 AM
|
0
|
0
|
3330
|
|
POST
|
Hi Chris, It will not. You will need to specify the datasets. This parameter also accepts lists, so you could create a list of all your feature classes and pass that into the function. Ex: analyzeDatasets = [] for dataset in arcpy.ListDatasets("*"): for featureClass in arcpy.ListFeatureClasses("*", "", dataset): analyzeDatasets.append(featureClass) for featureClass in arcpy.ListFeatureClasses("*"): analyzeDatasets.append(featureClass) arcpy.AnalyzeDatasets_management(env.workspace,"NO_SYSTEM",analyzeDatasets,"ANALYZE_BASE","ANALYZE_DELTA","ANALYZE_ARCHIVE")
... View more
01-03-2014
07:15 AM
|
0
|
0
|
695
|
| 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
|