You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Geodatabase Topology forum

calculating length of parcel frontage along...   Jason Winoker Mar 10, 2004
Re: calculating length of parcel frontage a...   Kirk Kuykendall Mar 10, 2004
Re: calculating length of parcel frontage a...   Ianko Tchoukanski Mar 10, 2004
Re: calculating length of parcel frontage a...   Jason Winoker Mar 11, 2004
Re: calculating length of parcel frontage a...   Ianko Tchoukanski Mar 11, 2004
Re: calculating length of parcel frontage a...   Kirk Kuykendall Mar 11, 2004
Re: calculating length of parcel frontage a...   Carla Janeiro Apr 17, 2007
Re: calculating length of parcel frontage a...   Ben Clements Jan 26, 2010
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject calculating length of parcel frontage along roadway 
Author Jason Winoker 
Date Mar 10, 2004 
Message For the parcel layer of Hillsborough County, (Tampa) Florida, I am trying to calculate the length of sides of the polygons in the layer that are along the roadway (centerlines). I do not need the perimeter of each polygon, just the length of the sides of polygons that are along roads.

I thought that a 'regions' approach might work, and I have also learned that a 'dimensioning' option might be applied as well. I have over 371,000 parcels to deal with, so a manual approach will not suffice.

Does anybody have any suggestions? I would appreciate your input.

Thank you,

Jason Winoker
Hillsborough County Government 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Kirk Kuykendall 
Date Mar 10, 2004 
Message Perhaps somewhere you have road polygons whose edges (curb lines) coincide with parcels?

If so, you could build a topology (or maptopology) and write a script to calculate this. Otherwise it would be more complicated, since centerlines don't coincide with parcel boundaries typically.

 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/


 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Ianko Tchoukanski 
Date Mar 10, 2004 
Message If we think about a typical parcel layer, in general we’ve got two possibilities. A parcel is either adjacent to a street or to other parcel (common boundary). If we don’t have a street polygon (which is the common case) then we can use something like this:
- Convert the polygons to polylines
- Split the resulting polylines in all vertices
- Identify duplicate polylines – these will be boundaries between adjacent parcels
- The polylines that do not have duplicates will be the street fronts – we can calculate the length of these polylines and use spatial join to transfer the length back to the parcel polygons

If there is street centerline data available the method could be refined, using the distance of identified street fronts to the street centerlines. The angle of the street fronts can be compared to the angle of the corresponding street centerline.
 
  http://www.ian-ko.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Jason Winoker 
Date Mar 11, 2004 
Message Thank you for the reply, but I am not sure if I fully understand what you mean by "split the resulting polylines in all vertices". Could you explain that for me?

Thank you,

Jason Winoker 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Ianko Tchoukanski 
Date Mar 11, 2004 
Message If you convert your polygons to polylines - the result will be closed polylines. Lets take two adjacent rectangular parcels. Each of them has for sides and they have one common side. If we split the two resulting polylines in all the vertices, each polyline will be converted to four single segmented polylines. In total you will end with 8 single segmented polylines. Now the common boundary will be represented by two identical polylines that can be identified. Since the street front of the parcel does not have adjacent parcel there will be no duplicates on the street fronts.

Here is the procedure again with the tools to accomplish it. I'm trying to use only freely available tools here. ET GeoWizards and Easy Calculate can be downloaded from http://www.ian-ko.com
1. Convert the polygons to polylines - ET GeoWizards - Polygon To Polyline function (free with the unregistered version of the software)
2. Split the resulting polylines in all vertices - I posted a code that will perform this here:
http://forums.esri.com/Thread.asp?c=93&f=987&t=102448&mc=4#msgid288830

3. To identify duplicates you can use the field calculator with one of the "field_Mark_Duplicates.cal" expressions of Easy Calculate. In order to get values to compare you can get the coordinates of the middle point of each segment (expressions available in EasyCalculate) then concatenate them in a text field and use this field to find the duplicate polylines.
4. Delete all the polylines that have duplicates - the rest of the polylines in the ideal case will represent street fronts.

If you have street centerlines you might identify better the street fronts using the distance of the remaining polylilines to the street centerlines or compare the angles with the angles of the street centerlines.

