Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to convert a huge number of very dense (densified to 1m) 3D polylines to 3D points. I need each vertex along the line and no duplicates (two of the same XYZ coordinates) if possible. Is there a tool for that? Each feature class to be converted yields about 1 to 2 million points. I did write my own add-on for this and although I am using the insert cursor (as oppose to iFeature:Store) it's quite slow so I am hoping there is a better way.

share|improve this question
1  
Still have your old copy of ArcView 3? It can easily do it :-). –  whuber Aug 19 '11 at 14:38
    
That's negative. –  Jakub Aug 19 '11 at 15:59
4  
I bet it was fast too. One would think that by now we would have all the functionality of ArcView 3 in the current version. –  Jakub Aug 19 '11 at 16:03
    
I have a old VBA code that makes a 2D point shapefile out of 2D polyline vertices. I have no idea if it works on 3D features as well, but it might work (but then it'll only be part of the solution)- If you want, I'll post it tomorrow morning when I get to work (It's evening here). –  jonatr Sep 18 '11 at 15:06
    
On the no-duplicates requirement, is that for within a particular polyline, or do you need to check against all the points you've already written? –  Kirk Kuykendall Sep 20 '11 at 17:55
show 1 more comment

4 Answers

Have you tried ET GeoWizards perhaps? I know it can do 2D polylines to points in the free version, but I'm not sure about 3D.

share|improve this answer
add comment

I would try converting the 3D polylines into a lidar (LAS) file. Tools that manage lidar data are usually designed to handle large numbers of points.

share|improve this answer
add comment

Here's an old VBA code that makes a 2D point shapefile out of 2D polyline vertices. I have no idea if it works on 3D features as well (why are you using 3D-points?), but it might work (but then it'll only be part of the solution):

  Private Sub UIButtonControl9_Click()
'Sub Test()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
    Dim WorkspaceName As String
    Dim TableName As String
    If pMxDoc.SelectedItem Is Nothing Then
        MsgBox "select layer in TOC first"
        Exit Sub
    End If
    If Not TypeOf pMxDoc.SelectedItem Is IFeatureLayer Then
        MsgBox "select layer in TOC first"
        Exit Sub
    End If
    DumpCoords pMxDoc.SelectedItem, "C:\temp\coorddump.csv"
    MsgBox "The Vertices were exported correctly." & Chr(13) & "Vertex point table is saved in C:\temp\coorddump.csv"
    WorkspaceName = "C:\temp"
    TableName = "coorddump.csv"
    AddTextFile WorkspaceName, TableName
    'AddXYEventLayer
End Sub

Sub DumpCoords(pFlayer As IFeatureLayer, sFile As String)
    '
    ' writes OID,part#,point#,x,y of selected features
    ' to sFile (or all features if none are selected)
    '
    If Not (pFlayer.FeatureClass.ShapeType = esriGeometryPolyline Or _
            pFlayer.FeatureClass.ShapeType = esriGeometryPolygon) Then
       MsgBox "must be polyline or polygon"
       Exit Sub
    End If

    Dim pFCur As IFeatureCursor
    Dim pFSel As IFeatureSelection
    Set pFSel = pFlayer
    If pFSel.SelectionSet.Count > 0 Then
        pFSel.SelectionSet.Search Nothing, False, pFCur
    Else
        Set pFCur = pFlayer.FeatureClass.Search(Nothing, False)
    End If

    Open sFile For Output As #1
    Dim StrHeader As String
    StrHeader = Chr(34) & "OIDp" & Chr(34) & Chr(44) & Chr(34) & _
    "Part" & Chr(34) & Chr(44) & Chr(34) & "P_num" & Chr(34) & Chr(44) & _
    Chr(34) & "XXX" & Chr(34) & Chr(44) & Chr(34) & "YYY" & Chr(34)
    Print #1, StrHeader

    Dim pFeat As IFeature
    Set pFeat = pFCur.NextFeature
    Do Until pFeat Is Nothing
        Dim pGeomColl As IGeometryCollection
        Set pGeomColl = pFeat.Shape

        Dim l As Long
        For l = 0 To pGeomColl.GeometryCount - 1
            Dim pPointColl As IPointCollection
            Set pPointColl = pGeomColl.Geometry(l)
            Dim k As Long
            For k = 0 To pPointColl.PointCount - 1
                Dim sOut As String
                sOut = pFeat.OID & "," & l & "," & k & "," & _
                   pPointColl.Point(k).x & "," & _
                   pPointColl.Point(k).Y
                Print #1, sOut
                Debug.Print sOut
            Next k
        Next l
        Set pFeat = pFCur.NextFeature
    Loop
    Close #1

End Sub
Private Function UIButtonControl9_ToolTip() As String
UIButtonControl9_ToolTip = "Extract vertices coordinates to CSV table"
End Function
share|improve this answer
    
I already have a pretty good add-on i wrote. It's just a bit slow when I need to create millions of point features. Why 3D? I was converting huge and complex 3D DXF subsurface models into points then remapping the XYZ fields so that i can construct south-north and east-west sectional views from these formations. When i query a particular range of easting or northing values i can get a point cloud that represents a slice trough the geology in a sectional view. This was a short term solution; I now need to create diagonal and inclined sections so I am now using a 3rd party software. –  Jakub Sep 19 '11 at 13:28
add comment

if you have an arcinfo license you can just run the gp tool feature vertices to points. It takes line or poly feature class as input, and outputs the vertices as points, with their m & z.

as far as insuring no duplicate vertices are present, you may want to look at these two gp tools: integrate & repair geometry.

hope this helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.