|
POST
|
Hi Matt, Do you have any ArcGIS Server services accessing the SDE feature classes? Also, you can check the user that is causing the lock by making a connection to the geodatabase as an Administrator > right-click on the geodatabase > Administration > Administer Geodatabase. [ATTACH=CONFIG]31230[/ATTACH]
... View more
02-07-2014
06:33 AM
|
0
|
0
|
2439
|
|
POST
|
You will just need to add these lines to your code. Ex: import arcpy
import os
# Set the necessary product code
import arceditor
# Set the gdb for the mosaic
inWS = arcpy.GetParameterAsText(0)
MoDataName = arcpy.GetParameterAsText(1)
arcpy.env.overwriteOutput = True
#Set projection to be used by the mosaic
prjfile= arcpy.GetParameterAsText(2)
# Create the mosaic dataset
arcpy.CreateMosaicDataset_management(inWS,MoDataName,prjfile,"","","", "")
# Adding the Rasters
Input = inWS+"\\" + MoDataName
InPath = arcpy.GetParameterAsText(3)
arcpy.AddRastersToMosaicDataset_management(Input,"Raster Dataset",InPath,"UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", "", "0", "1500", "", "", "NO_SUBFOLDERS", "ALLOW_DUPLICATES", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", "Add Raster Datasets")
# Integrate the MD's boundary to remove any slivers by using the XY tolerance of 0.31 meters
arcpy.MakeMosaicLayer_management(Input, "MosaicLayer")
Boundary = "MosaicLayer/Boundary"
xyTolerance = "0.31 Meters"
arcpy.Integrate_management(Boundary, xyTolerance)
... View more
02-07-2014
06:23 AM
|
0
|
0
|
2033
|
|
POST
|
Hi Mike, First create a mosaic layer using the Make Mosaic Layer tool, and then you can access the footprint or boundary very easily. Ex: arcpy.MakeMosaicLayer_management("Philadelphia", "MosaicLayer") boundary = ("MosaicLayer/Boundary")
... View more
02-07-2014
06:05 AM
|
0
|
0
|
2033
|
|
POST
|
Since you are not using the map's default graphic layer, update the findPointsInExtent function to use the GraphicsLayer you created. Try the following below: function showResults(results) { var len = results.features.length; var featureSet = new FeatureSet(); featureSet = results; graphicsLayer = new esri.layers.GraphicsLayer(); dojo.forEach(featureSet.features, function (feature,index) { var spID = featureSet.features[index].attributes.SP_ID; var address = featureSet.features[index].attributes.ADDRESS; var callbackstatus = featureSet.features[index].attributes.CALLBACKSTATUS; var meterNumber = featureSet.features[index].attributes.METERNUMBER; feature.geometry = new esri.geometry.Point(featureSet.features[index].attributes.GIS_X, featureSet.features[index].attributes.GIS_Y, new esri.SpatialReference({ wkid: 4326 })); feature.symbol = defaultSymbol; graphicsLayer.add(feature); }); mapMain.addLayer(graphicsLayer); } function findPointsInExtent(extent) { var graphics = graphicsLayer; dojo.forEach(graphics.graphics, function (graphic) { for (var i = 0, il = graphics.graphics.length; i < il; i++) { if (extent.contains(graphic.geometry)) { graphic.setSymbol(highlightSymbol); } else if (graphic.symbol == highlightSymbol) { graphic.setSymbol(defaultSymbol); } } }) }
... View more
02-07-2014
05:30 AM
|
0
|
0
|
2784
|
|
POST
|
Hi Nicholas, This appears to be a bug. I would recommend logging an incident with Tech Support to have this bug logged, and to see if there is a possible workaround.
... View more
02-07-2014
04:23 AM
|
0
|
0
|
1407
|
|
POST
|
Hi Adam, A good trick to get the syntax correct is to run the tool in ArcMap, then open the Results window (Geoprocessing menu > Results). Right-click on the completed tool > Copy As Python Snippet. You can then paste this into your script.
... View more
02-07-2014
04:17 AM
|
1
|
0
|
1838
|
|
POST
|
Hi Brandon, Each map contains a graphics layer by default, so you won't have to create one. The graphics layer is accessible using the Map.Graphics property. Try the following: /// <reference path="index.html" />
var mapMain, selectionLayer, graphicsLayer, selectionToolbar, graphic, defaultSymbol, highlightSymbol, resultTemplate;
require([
"esri/map",
"esri/geometry/Extent",
"esri/layers/ArcGISTiledMapServiceLayer",
"esri/layers/FeatureLayer",
"esri/tasks/GeometryService",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/tasks/FeatureSet",
"esri/graphic",
"esri/toolbars/draw",
"esri/config",
"dojo/ready",
"dojo/parser",
"dojo/on",
"dojo/dom",
"dojo/_base/array",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"],
function (
Map, Extent, ArcGISTiledMapServiceLayer, FeatureLayer,
GeometryService, Query, QueryTask, FeatureSet, graphic, draw, config,
ready, parser, on, dom, array, BorderContainer, ContentPane
) {
ready(function () {
// Create the map
mapMain = new Map("cpCenter")
var layerURL = "http://gisaprd/ArcGIS/rest/services/BaseMap_ArcReader_Cached/MapServer";
myLayer = new esri.layers.ArcGISTiledMapServiceLayer(layerURL);
mapMain.addLayer(myLayer);
dojo.connect(mapMain, "onLoad", initSelectToolbar);
button2 = dom.byId("clearButton");
on(button2, "click", clearSelection);
var queryTask = new QueryTask("http://gisaprd/ArcGIS/rest/services/SRSOutageTest/MapServer/3");
var query = new Query();
query.returnGeometry = true;
query.outFields = ["*"];
query.where = "GIS_X IS NOT NULL";
queryTask.execute(query, showResults, errBack);
defaultSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0, 0, 255]));
highlightSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([255, 0, 0]));
});
function initSelectToolbar(mapMain) {
selectionToolbar = new esri.toolbars.Draw(mapMain);
dojo.connect(selectionToolbar, "onDrawEnd", findPointsInExtent);
}
function showResults(featureSet) {
dojo.forEach(featureSet.features,function(feature){
mapMain.graphics.add(feature.setSymbol(defaultSymbol));
});
}
function findPointsInExtent(extent) {
var results = [];
dojo.forEach(mapMain.graphics.graphics,function(graphic){
if (extent.contains(graphic.geometry)) {
graphic.setSymbol(highlightSymbol);
}
else if (graphic.symbol == highlightSymbol) {
graphic.setSymbol(defaultSymbol);
}
});
}
function errBack(results) {
alert(results);
}
function clearSelection(){
selectionToolbar.deactivate();
dojo.forEach(mapMain.graphics.graphics,function(graphic){
graphic.setSymbol(defaultSymbol);
});
}
}); I also added a function to clear the selection. You can call the button from your HTML using the 'dojo/dom' module, and then execute the 'clearSelection' function: button2 = dom.byId("clearButton");
on(button2, "click", clearSelection); Here is the updated HTML: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CP-Isolated Steel Services</title>
<!-- Configure dojo for asynchronous module loading -->
<script>
var dojoConfig = {
async: true
};
</script>
<!-- Reference libraries. The first CSS is a Dojo theme that gives dijits a consistent style. -->
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/nihilo/nihilo.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">
<link rel="stylesheet" href="css/workwiththemap.css"/>
<script src="http://js.arcgis.com/3.7/"></script>
<script src="JavaScript/CP_IsolatedSteelServices.js"></script>
</head>
<body class="nihilo">
<button data-dojo-type="dijit.form.Button" id="selectButton" onClick="selectionToolbar.activate(esri.toolbars.Draw.EXTENT);">Select</button>
<button data-dojo-type="dijit.form.Button" id="clearButton">Clear Selection</button><br>
<div id="cpCenter" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', liveSplitters:'true'" >
</div>
</body>
</html>
... View more
02-07-2014
02:56 AM
|
0
|
0
|
2784
|
|
POST
|
Hi Diego, I would recommend using mosaic datasets instead of a raster dataset.
... View more
02-06-2014
11:06 AM
|
0
|
0
|
1092
|
|
POST
|
Hi Josh, Try passing a list of the rasters to the Composite Bands tool. Try the following: import arcpy, sys, os
from arcpy import env
from arcpy.sa import *
arcpy.env.overwriteOutput = True
path_images = "J:/Proj/Annual_time_series/Landsat Images/1987/1_001_070/"
rasterList = []
for root, dirs, files in os.walk(path_images):
for name in files:
beni87 = os.path.join(root,name)
if beni87.endswith(('B10.TIF', 'B20.TIF', 'B30.TIF', 'B40.TIF', 'B50.TIF', 'B60.TIF', 'B70.TIF')):
rasterList.append(beni87)
tilename = name[0:-7]
print tilename + "being processed."
out_raster = path_images + "\\" + "composite.tif"
arcpy.CompositeBands_management(rasterList, out_raster) Also, when posting code, be sure to enclose it with CODE tags using the # symbol above.
... View more
02-06-2014
08:49 AM
|
0
|
0
|
3429
|
|
POST
|
Hi Marianne, You will want to use the field name in the where clause. Ex: uCursor = arcpy.da.UpdateCursor(inFeatures, [ 'OID@', 'SHAPE@', 'GM_LABEL', 'GM_USER_DEF' ], 'SHAPE.LEN < 300' )
... View more
02-06-2014
03:10 AM
|
0
|
0
|
1002
|
|
POST
|
When iterating rasters in model builder, you will want to choose a folder directory. This is why no rasters are shown when you navigate to a folder. The 'Workspace or Raster Catalog' parameter is a workspace data type, not a raster dataset. You will want to choose the folder.
... View more
02-05-2014
05:18 AM
|
0
|
0
|
983
|
|
POST
|
Any reason you need to use a raster dataset rather than a mosaic dataset?
... View more
02-04-2014
04:15 AM
|
0
|
0
|
2694
|
|
POST
|
There is one minor mistake in the code that Anthony posted. The code is trying to convert the entire rasterlist to a point feature class rather than the individual raster. Try the following: import arcpy from arcpy import env arcpy.env.workspace = r"C:\GIS\Projekti\Divaca_Ber_10ocen_met9\Testno\script" outworkspace = r"C:\GIS\Projekti\Divaca_Ber_10ocen_met9\Testno\script\point" rasterlist = arcpy.ListRasters("*") for raster in rasterlist: arcpy.RasterToPoint_conversion(raster, outworkspace + "//" + str(raster) + ".shp", "VALUE")
... View more
02-04-2014
03:02 AM
|
0
|
0
|
1543
|
|
POST
|
Hi Kim, Try running the Copy Raster tool and specify 32_BIT_SIGNED for the Pixel Type and then see if you can build the attribute table for the raster.
... View more
02-03-2014
04:19 AM
|
0
|
0
|
1348
|
|
POST
|
Take a look at the jsfiddle here. The only thing I changed was the map extent, and the service to the Vehicle layer.
... View more
01-31-2014
08:39 AM
|
0
|
0
|
1997
|
| 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 |
Thursday
|