All of the above is correct only if your parcel layer is topologically correct (no gaps or overlaps) 
  http://www.ian-ko.com 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Kirk Kuykendall 
Date Mar 11, 2004 
Message Code below can be adapted to calculate the percentage of each parcel that abutts another parcel.

kkeywords imaptopology 
 
Option Explicit
Sub Test()
    '
    ' tested with the parcels shapefile from
    'D:\arcgis\arcexe83\ArcObjects Developer Kit\Samples\Data\Greeley
    ' in the maptopolgy, with the topology already built
    '
    Dim pTopoExt As ITopologyExtension
    Set pTopoExt = Application.FindExtensionByName("ESRI Topology Extension")
    If pTopoExt.MapTopology.ClassCount <> 1 Then
        MsgBox "put just one featureclass in the maptopology"
        Exit Sub
    End If
    
    Dim pFC As IFeatureClass
    Set pFC = pTopoExt.MapTopology.Class(0)
    If pFC.ShapeType <> esriGeometryPolygon Then
        MsgBox "featurclass must be polygon"
        Exit Sub
    End If
        
    Debug.Print "getting percentages ..."
    Dim pDict As Scripting.Dictionary
    Set pDict = GetPercentages(pTopoExt.MapTopology.Cache, pFC)
    If pDict Is Nothing Then Exit Sub
    
    Dim lOIDs() As Long, l As Long, vOID As Variant
    ReDim lOIDs(pDict.Count - 1)
    l = 0
    For Each vOID In pDict.Keys
        lOIDs(l) = vOID
        l = l + 1
    Next vOID
    
    Dim lFld As Long
    lFld = pFC.FindField("OID_") ' just a junk field
    If lFld = -1 Then
        MsgBox "field not found"
        Exit Sub
    End If
    
    Dim pEditor As IEditor
    Set pEditor = Application.FindExtensionByName("ESRI Object Editor")
    pEditor.StartOperation
    
    Dim pFCur As IFeatureCursor
    Set pFCur = pFC.GetFeatures(lOIDs, False)
    
    Dim pFeat As IFeature
    Set pFeat = pFCur.NextFeature
    Do Until pFeat Is Nothing
        pFeat.Value(lFld) = pDict.Item(pFeat.OID)
        pFeat.Store
        Set pFeat = pFCur.NextFeature
    Loop
    pEditor.StopOperation "percent perimeter"
End Sub

Function GetPercentages(pTopoGraph As ITopologyGraph, _
                        pFC As IFeatureClass) As Scripting.Dictionary
    '
    ' for each feature, determine the percentage of its
    ' perimeter that doesn't abutt onto another polygon.
    '
    Dim pDict As New Scripting.Dictionary
        
    Dim pFCur As IFeatureCursor
    Set pFCur = pFC.Search(Nothing, False)
    
    Dim pFeat As IFeature
    Set pFeat = pFCur.NextFeature
    Do Until pFeat Is Nothing
        
        Dim dLen As Double
        dLen = 0#
        
        Dim pEnumEdge As IEnumTopologyEdge
        Set pEnumEdge = pTopoGraph.GetParentEdges(pFC, pFeat.OID)
        If Not pEnumEdge Is Nothing Then
            Dim pTopoEdge As ITopologyEdge
            Set pTopoEdge = pEnumEdge.Next
            Do Until pTopoEdge Is Nothing
                If pTopoEdge.Parents.Count = 1 Then
                    dLen = dLen + GetLength(pTopoEdge.Geometry)
                End If
                Set pTopoEdge = pEnumEdge.Next
            Loop
            pDict.Add pFeat.OID, dLen / GetLength(pFeat.Shape) * 100
        Else
            Debug.Print "no edges found for polygon " & pFeat.OID
        End If
        Set pFeat = pFCur.NextFeature
    Loop
    If pDict.Count > 0 Then
        Set GetPercentages = pDict
    Else
        MsgBox " no edges found, maybe try building first"
    End If
End Function

Function GetLength(pCurve As ICurve) As Double
    GetLength = pCurve.Length
End Function
 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
