POST
|
Hi Sophie i was wondering if you ever got any progress on this problem? I have a client who is experiencing the same sort of issue as you were last year. Thanks Ralph Price
... View more
11-29-2019
10:58 PM
|
0
|
0
|
305
|
POST
|
Thanks Michael Isn't always the way that once you post to a forum, you manage to find what you were looking for just after posting. I did also discover that the first "buffer-select" that I did would work but a second "buffer-select" using the result of the first would error. The way to get that to work was to ensure that spatial references kept getting set for the output graphics. I can now have a single parcel selected, buffer that, select parcels that intersect that buffer, buffer those parcels, select again etc. This is for a mailing list generating tool for planning consents etc. Thanks again for your assistance Ralph Price Application Developer and GIS Analyst
... View more
01-16-2011
09:11 AM
|
0
|
0
|
277
|
POST
|
Hi to all The code below shows hows to combine the separate graphic geometries into one to be used in the query task. Amazing how the act of posting a message will prompt inspiration!! There may be other ways but it is what I am doing for now. Regards Ralph Price Application Developer and GIS Analyst
Private Sub GeometryService_BufferCompleted(ByVal sender As Object, ByVal e As GraphicsEventArgs)
Try
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyUserDrawnGraphicsLayer"), GraphicsLayer)
graphicsLayer.Graphics.Clear()
Dim comboBufferGraphic As New Graphic
Dim myComboPoly As New ESRI.ArcGIS.Client.Geometry.Polygon
For Each bufferGraphic As Graphic In e.Results
comboBufferGraphic.Geometry = bufferGraphic.Geometry
Dim myPoly As ESRI.ArcGIS.Client.Geometry.Polygon = TryCast(bufferGraphic.Geometry, ESRI.ArcGIS.Client.Geometry.Polygon)
For Each pointColl As ESRI.ArcGIS.Client.Geometry.PointCollection In myPoly.Rings
myComboPoly.Rings.Add(pointColl)
Next
bufferGraphic.Symbol = TryCast(LayoutRoot.Resources("BufferSymbol"), Symbol)
bufferGraphic.SetZIndex(1)
graphicsLayer.Graphics.Add(bufferGraphic)
Next
Dim query As New ESRI.ArcGIS.Client.Tasks.Query()
query.ReturnGeometry = True
query.Geometry = myComboPoly
query.OutSpatialReference = MyMap.SpatialReference
query.OutFields.Add("SUE")
query.OutFields.Add("LEGAL")
_queryTask.ExecuteAsync(query)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
... View more
01-12-2011
10:26 AM
|
0
|
0
|
277
|
POST
|
I have a graphics layer with multiple graphics in it and I wish to use all of those geometries to perform a Query. This following code works fine as far as doing my Query but of course is only using the geometry of the last graphic in my previous buffer results is used.
Private Sub GeometryService_BufferCompleted(ByVal sender As Object, ByVal e As GraphicsEventArgs)
Try
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyUserDrawnGraphicsLayer"), GraphicsLayer)
graphicsLayer.Graphics.Clear()
Dim iZIndex As Integer = 0
Dim comboBufferGraphic As New Graphic
For Each bufferGraphic As Graphic In e.Results
comboBufferGraphic.Geometry = bufferGraphic.Geometry
bufferGraphic.Symbol = TryCast(LayoutRoot.Resources("BufferSymbol"), Symbol)
bufferGraphic.SetZIndex(iZIndex)
graphicsLayer.Graphics.Add(bufferGraphic)
iZIndex = iZIndex + 1
Next
Dim query As New ESRI.ArcGIS.Client.Tasks.Query()
query.ReturnGeometry = True
query.Geometry = comboBufferGraphic.Geometry
query.OutSpatialReference = MyMap.SpatialReference
query.OutFields.Add("SUE")
query.OutFields.Add("LEGAL")
_queryTask.ExecuteAsync(query)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
It would seem that a Tasks.Query only accepts one Geometry value as the Geometry property so my question is how do I combine the geometries of all of my graphics? I have searched for a geometry.add function or aggregate or combine and had no luck. There is not an obvious way to export the geometries to strings, combine and then create a new geometry from that coord string. If there is I would be glad to have it pointed out to me. Any thoughts on this would be most appreciated. Regards Ralph Price Application Developer and GIS Analyst
... View more
01-12-2011
10:11 AM
|
0
|
3
|
3241
|
Online Status |
Offline
|
Date Last Visited |
10-15-2021
11:43 PM
|