|
POST
|
The error is for Line 41. I am not exactly sure what your line 41 would be. i would assume you changed the code as least a little bit so my line 41 is not the same as yours. If you can post your code and state the text of the line that is giving you issues I can see if I can identify the issue. When posting your code make sure it posts with the correct indents and line breaks or it could make it look like you have more problems that aren;t necesarily in your code.
... View more
02-21-2013
03:19 AM
|
0
|
0
|
2645
|
|
POST
|
Hi I tested your code, but it return this error: IndentationError: unindent does not match any outer indentation level How should I set script input and output parameters? Just be sure to check your python code to make sure none of the lines are wrapping on you. Does it say what line the indentation error is on? There is one input parameter scripted in this sample. infile = arcpy.GetParameterAsText(0). If you need more you can just take a similar appraoch.
... View more
02-20-2013
03:48 AM
|
0
|
0
|
3783
|
|
POST
|
Did you have performance issues when using AD Groups before SP1? Wondering if that solved our performance issues with AD groups/roles. We had major performance impacts with users that were either in many AD groups or nested (sub) groups. Yes i had performance issues before SP1 but they persisted through the service pack upgrade. it turned out that the account apply the configuration settings was a user account that was a part of many nested groups casuing a major slowdown in the authentication process. We switched the domain account the server runs as which is only part of a very small amount of groups. The performance after making that change was significantly better.
... View more
02-13-2013
11:13 AM
|
0
|
0
|
1719
|
|
POST
|
Yes. It turns out there was an existing bug in 10.1 that did not allow a comma in a users full name. This was fixed in SP1.
... View more
02-13-2013
07:02 AM
|
0
|
0
|
1719
|
|
POST
|
If your query results are added to a new graphics layer the default settings for layer will apply. Meaning all fields as defined by your service will be added, be visible and have alias names as defined by the service. What you are saying here is what I excpect to happen but unfortunatley is not the case (for me anyway). I have 2 seperate tools in which one performs a spatial query and the other a attribute query. Both add a new graphics layer if the layer does not exist and then adds the features from the query results to the graphics layer. I based my code off of the ESRI samples. Here is the relevant portion of the code. Maybe I am creating the layer incorrectly.
// Retrieve or create a graphics layer to use for displaying results
GraphicsLayer graphicsLayer = null;
if (featureSet.Features[0].Geometry is ESRI.ArcGIS.Client.Geometry.MapPoint)
graphicsLayer = GetOrCreateLayer("Policy Spatial Query Results", "CustomStrobeMarkerSymbol");
else if (featureSet.Features[0].Geometry is ESRI.ArcGIS.Client.Geometry.Polyline)
graphicsLayer = GetOrCreateLayer("Polyline Spatial Query Results", "RedLineSymbol");
else if (featureSet.Features[0].Geometry is ESRI.ArcGIS.Client.Geometry.Polygon)
graphicsLayer = GetOrCreateLayer("Polygon Spatial Query Results", "RedFillSymbol");
string RecCount = featureSet.Features.Count.ToString();
string strRecordLimit = null;
// Add results to the graphics layer
graphicsLayer.ClearGraphics(); //clear out any old features
foreach (Graphic feature in featureSet.Features)
graphicsLayer.Graphics.Add(feature);
// Add the results graphics layer to the map if it has not already been added and the results to map checkbox is checked
if (chkResults2Map.IsChecked == true)
{
if (MapApplication.Current.Map.Layers[graphicsLayer.ID] == null)
MapApplication.Current.Map.Layers.Add(graphicsLayer);
}
}
private GraphicsLayer GetOrCreateLayer(string layerId, string renderer)
{
Layer layer = MapApplication.Current.Map.Layers[layerId];
if (layer != null && layer is GraphicsLayer)
{
return layer as GraphicsLayer;
}
else
{
GraphicsLayer gLayer = new GraphicsLayer()
{
ID = layerId,
Renderer = new SimpleRenderer()
{
Symbol = Resources[renderer] as Symbol
}
};
gLayer.SetValue(MapApplication.LayerNameProperty, layerId);
return gLayer;
}
}
... View more
01-23-2013
03:50 AM
|
0
|
0
|
1758
|
|
POST
|
That is far from dumb. When troubleshooting I frequently clear cahc and close browser sessions. In my case this does not help at all. I am able to manually change the aliases but the correct alias values should be populated from the results of the query. I verify that the query returns the alias' correctly but the viewer app does not use them. I am starting to think ther builder was not designed to do that. When I find time I will probably just code my query tool to get the aliases and and update the new layer with them. Thanks.
... View more
01-22-2013
05:38 AM
|
0
|
0
|
1758
|
|
POST
|
Well this turned out much easier. private void NewAdd_Click(object sender, RoutedEventArgs e) { var uploadTask = new ESRI.ArcGIS.Client.Tasks.UploadTask("http://myserver/arcgis/rest/services/GPTools/WildfireUpload/GPServer/uploads/upload"); uploadTask.UploadCompleted += UploadTask_Complete; uploadTask.Failed += UploadTask_Failed; uploadTask.UploadAsync(new UploadParameters() { FileStream = fileStream, FileName = strFile }); } private void UploadTask_Complete(object sender, UploadEventArgs e) { Geoprocessor geoprocessorTask = new Geoprocessor("http://gis/arcgis/rest/services/GPTools/WildfireUpload/GPServer/ZipImportTest"); geoprocessorTask.ExecuteCompleted += GeoprocessorTask_ExecuteCompleted; geoprocessorTask.Failed += GeoprocessorTask_Failed; List<GPParameter> parameters = new List<GPParameter>(); parameters.Add(new GPItemID("Input_File", e.Result.Item.ItemID)); geoprocessorTask.ExecuteAsync(parameters); }
... View more
01-07-2013
08:50 AM
|
0
|
0
|
695
|
|
POST
|
Have you tried something like this: MapApplication.Current.Map.Extent = zoomLayer.FullExtent; This did not work. Map extent remained the same.
... View more
01-02-2013
11:16 AM
|
0
|
0
|
951
|
|
POST
|
I was able to get the code below to work by setting my request to null when finished. However, I ran into another issue with trying to get the response from the successful upload. I get a message stating my cookie is exceeding the limit of 4096. Is there a way to change the cookie limit? I am using NTLM for single sign on authentication.
... View more
01-02-2013
10:45 AM
|
0
|
0
|
695
|
|
POST
|
PanTo works with this but ZoomTo does not. ??
MapApplication.Current.Map.PanTo(zoomlayer.FullExtent.Extent);.
... View more
12-31-2012
06:33 AM
|
0
|
0
|
951
|
|
POST
|
I am trying to zoom to the results of a query which is added to my map as a graphics layer. I have been trying numerous ways to get the map to zoom to that layer but can't get it to work. Once the layer is added I have no issues with using the Go To buton to zoom into the layer. I am missing something but I am not sure what. Here is a sample of one way I was trying to accomplish this.
string layerID = "Policy";
Layer zoomlayer = MapApplication.Current.Map.Layers[layerID];
MapApplication.Current.Map.ZoomTo(zoomlayer.FullExtent.Extent);
... View more
12-31-2012
05:36 AM
|
0
|
5
|
1222
|
|
POST
|
I did not install Microsoft Expression Blend Preview for Silverlight 5 after I upgraded everything. I guessed I missed that step. Thank you!
... View more
12-28-2012
06:55 AM
|
0
|
0
|
749
|
|
POST
|
I am trying to create my first behavior using silverlight 3.0 api and silverlight 5. For some reason I have an error with "[Export(typeof(Behavior<Map>))]" saying that I have a missing type or namespace. I also have the same issue on base.OnAttached();. I am taking these from the Zoom to Selected Layer sample. Anyone have any ideas. using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; //using System.Windows.Interactivity; using System.ComponentModel.Composition; using ESRI.ArcGIS.Client; using ESRI.ArcGIS.Client.Extensibility; using ESRI.ArcGIS.Client.Geometry; using ESRI.ArcGIS.Client.Tasks; using ESRI.ArcGIS.Client.Behaviors; using System.Windows.Threading; namespace ECFMapLoad.AddIns { [Export(typeof(Behavior<Map>))] [DisplayName("Load ECF Data")] public class MyBehavior : Behavior<Map> { #region Behavior Overrides protected override void OnAttached() { base.OnAttached(); // Show saved configuration text MapApplication.Current.Initialized += Initialized; } private void Initialized(object sender, EventArgs args) { } protected override void OnDetaching() { // Detach the event handler MapApplication.Current.Initialized -= Initialized; base.OnDetaching(); } #endregion } }
... View more
12-27-2012
11:31 AM
|
0
|
2
|
1257
|
|
POST
|
Sorry I got ahead of you there. Because I needed to perform the field mapping on the fly i switched from using a model to using a python script. The input parameter type is going to be "File" in any case. In the script below, "infile = arcpy.GetParameterAsText(0)" is going to get the input file as a File type parameter. Then you can use the file as you please. You will see when you run this in desktop you have a file browser that you can use to browse to a file of your choice. Once you get that to run succesfully you can publish as a service. With the service you will need to get the itemID of the uploaded file and use that as an input parameter like itemID:"i83fa38d5-69e8-40c0-bd9c-30beb643e522". import arcpy, os, zipfile infile = arcpy.GetParameterAsText(0) outpath, outfileext = os.path.splitext(infile) filename = outpath.split('\\')[-1] try: # unzip file fireZip = zipfile.ZipFile(infile, 'r') fireZip.extractall(outpath) fireZip.close() shpPath = outpath + "\\" + filename + ".shp" arcpy.AddMessage("Finished unzipping file.") # Local variables: WildFire_Table_Target = "Database Connections\\SQL_DB(TEST Server).sde\\ArcSDE.dbo.WILDFIREPERIM" # Create FieldMappings object and load the target dataset fieldmappings = arcpy.FieldMappings() fieldmappings.addTable(WildFire_Table_Target) inputfields = [field.name for field in arcpy.ListFields(shpPath) if not field.required] for inputfield in inputfields: # Iterate through each FieldMap in the FieldMappings # for i in range(fieldmappings.fieldCount): fieldmap = fieldmappings.getFieldMap(i) #arcpy.AddMessage(fieldmap.getInputFieldName(0)) # If the field name from the target dataset matches to a validated input field name # if fieldmap.getInputFieldName(0) == inputfield.replace("", ""): # Add the input field to the FieldMap and replace the old FieldMap with the new # fieldmap.addInputField(shpPath, inputfield) fieldmappings.replaceFieldMap(i, fieldmap) break # Process: Append arcpy.Append_management(shpPath, WildFire_Table_Target, "NO_TEST", fieldmappings) except Exception as e: print e.message arcpy.AddError(e.message)
... View more
12-27-2012
03:59 AM
|
0
|
0
|
3783
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 4 | 03-12-2025 11:01 AM | |
| 3 | 01-08-2025 09:26 AM | |
| 1 | 01-08-2025 07:19 AM | |
| 1 | 12-06-2024 04:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|