http://www.ambergis.com
Now Answering questions at:
http://gis.stackexchange.com/


 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Carla Janeiro 
Date Apr 17, 2007 
Message hello
I'm using this procedure to calculate de edge between two land use path, but i'm with problems to identifyng duplicate polylines.

Could you explain how should i concatenate coordinates of the middle point of each segment in a text field ?

thank you very much!

carla janeiro 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: calculating length of parcel frontage along roadway 
Author Ben Clements 
Date Jan 26, 2010 
Message Thanks Ianko! Your comments were very helpful.

I've written some instructions for my office using alternative tools. They don't require the easy calculator tool (all done in ArcGis).

Sorry, I don't have time to improve the instructions right now. I just thought they might be helpful to someone.

-Ben

------------------


Property Frontage Layer

Steps for creation:

Note: a model could be made to automate this process. I’m not sure if the spatial join tool or the remove doughnut holes script can be called from the model builder (or if there are alternative geoprocessor/toolbox tools).

1. Use the ‘Dissolve’ tool to dissolve the PROPERTY Layer (uncheck ‘Multipart’)

2. Use the code below to remove the doughnut holes from the dissolved layer.

3. Use the ‘Feature To Line’ tool to convert the polygons to lines.

4. Use ‘Select by Location’ (it’s in the menu at the top, not the geoprocessor/toobox).
Select by Location: Select features from the line layer that intersect the dissolve layer.
Apply a buffer of -0.001 metres.

If ‘Select By Location’ doesn’t work with a negative buffer (it seems like it doesn’t work with geodatabases) then use the geoprocessor/toolbox to create a buffer layer of -0.001m. Then do the ‘Select By Location’ without the buffer.

5. Delete unwanted lines.

Note: Layers from geodatabases seem to crash when you try to delete the selected records with the Editor. Layers from geodatabases also seem to crash when you switch the selection for exporting. This may be due to the large number of records.

I recommend exporting the lines to shapefiles and then deleting or exporting the records. I don’t know why shapefiles work where geodatabase layers don’t.

6. Use the ‘Dissolve’ tool to dissolve the lines into a single line for each parcel. Dissolve using the ‘FID_Parcel’ field.

7. Join the PROPERTY layer (OBJECTID field) to the new Frontage layer (FID_Parcel).


Script:
Removes the doughnut holes from the selected layer in the TOC
'Source: http://forums.esri.com/Thread.asp?c=93&f=987&t=78634

Public Sub removeDoughnutHoles()

Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pLayer As ILayer
Dim pFeatureLayer As IFeatureLayer
Dim pFeature As IFeature
Dim pFeatureCursor As IFeatureCursor
Dim pEnumLayer As IEnumLayer
Dim pPolygon4 As IPolygon4
Dim pPolygon As IGeometryCollection
Dim pRing As IRing
Dim pEnumGeometry As IEnumGeometry


Set pMxDoc = ThisDocument
Set pMap = pMxDoc.FocusMap

Set pEnumLayer = pMap.Layers
'Set pLayer = pEnumLayer.Next
Set pLayer = pMxDoc.SelectedLayer

'Do Until pLayer Is Nothing
Set pFeatureLayer = pLayer
pLayer.Visible = False

Set pFeatureCursor = pFeatureLayer.Search(Nothing, False)
Set pFeature = pFeatureCursor.NextFeature
Do Until pFeature Is Nothing

If Not pFeature.Shape.IsEmpty Then
Set pPolygon4 = New Polygon
Set pPolygon = New Polygon
Set pPolygon4 = pFeature.Shape
Set pEnumGeometry = pPolygon4.ExteriorRingBag
pEnumGeometry.Reset

Set pRing = pEnumGeometry.Next
Do Until pRing Is Nothing
If pRing.IsExterior Then
pPolygon.AddGeometry pRing
Set pFeature.Shape = pPolygon
'Exit Do
End If
Set pRing = pEnumGeometry.Next
Loop

pFeature.Store
End If
X = 0
Set pFeature = pFeatureCursor.NextFeature

Loop

Set pLayer = pEnumLayer.Next

'Loop

pMxDoc.ActiveView.Refresh
pMxDoc.UpdateContents



End Sub