'''Dim dAlong1 As Double '''Dim dAlong2 As Double '''Dim dDist As Double '''Dim bRight As Boolean '''Dim pOutPolyline As IPolyline '''pCurve.QueryPointAndDistance 0, pPoint1, False, pOutPoint, dAlong1, dDist, bRight '''pCurve.QueryPointAndDistance 0, pPoint2, False, pOutPoint, dAlong2, dDist, bRight '''pCurve.GetSubCurve dAlong1, dAlong2, False, pOutPolyline
Dim pWF As IWorkspaceFactory
Dim pointLayer As IFeatureLayer Dim lineLayer As IFeatureLayer Dim pointFLayer As IFeatureLayer Dim lineFLayer As IFeatureLayer Dim pointFClass As IFeatureClass Dim lineFClass As IFeatureClass Dim pMxDoc As IMxDocument Dim pFeat As IFeature Dim pFCursor As IFeatureCursor Dim counter As Integer
Set pMxDoc = Application.Document Set pointLayer = pMxDoc.FocusMap.Layer(0) Set lineLayer = pMxDoc.FocusMap.Layer(1)
Set pointFLayer = pointLayer Set lineFLayer = lineLayer
Set pointFClass = pointFLayer.FeatureClass Set lineFClass = lineFLayer.FeatureClass
Set pFCursor = lineFClass.Search(Nothing, False) Set pFeat = pFCursor.NextFeature
Dim pTopoOp As ITopologicalOperator Dim pPolyline As IPolyline
Do Until pFeat Is Nothing
Set pPolyline = pFeat.Shape
Dim pSpFilter As ISpatialFilter Set pSpFilter = New SpatialFilter Set pSpFilter.Geometry = pFeat.Shape pSpFilter.SpatialRel = esriSpatialRelIntersects
Dim lineCursor As IFeatureCursor Set lineCursor = lineFClass.Search(pSpFilter, True)
Dim pIntersectingLineFeature As IFeature Set pIntersectingLineFeature = lineCursor.NextFeature
Do Until pIntersectingLineFeature Is Nothing
Set pTopoOp = pFeat.Shape Dim pIntersectGeom As IGeometry Set pIntersectGeom = pTopoOp.Intersect(pIntersectingLineFeature.Shape, esriGeometry0Dimension)
If Not pIntersectGeom.IsEmpty Then Dim pPoint As IPoint Set pPoint = New Point pPoint.PutCoords pIntersectGeom.Envelope.xmin, pIntersectGeom.Envelope.ymin
Dim pSubCurve As ICurve Set pSubCurve = GetSubCurve(pPolyline.FromPoint, pPoint, pPolyline)
Dim pOutPolyline As IPolyline Set pOutPolyline = pSubCurve
Call Geometry2Graphic(pOutPolyline) Else
End If Set pIntersectingLineFeature = lineCursor.NextFeature Loop
Set pFeat = pFCursor.NextFeature Loop
End Sub
Sub Test() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument
Dim pGCS As IGraphicsContainerSelect Set pGCS = pMxDoc.ActiveView If pGCS.ElementSelectionCount <> 3 Then MsgBox "select two point and one line graphic first" Exit Sub End If
Dim pPoint1 As IPoint, pPoint2 As IPoint, pPolyline As IPolyline Dim l As Long For l = 0 To pGCS.ElementSelectionCount - 1 With pGCS.SelectedElement(l) If TypeOf .Geometry Is IPoint Then If pPoint1 Is Nothing Then Set pPoint1 = .Geometry Else Set pPoint2 = .Geometry End If Else Set pPolyline = .Geometry End If End With Next l
Dim pSubCurve As ICurve Set pSubCurve = GetSubCurve(pPoint1, pPoint2, pPolyline) If Not pSubCurve Is Nothing Then With pMxDoc.ActiveView.ScreenDisplay .StartDrawing .hDC, esriNoScreenCache .SetSymbol New SimpleLineSymbol .DrawPolyline pSubCurve .FinishDrawing End With End If End Sub
Function GetSubCurve(pPoint1 As IPoint, _ pPoint2 As IPoint, _ pCurve As ICurve) As ICurve
Dim pOutPoint As IPoint, d1 As Double, dFrom As Double, _ bRight As Boolean, d2 As Double
Dim pOutCurve As ICurve pCurve.GetSubCurve d1, d2, True, pOutCurve Set GetSubCurve = pOutCurve End Function
Public Sub Geometry2Graphic(pGeometry As IGeometry)
Dim pMxDoc As IMxDocument Dim pElement As IElement Dim pGraphicsContainer As IGraphicsContainer Dim pActiveView As IActiveView
On Error GoTo ERR_HANDLER
Set pMxDoc = Application.Document Set pGraphicsContainer = pMxDoc.FocusMap Set pActiveView = pMxDoc.FocusMap
If pGeometry Is Nothing Then GoTo ERR_HANDLER
Select Case pGeometry.GeometryType Case esriGeometryPoint Set pElement = New MarkerElement Case esriGeometryPolyline Set pElement = New LineElement Case esriGeometryPolygon Set pElement = New PolygonElement
13 Comments:
http://www.acquisinc.com/sharedresources/products/ADE/pdf/ADE_ProductBrochure.pdf
http://www.gatewayhorizons.com/NetGISDemos.htm
http://gisfactory.com/webservices.html
http://gis.orem.org/, http://gis.orem.org/webservices.html
http://www.digitalearth.com.au/2005/07/25/arcgis-server-web-services/
Use Case Tutorials:
http://readysetpro.com/whitepapers/usecasetut.html
IMP:
http://www.maine.gov/dep/gis/deployment/categories.html
http://www.softwarereality.com/lifecycle/functionalspec.jsp
http://www.dpi.vic.gov.au/dpi/nrenmp.nsf/LinkView/423B3F3217EF5B35CA256E97007E0DEBEBFD14C56EB2E7344A256DEA00266325
Others:
http://dusk2.geo.orst.edu/djl/arcgis/diag.html IMP
http://www.softwarereality.com/design/iconix_toc.jsp
Papers:
http://gis.esri.com/library/userconf/proc01/professional/papers/pap642/p642.htm
http://www.sdmagazine.com/documents/s=815/sdm0012c/
http://www.giscafe.com/?email=sk_shukla@hotmail.com&country=CAN
http://www.eomonline.com/index.php
Data Services:
http://www.designpresentation.com/services.htm
http://www.titanmapping.com/
ESRI Extensions: http://www.esri.com/software/arcgis/about/desktop_extensions.html
Private Sub UIButtonControl1_Click()
'''Dim dAlong1 As Double
'''Dim dAlong2 As Double
'''Dim dDist As Double
'''Dim bRight As Boolean
'''Dim pOutPolyline As IPolyline
'''pCurve.QueryPointAndDistance 0, pPoint1, False, pOutPoint, dAlong1, dDist, bRight
'''pCurve.QueryPointAndDistance 0, pPoint2, False, pOutPoint, dAlong2, dDist, bRight
'''pCurve.GetSubCurve dAlong1, dAlong2, False, pOutPolyline
Dim pWF As IWorkspaceFactory
Dim pointLayer As IFeatureLayer
Dim lineLayer As IFeatureLayer
Dim pointFLayer As IFeatureLayer
Dim lineFLayer As IFeatureLayer
Dim pointFClass As IFeatureClass
Dim lineFClass As IFeatureClass
Dim pMxDoc As IMxDocument
Dim pFeat As IFeature
Dim pFCursor As IFeatureCursor
Dim counter As Integer
Set pMxDoc = Application.Document
Set pointLayer = pMxDoc.FocusMap.Layer(0)
Set lineLayer = pMxDoc.FocusMap.Layer(1)
Set pointFLayer = pointLayer
Set lineFLayer = lineLayer
Set pointFClass = pointFLayer.FeatureClass
Set lineFClass = lineFLayer.FeatureClass
Set pFCursor = lineFClass.Search(Nothing, False)
Set pFeat = pFCursor.NextFeature
Dim pTopoOp As ITopologicalOperator
Dim pPolyline As IPolyline
Do Until pFeat Is Nothing
Set pPolyline = pFeat.Shape
Dim pSpFilter As ISpatialFilter
Set pSpFilter = New SpatialFilter
Set pSpFilter.Geometry = pFeat.Shape
pSpFilter.SpatialRel = esriSpatialRelIntersects
Dim lineCursor As IFeatureCursor
Set lineCursor = lineFClass.Search(pSpFilter, True)
Dim pIntersectingLineFeature As IFeature
Set pIntersectingLineFeature = lineCursor.NextFeature
Do Until pIntersectingLineFeature Is Nothing
Set pTopoOp = pFeat.Shape
Dim pIntersectGeom As IGeometry
Set pIntersectGeom = pTopoOp.Intersect(pIntersectingLineFeature.Shape, esriGeometry0Dimension)
If Not pIntersectGeom.IsEmpty Then
Dim pPoint As IPoint
Set pPoint = New Point
pPoint.PutCoords pIntersectGeom.Envelope.xmin, pIntersectGeom.Envelope.ymin
Dim pSubCurve As ICurve
Set pSubCurve = GetSubCurve(pPolyline.FromPoint, pPoint, pPolyline)
Dim pOutPolyline As IPolyline
Set pOutPolyline = pSubCurve
Call Geometry2Graphic(pOutPolyline)
Else
End If
Set pIntersectingLineFeature = lineCursor.NextFeature
Loop
Set pFeat = pFCursor.NextFeature
Loop
End Sub
Sub Test()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pGCS As IGraphicsContainerSelect
Set pGCS = pMxDoc.ActiveView
If pGCS.ElementSelectionCount <> 3 Then
MsgBox "select two point and one line graphic first"
Exit Sub
End If
Dim pPoint1 As IPoint, pPoint2 As IPoint, pPolyline As IPolyline
Dim l As Long
For l = 0 To pGCS.ElementSelectionCount - 1
With pGCS.SelectedElement(l)
If TypeOf .Geometry Is IPoint Then
If pPoint1 Is Nothing Then
Set pPoint1 = .Geometry
Else
Set pPoint2 = .Geometry
End If
Else
Set pPolyline = .Geometry
End If
End With
Next l
Dim pSubCurve As ICurve
Set pSubCurve = GetSubCurve(pPoint1, pPoint2, pPolyline)
If Not pSubCurve Is Nothing Then
With pMxDoc.ActiveView.ScreenDisplay
.StartDrawing .hDC, esriNoScreenCache
.SetSymbol New SimpleLineSymbol
.DrawPolyline pSubCurve
.FinishDrawing
End With
End If
End Sub
Function GetSubCurve(pPoint1 As IPoint, _
pPoint2 As IPoint, _
pCurve As ICurve) As ICurve
Dim pOutPoint As IPoint, d1 As Double, dFrom As Double, _
bRight As Boolean, d2 As Double
pCurve.QueryPointAndDistance esriNoExtension, pPoint1, True, _
pOutPoint, d1, dFrom, bRight
pCurve.QueryPointAndDistance esriNoExtension, pPoint2, True, _
pOutPoint, d2, dFrom, bRight
Dim pOutCurve As ICurve
pCurve.GetSubCurve d1, d2, True, pOutCurve
Set GetSubCurve = pOutCurve
End Function
Public Sub Geometry2Graphic(pGeometry As IGeometry)
Dim pMxDoc As IMxDocument
Dim pElement As IElement
Dim pGraphicsContainer As IGraphicsContainer
Dim pActiveView As IActiveView
On Error GoTo ERR_HANDLER
Set pMxDoc = Application.Document
Set pGraphicsContainer = pMxDoc.FocusMap
Set pActiveView = pMxDoc.FocusMap
If pGeometry Is Nothing Then GoTo ERR_HANDLER
Select Case pGeometry.GeometryType
Case esriGeometryPoint
Set pElement = New MarkerElement
Case esriGeometryPolyline
Set pElement = New LineElement
Case esriGeometryPolygon
Set pElement = New PolygonElement
End Select
pElement.Geometry = pGeometry
pGraphicsContainer.AddElement pElement, 0
pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
ERR_HANDLER:
'Debug.Print "Input Geometry is missing."
End Sub
http://www.dsslink.com/gis_101.htm
http://www.seawead.org/
http://www.maptext.com/LabelContour.shtml
NAIT: https://nait.onware.ca/prothos/onware.x/conf/1613/exhibits/index.p?!=public=11601474937163=1=36099839&Conference=1613
http://www.har-gis.com/people.html
- http://www.energy.gov.ab.ca/1068.asp
Oil & gas glossary:
http://www.mms.gov/glossary/th-tw.htm
Blogs:
http://www.spatialdatalogic.com/cs/blogs/brian_flood/archive/2005/03/02/13.aspx
http://www.spatiallyenabled.com/
GIS Portal: http://www.gisportal.com/gis3m.htm
GIS Cafe: http://www.giscafe.com/
http://www.baama.org/usergroups/
http://www.directionsmag.com/companies/category/Developer/
Webinar:
http://www.geotg.com/utilities/index.html
http://www.all-llc.com/ALL-services/WEDA.htm
Post a Comment
Subscribe to Post Comments [Atom]
<< Home