|
POST
|
When creating an in-memory feature layers from the Dissolve tool, the resulting feature layer contains the fields Shape_Length and Shape_Area. However, the attributes in both these fields are null. However, if the Dissolve tool's output is a scratch geodatabase, these two fields are populated correctly. Why aren't these field populated for in-memory feature layer?
... View more
12-15-2010
12:12 PM
|
0
|
12
|
8134
|
|
POST
|
Did you restart the server itself (not the service!) after making the change to the configuration file?
... View more
12-15-2010
05:35 AM
|
0
|
0
|
654
|
|
POST
|
In my 9.x projects using the Geoprocessor, I would use the ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject at the end of the geoprocessing routine. Here's an example (in VB.NET). However, I'm not sure what to use in ArcGIS 10
Friend Sub DeleteDataset(ByVal InputName As Object)
Dim DSDelete As New ESRI.ArcGIS.DataManagementTools.Delete
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
Try
DSDelete.in_data = InputName
Result = RunTool(DSDelete, Nothing)
If Result Is Nothing Then System.Windows.Forms.MessageBox.Show("Unable to delete dataset '" & InputName & "'", "Unable to delete", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Exclamation)
Catch ex As Exception
ExceptionMessage(ex, "Delete Dataset")
Finally
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(DSDelete)
End Try
End Sub
... View more
12-01-2010
06:30 AM
|
0
|
0
|
846
|
|
POST
|
What you could do is use Venka's example, but add the tiled service a second time after the dynamic service. Set the first tiled service's visibility to false. This first tiled service will set the LODs and scaling for the map and the second tiled service will be drawn over the dynamic layer.
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="false"/>
<esri:ArcGISDynamicMapServiceLayer url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer">
<esri:visibleLayers>
<s:ArrayCollection>
<fx:Number>0</fx:Number>
<!-- Show census block points only -->
</s:ArrayCollection>
</esri:visibleLayers>
</esri:ArcGISDynamicMapServiceLayer>
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="true"/>
... View more
12-01-2010
05:13 AM
|
0
|
0
|
521
|
|
POST
|
In an application I've developed, I'm using the TOC control to let the user show the different layers of some different services. In addition to that, the user can click on the map to get an InfoWindow that contains the attributes of all the visible layers at that point. This InfoWindow contains tabs for each of the returned layers, with a datagrid of the features and their attributes. When the user rolls the mouse over the rows in the datagrid, I've added listeners to highlight the feature. Since these datagrids will vary with the different attributes, I'm building them each dynamically. That part works fine, but now my colleagues are asking for additional functionality. Some of the layers (but not all, of course) will have a field containing a URL and we want the user to be able to use that as a hyperlink. I've tried identifying the field that will usually contain the URL and set the ItemRenderer for that DataGridColumn using a component that was created by coder extraordinaire Robert Scheitlin but I'm getting the error "1067: Implicit coercion of a value of type Class to an unrelated type mx.core:IFactory" What am I doing wrong on this? And is there a way of finding the field that contains a URL (possibly by searching for the string "http:" in the result) without hard coding a field name (here, it's "Source")? Hers the result function from the IdentifyTask that I'm using to build the datagrids, tabs, and InfoWindow:
function resultFunction(results:Array, clickGraphic:Graphic):void
{
var myInfoRenderer:InfoRenderer = new InfoRenderer;
var mapPoint:MapPoint = MapPoint(clickGraphic.geometry);
var point:Point = map.toScreen(mapPoint);
if (results && results.length > 0)
{
var oldLayer:Number = -1;
var resultsArray:Array = [];
var result:IdentifyResult;
var resultGraphic:Graphic;
var tab:TabNavigator = new TabNavigator();
var newVBox:VBox = new VBox;
var newText:Text = new Text;
var newDG:DataGrid = new DataGrid;
var graphic:Graphic;
clickGraphicsLayer.add(clickGraphic);
result = results[0];
resultsArray.push(result.feature.attributes);
newText = new Text;
newText.text = result.layerName;
graphic = result.feature;
graphic.alpha = 0.3;
graphicsLayer.add(graphic);
tab.width = 400;
tab.height = 230;
for (var i:int = 1; i < results.length; i++)
{
result = results;
graphic = new Graphic;
graphic = result.feature;
graphic.alpha = 0.3;
graphicsLayer.add(graphic);
if (result.layerId == oldLayer)
{
resultsArray.push(result.feature.attributes);
}
else
{
newDG = new DataGrid;
newVBox = new VBox;
newDG.dataProvider = resultsArray;
//this is the new code section
if (!(result.feature.attributes.Source == undefined))
{
for each (var dgCol:DataGridColumn in newDG.columns)
{
if (dgCol.dataField == "Source")
{
dgCol.itemRenderer = HyperLinkField; //coercion error here
}
}
}
//end of new code section
newDG.addEventListener(ListEvent.ITEM_CLICK, newDG_ItemRollOver, false, 0, true);
newDG.addEventListener(ListEvent.ITEM_ROLL_OUT, newDG_ItemRollOut, false, 0, true);
newDG.addEventListener(ListEvent.ITEM_ROLL_OVER, newDG_ItemRollOver, false, 0, true);
newVBox.addChild(newText);
newVBox.addChild(newDG);
tab.addChild(newVBox);
myInfoRenderer.addChild(tab);
newText = new Text;
newText.text = result.layerName;
resultsArray = [];
resultsArray.push(result.feature.attributes);
}
oldLayer = result.layerId
}
newVBox = new VBox;
newDG = new DataGrid;
newDG.addEventListener(ListEvent.ITEM_CLICK, newDG_ItemRollOver, false, 0, true);
newDG.addEventListener(ListEvent.ITEM_ROLL_OUT, newDG_ItemRollOut, false, 0, true);
newDG.addEventListener(ListEvent.ITEM_ROLL_OVER, newDG_ItemRollOver, false, 0, true);
newVBox.addChild(newText);
newDG.dataProvider = resultsArray;
//this is the new code section
if (!(result.feature.attributes.Source == undefined))
{
for each (var dgCol:DataGridColumn in newDG.columns)
{
if (dgCol.dataField == "Source")
{
dgCol.itemRenderer = HyperLinkField;//coercion error here
}
}
}
//end of new code section
newVBox.addChild(newDG);
tab.addChild(newVBox);
myInfoRenderer.addChild(tab);
cursorManager.removeBusyCursor();
map.infoWindow.content = myInfoRenderer;
map.infoWindow.show(map.toMap(point));
map.infoWindow.addEventListener(Event.CLOSE,infoWindow_Close, false, 0, true);
}
}
... View more
11-30-2010
10:23 AM
|
0
|
2
|
1058
|
|
POST
|
Here's an example written in VB.NET, including the dissolve geoprocessor and the associated functions I use to get the results. The InputName object can be a string of the feature class's path, or an IFeatureClass. For the DissolveField and the StateFields syntax, I would recommend running the Dissolve tool manually and inspecting the syntax of the input message.
Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
Friend Function DissolveDataset(ByVal InputName As Object, ByVal DissolveField As String, ByVal StatsFields As String, ByVal OutputName As String) As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim DissolveDS As New ESRI.ArcGIS.DataManagementTools.Dissolve
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Try
DissolveDS.in_features = InputName
DissolveDS.dissolve_field = DissolveField
DissolveDS.statistics_fields = StatsFields
DissolveDS.out_feature_class = OutputName
Result = RunTool(DissolveDS, Nothing)
If Result Is Nothing Then
System.Windows.Forms.MessageBox.Show("Could not dissolve dataset")
Return Nothing
End If
Return ReturnFeatureClassfromResult(Result)
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "Dissolve error")
Return Nothing
End Try
End Function
Friend Function ReturnFeatureClassfromResult(ByVal result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2) As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim GPVal As ESRI.ArcGIS.Geodatabase.IGPValue
Dim InMemFC As String
Dim GPUtil As ESRI.ArcGIS.Geoprocessing.IGPUtilities3 = New ESRI.ArcGIS.Geoprocessing.GPUtilities
Dim pOutputFC As ESRI.ArcGIS.Geodatabase.IFeatureClass
Try
GPVal = result.GetOutput(0)
InMemFC = GPVal.GetAsText()
pOutputFC = GPUtil.OpenFeatureClassFromString(InMemFC)
Return pOutputFC
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "Return FeatureClass error")
Return Nothing
End Try
End Function
Private Sub ReturnMessages(ByVal pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Title As String)
Dim ErrorMessage As String
If pResult.MessageCount > 0 Then
For Count As Integer = 0 To pResult.MessageCount - 1
ErrorMessage += pResult.GetMessage(Count)
Next
End If
System.Windows.Forms.MessageBox.Show(ErrorMessage, Title)
End Sub
Friend Function RunTool(ByVal Process As ESRI.ArcGIS.Geoprocessor.IGPProcess, ByVal TC As ESRI.ArcGIS.esriSystem.ITrackCancel2) As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Try
Result = CType(GP.Execute(Process, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2)
If Result.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then ReturnMessages(Result, "Geoprocessing Error")
GP.ClearMessages()
Catch ex As Exception
ReturnMessages(Result, "Fail")
System.Windows.Forms.MessageBox.Show(ex.ToString, "Run Geoprocessor")
End Try
Return Result
End Function
... View more
11-22-2010
07:22 AM
|
0
|
0
|
602
|
|
POST
|
Yes you can. I'm using 9.3.1 and the Flex API v1.3 on projects where I set the symbology with a renderer. The added step you'll have to take is to put the features on a graphic layer where they can be symbolized.
... View more
11-04-2010
05:22 AM
|
0
|
0
|
597
|
|
POST
|
You could use one of the Renderers to classify the colors and symbology for each of the features. For example, you could set up a class break renderer (see this sample) and change the attribute property of the renderer by using the field that the user chooses. You can get more complex by adding other renderers if you want to show different breaks for the species or using variables for the minValue and maxValue.
... View more
11-03-2010
12:38 PM
|
0
|
0
|
597
|
|
POST
|
We all forgot the final single quote
spatialFilter.WhereClause = "SECT = '" + featureID + "' AND RDIR = '" + RDIR + "' AND RNG = '" + RNG + "' AND TDIR = '" + TDIR + "' AND TWP = '" + TWP + "'";
... View more
11-02-2010
07:05 AM
|
0
|
0
|
667
|
|
POST
|
It looks like you're missing a few "AND"s
spatialFilter.WhereClause = "SECT = '" + featureID + "' AND RDIR = '" + RDIR + "' AND RNG = '" + RNG + "' AND TDIR = '" + TDIR + "' AND TWP = '" + TWP;
... View more
11-02-2010
06:43 AM
|
0
|
0
|
667
|
|
POST
|
Have you stepped through the code using the debugger? I would put a breakpoint at the If statement and check your variables to make sure you have properly read in the XML file. I've attached a screenshot of the XML list variable I get from my code. In this particular project, I'm not using the Extents node, but I've expanded out one of the nodes I am using (which also populates a combobox)
... View more
10-27-2010
11:56 AM
|
0
|
0
|
1786
|
|
POST
|
The first line in the try block (line 38) should be var loader:URLLoader = URLLoader(event.target)
... View more
10-27-2010
11:40 AM
|
0
|
0
|
1786
|
|
POST
|
I didn't show all of the init_onComplete function and left off the "catch" portion of the "try". Put this code before brace right before the the comment //Zoom to the Community tool...or just take out the "try" line
catch(e:Error)
{
Alert.show("Error: " + e.message);
return;
}
... View more
10-27-2010
10:48 AM
|
0
|
0
|
2023
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 2 | 4 weeks ago | |
| 1 | 11-18-2025 12:30 PM | |
| 2 | 11-18-2025 06:53 AM | |
| 1 | 11-17-2025 06:38 AM |
| Online Status |
Online
|
| Date Last Visited |
10 hours ago
|