POST
|
I usually save the image service as a layer file and add it that way, though I may be misunderstanding your question....
... View more
10-05-2011
11:49 AM
|
0
|
0
|
205
|
POST
|
To simply state my problem... I have two layers in my TOC. They both have the same SDE data source. However, one was added as a layer file. The issue is that I am trying to get the spatial reference for any layer in the TOC and when I get to the layer added as a layer file, I get a runtime error when I try to describe the spatial reference.
for lyr in lyrList:
print lyr.name
print lyr.dataSource
desc = arcpy.Describe(lyr.dataSource)
print desc.spatialReference.name
In line 3 above, my dataSource for the layer file points to the "C:\Documents and Settings\...\bnd", while the non-layer file points to "Database Connections\me@1.sde\bnd" My error is in line 4 on the layer file: "Runtime error <type 'exceptions.IOError'>: C:\Documents and Settings\bhaney\Application Data\ESRI\ArcCatalog\orwa_sde@orsovctr.sde\OSODBA.Plan_Area_Boundary\OSODBA.PLANBDY_POLY does not exist" Is this a configuration issue? Is this a known issue? thank you, ryan
... View more
10-05-2011
07:45 AM
|
0
|
1
|
2424
|
POST
|
I have a script that cycles through a directory of mxd's and creates a polygon of each mxd's dataframe's bounding box. Therefore, we can have one layer to use as an index layer for a map book. However, several of the mxd's have a data frame rotated to something other than 0. The coordinates of the DF extent are being calcluated as if the rotation is always 0, and therefore my polygons are always right angled at true north, rather than reflecting the angle of the data frame. Is there a way to calculate the real DF extent boundaing box of a rotated data frame? thanks, ryan
... View more
08-04-2011
10:34 AM
|
0
|
5
|
861
|
POST
|
I am getting an error when editing a poly with the reshape tool... The poly does change shape and my results are successful, but in Fireburg, I get this error: TypeError: _b29.preUpdatedGraphics is undefined ...window[esri._dojoScopeName||"dojo"]._x...i.dijit.editing.Editor-all");}}};}); I do have these in my .js file: dojo.require("esri.dijit.editing.Editor-all"); dojo.require("esri.graphic"); I am not sure if I need to define "preUpdatedGraphics" anywhere since I am updating the same layer. ??
... View more
05-18-2011
06:01 AM
|
0
|
0
|
470
|
POST
|
I agree about the djConfig tag fixing the _297 error (thank you)... I'll look into the proxy settings. I'm finding it interesting that I get the 400 error if not all of the features from the feature service draw, which generates an error relating to graphics being unable to draw. If this error occurs, I can't edit. If all the features do draw and no error occurs, the editing is just perfect. A proxy thing? A feature service thing?
... View more
05-12-2011
09:57 AM
|
0
|
0
|
457
|
POST
|
I rebooted my machine and now it works, but not always... Sort of hard to pin-point when it's not consistent. Now, I am no longer getting the _297 error, but a 400 error that I am unable to apply edits. The tiled map service is fine I think. I get the error as soon as I try and add a poly or edit an existing one. I have some more investigating to do I believe... Thanks for your help and please post if you have any other thoughts. I will post a solution when I find one.
... View more
05-12-2011
08:57 AM
|
0
|
0
|
457
|
POST
|
Thanks for responding by the way... Still no love. Any other thoughts?
... View more
05-12-2011
07:57 AM
|
0
|
0
|
457
|
POST
|
Here is the .js piece... again, just took sample code and replaced with our servers, feature layers, etc. Permissions are wide open on the Feature Services for editing too... Any thoughts? <!-- reference ArcGIS JavaScript API -->
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.2"></script>
<script type="text/javascript">
//require selection dijit
dojo.require("esri.map");
dojo.require("esri.dijit.editing.Editor-all");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
var map;
var resizeTimer;
function init() {
esri.config.defaults.io.proxyUrl = "http://ourServer/proxy/proxy.ashx";
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://ourServer/ArcGIS/rest/services/Geometry/GeometryServer");
var extent = new esri.geometry.Extent({"xmin":-13969147.281817337,"ymin":4805977.618327605,"xmax":-12669147.534885714,"ymax":6610095.663226462, "spatialReference":{"wkid":3857}});
map = new esri.Map("map",{extent:extent});
dojo.connect(map, "onLoad", function() {
dojo.connect(dijit.byId('map'), 'resize', function() {
resizeMap();
});
});
dojo.connect(map, "onLayersAddResult", initEditor);
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://ourServer/ArcGIS/rest/services/BaseMap/MapServer");
map.addLayer(basemap);
var evacuationPerimeter = new esri.layers.FeatureLayer("http://ourServer/ArcGIS/rest/services/MicroStorms_Collapsed/FeatureServer/1",{
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ['*']
});
map.addLayers([evacuationPerimeter]);
}
function initEditor(results) {
//build the layer and field information for the layer, display the description field
//using a text area.
var layers = dojo.map(results, function(result) {
var fieldInfos= dojo.map(result.layer.fields,function(field){
if(field.name === 'description'){
return {'fieldName': field.name,'label':'Details',stringFieldOption:esri.dijit.AttributeInspector.STRING_FIELD_OPTION_TEXTAREA}
}
else{
return {'fieldName': field.name,'lable':field.alias}
}
});
return {featureLayer:result.layer,'fieldInfos':fieldInfos}
});
var templateLayers = dojo.map(results,function(result){
return result.layer;
});
var templatePicker = new esri.dijit.editing.TemplatePicker({
featureLayers: templateLayers,
grouping: true,
rows: 'auto',
columns: 3
},'templateDiv');
templatePicker.startup();
var settings = {
map: map,
templatePicker:templatePicker,
enableUndoRedo:true,
layerInfos:layers,
toolbarVisible: true,
createOptions: {
polygonDrawTools: [ esri.dijit.editing.Editor.CREATE_TOOL_FREEHAND_POLYGON,
esri.dijit.editing.Editor.CREATE_TOOL_AUTOCOMPLETE]
},
toolbarOptions: {
reshapeVisible: true,
cutVisible: true,
mergeVisible: true
}
};
var params = {settings: settings};
var editorWidget = new esri.dijit.editing.Editor(params,'editorDiv');
editorWidget.startup();
map.infoWindow.resize(300,165);
}
//Handle resize of browser
function resizeMap(){
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function(){
map.resize();
map.reposition();
}, 500);
}
dojo.addOnLoad(init);
</script>
... View more
05-12-2011
07:26 AM
|
0
|
0
|
457
|
POST
|
I am using .js API sample code to work on editing... I have replaced what is needed in that code to reflect our servers, data, feature services, etc. When I try and modify a polygon's attributes or shape, I get an error every time. And, it appears four times. This seems like sort o generic error I have seen posted other places on the forums too. TypeError: _297 is null if(!dojo._hasResource["dijit._base.man...h","tr","xx","zh","zh-cn","zh-tw"]); Any ideas?
... View more
05-11-2011
07:12 AM
|
0
|
10
|
845
|
POST
|
I had our SA set up an internet proxy on the server we are running our web app. A lot of the sample code from the .js API ESRI pages have a generic URL that points to a non-existent proxy and I didn't catch that. esri.config.defaults.io.proxyUrl = "http://..../proxy.ashx" ryan portland, or
... View more
05-06-2011
01:21 PM
|
0
|
0
|
213
|
POST
|
Ben, I had the same error ass you the other day... I had our SA set up an internet proxy on the server we are running our web app. A lot of the sample code from the .js API ESRI pages have a generic URL that points to a non-existent proxy. If you don't have the sample code, just put this your init function: esri.config.defaults.io.proxyUrl = "http://..../proxy.ashx" Make sure your server has permissions to read this too. ryan portland, or
... View more
05-06-2011
01:17 PM
|
0
|
0
|
288
|
POST
|
Having this code at the very end of the script (before my PDF export) made this work properly. Maybe because I was going back and forth between Data Frames just once, it was messing something up? The code below workd just fine. Thanks again for your input Jeff... import arcpy.mapping as MAP DF = MAP.ListDataFrames(MXD)[0] ...code... newInsetExtent = DF.extent DF_inset = MAP.ListDataFrames(MXD)[1] DF_inset.extent = newInsetExtent DF_inset.scale = 1500000
... View more
05-02-2011
01:46 PM
|
0
|
0
|
251
|
POST
|
Hi Jeff, I see a mistake in my desciption of my issue: "I want my inset map to have the same extent as my main data frame" should be "I want my inset map to have the extent indicator in the center of my inset data frame at 1:1,500,000." So, my logic here was just use the same DF.extent as my main DF, then just zoom out to 1:1,500,000. I have never been able to use wildcards when using arcpy.mapping.ListDataFrame ie. "main" and "inset". I get "Runtime error <type 'exceptions.IndexError'>: list index out of range." I have always had to declare them through a list: [0], [1], etc. Any additional thoughts? thanks, ryan
... View more
05-02-2011
09:18 AM
|
0
|
0
|
251
|
POST
|
Thanks for the input... the error occurs before anything is passed to the .py script. I think there's a possible disconnection between sending info from the .js API URL to our ArcServer, and this creates the error. I get a 404 error when I am able to reproduce this... so, there is at least one missing file somewhere. I am working on writing something that doesn't kill the job, but tries again a second after the error occurs. This seems to be working at this point. Ryan
... View more
05-02-2011
07:46 AM
|
0
|
0
|
213
|
POST
|
I have two data frames. One is an inset map. I want my inset map to have the same extent as my main data frame... this works just fine in the arcpy window, but not in my script. Pretty straightforward, but not sure why it's not working... any ideas? DF = MAP.ListDataFrames(MXD)[0] newInsetExtent = DF.extent DF_inset = MAP.ListDataFrames(MXD)[1] DF_inset.extent = newInsetExtent DF_inset.scale = 1500000 My Map ends up with the correct scale of 1500000, but my extent never gets passed. Again, this works perfectly fine in the arcpy window. thanks, ryan
... View more
04-28-2011
08:34 AM
|
0
|
3
|
1714
|
Title | Kudos | Posted |
---|---|---|
1 | 12-28-2011 06:35 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|