【转载】split / break polylines at point intersections

讨论了如何在ArcGIS中自动打断线要素(FeatureClass)在点要素交点处的方法。提供了使用VBA代码批量处理线和点要素的技术方案。
关于如何将FeatureClass中线相互打断的讨论 - split / break polylines at point intersections
http://forums.esri.com/Thread.asp?c=93&f=1384&t=94285
ArcGIS Desktop - Geodatabase Topology forum
split / break polylines at point intersecti...  stephen eckhardtMay 23, 2003
Re: split / break polylines at point inters...  Bradley ChoppSep 30, 2003
Re: split / break polylines at point inters...  stephen eckhardtSep 30, 2003
Re: split / break polylines at point inters...  Bradley ChoppSep 30, 2003
Re: split / break polylines at point inters...  stephen eckhardtSep 30, 2003
Re: split / break polylines at point inters...  Gourkishore TripathyOct 06, 2003
Re: split / break polylines at point inters...  tracy tropleJan 15, 2004
Re: split / break polylines at point inters...  Valentina BoychevaDec 20, 2004
Re: split / break polylines at point inters...  Valentina BoychevaDec 20, 2004
Re: split / break polylines at point inters...  Christie JohnsonOct 04, 2004
Re: split / break polylines at point inters...  Adriano GomesDec 20, 2004
• Top Print Reply Alert Moderator   
Subjectsplit / break polylines at point intersections 
Authorstephen eckhardt 
DateMay 23, 2003 
MessageI thought this would be an easy task to accomplish automatically but I have yet to find a way to break lines where they intersect points. I'm using 8.3 and new features such as the planarize button are extremly helpful. But if they have that I'm not sure why they don't have a feature to do the same with lines and point. Does anyone know an easy way to accomplish this task.

I have about 4000 points that intersect lines where the lines now need to be broken. I know I can set up a topology rule to find all these areas but is there a way to break all the line at once without going through each one individually.

Any thoughts or suggestions? 
 Stephen Eckhardt
GIS Analyst
Civil Solutions 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorBradley Chopp 
DateSep 30, 2003 
MessageStephen,
Did you ever figure out this problem? I am coming across the exact same situation. I need to break my watermain polyline Feature Class where water valves(point FC) intersect. Any suggestions? I sure hope you didnt have to do that by hand!

Thanks,
Brad 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
Authorstephen eckhardt 
DateSep 30, 2003 
Messagethe answer i got from tech support was unless you write some specific code, yes you have to do it (split the lines at points)individually. 
 Stephen Eckhardt
GIS Analyst
Civil Solutions 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorBradley Chopp 
DateSep 30, 2003 
MessageA gentleman in the Data Editing forum gave me this code to split all lines in one layer by all points in another. Note: It works funny while in an edit session. So, it is better to NOT Start Editing when using this code.

Brad 
 
Sub SplitAll()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMap As IMap
Set pMap = pMxDoc.FocusMap

Dim pPointL As IFeatureLayer
Set pPointL = pMap.Layer(0) 'point layer to split lines with

Dim pLineL As IFeatureLayer
Set pLineL = pMap.Layer(1) 'line layer to be split


Dim pLineFC As IFeatureClass
Set pLineFC = pLineL.FeatureClass

Dim pPointFC As IFeatureClass
Set pPointFC = pPointL.FeatureClass

Dim pPointCursor As IFeatureCursor
Set pPointCursor = pPointFC.Search(Nothing, False)

Dim pPointF As IFeature
Set pPointF = pPointCursor.NextFeature

Do Until pPointF Is Nothing
Dim pPoint As IPoint
Set pPoint = pPointF.Shape

Dim pSF As ISpatialFilter
Set pSF = New SpatialFilter

With pSF
Set .Geometry = pPoint
.GeometryField = "Shape"
.SpatialRel = esriSpatialRelIntersects
End With

Dim pLineCursor As IFeatureCursor
Set pLineCursor = pLineFC.Search(pSF, True)

Dim pLineF As IFeature
Set pLineF = pLineCursor.NextFeature

Do Until pLineF Is Nothing
Dim pPolyCurve As IPolycurve
Set pPolyCurve = pLineF.Shape

Dim pToPoint As IPoint
Set pToPoint = pPolyCurve.ToPoint

Dim pFromPoint As IPoint
Set pFromPoint = pPolyCurve.FromPoint

If (pFromPoint.x = pPoint.x And pFromPoint.y = pPoint.y) Then
'do nothing
ElseIf (pToPoint.x = pPoint.x And pToPoint.y = pPoint.y) Then
'do nothing
Else
Dim pFeatureEdit As IFeatureEdit
Set pFeatureEdit = pLineF
pFeatureEdit.Split pPointF.Shape
End If
Set pLineF = pLineCursor.NextFeature
Loop

Set pPointF = pPointCursor.NextFeature

Loop

End Sub
 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
Authorstephen eckhardt 
DateSep 30, 2003 
MessageThanks, I'll try it out. 
 Stephen Eckhardt
GIS Analyst
Civil Solutions 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorGourkishore Tripathy 
DateOct 06, 2003 
MessageI am using the above code given by Prem, which I changed like this, keeping all other lines of code intact.

Set pLineCursor = pLineFC.Search(pSF, False)

One pre-condition is all your points (in point layer) must fall exactly on the polyines (in polyine layer). Otherwise, it will not split. 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
Authortracy trople 
DateJan 15, 2004 
MessageDo you know if it is possible to preform the above task with an point event theme and a geographic network line layer? I've tried this code with my data and it doesn't recognize the point event layer. I have saved the point layer as feature layer and it bails out when it tries to select a line. The error message says something like "no current recor". 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorValentina Boycheva 
DateDec 20, 2004 
MessageTracy,

Did you check whether your point layer and geographic network layer are in the same projection? The spatial operators and interfaces will usually fail if this is not true - with or without generating an error message. 
 Valentina Boycheva
Senior GIS Programmer/Analyst
http://www.jonesedmunds.com
 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorValentina Boycheva 
DateDec 20, 2004 
MessageDeleted duplicate post. 
 Valentina Boycheva
Senior GIS Programmer/Analyst
http://www.jonesedmunds.com
 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorChristie Johnson 
DateOct 04, 2004 
MessageI ran the code, it says I have to be in an edit session. Istart an edit session, run the code, and it says there is no edit session in progress. Also, this line of code keep highlighting when I click debug:
pFeatureEdit.Split pPointF.Shape
I am doing something wrong, but what? 
   
• Top Print Reply Alert Moderator   
SubjectRe: split / break polylines at point intersections 
AuthorAdriano Gomes 
DateDec 20, 2004 
MessageCan not execute this script too.

My (.mxd) have first shape point and second shape lines.
When execuute the scrist my Status Bar of ArcView "say" Create, Edit or Execute a VBA code...

What is this?

Thank.
Adriano 
 Adriano Hantequeste Gomes
SESP-GEAC 

转载于:https://www.cnblogs.com/flyingfish/archive/2008/02/23/1078906.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值