|
POST
|
You cannot read FeatureClass as a property of the describe, it is just a heading for a property group in the gp programming model, but you can read any of the properties for the FeatureClass that are listed under the FeatureClass property group in the gp programming model. For example you can read FeatureType. I tested the code below and it works (with one of my featureclasses in the place of yours). I do not know why the FIDSet property did not work. Perhaps it did not work because the object you described was just a featureclass and not a layer. I think you would have to use the mygp.CreateLayer_Management tool (or whatever it is that creates a layer from a feature class) and describe the layer to get that property. import arcgisscripting
#Process: Create the gp object
mygp = arcgisscripting.create(9.3)
mygp.OverWriteOutput = True
desc = mygp.describe("c:\\temp\\VillageSurvey.mdb\\Land") # added slashes to read as file name
mygp.AddMessage(str(desc.Extent)) #that is ok
fcs = desc.featuretype # works !
... View more
10-30-2010
08:11 AM
|
0
|
0
|
1170
|
|
POST
|
hi all, I verified that I work under ArcGIS 9.3.1. My code dont work,I dont understand why ! I become crazy. Someone could help me ? Very simple code:
mygp = load(version=9.3) # load geoprocessor
mygp.OverWriteOutput = True
desc = mygp.describe("c:\temp\VillageSurvey.mdb\Land")
mygp.AddMessage(str(desc.Extent)) #that is ok
fcs = mygp.FeatureClass # dont work ! same case for FIDSet property for a layer
Msg is <type 'exceptions.AttributeError'>: Object: Tool or environment <FeatureClass> not found thanks for any help ! I believe you made an error in the line that reads: fcs = mygp.FeatureClass # dont work ! same case for FIDSet property for a layer it seems that it should read: fcs = desc.FeatureClass # change from gp object to describe object
... View more
10-30-2010
04:31 AM
|
0
|
0
|
1170
|
|
POST
|
Hello all, We have a .dbf table of employee home addresses and work locations. Every quarter we are supposed to receive an update for this table. What I need to do is compare changes in employee home address field and work location field between the original and the update. Any suggestions on how to do this via ArcObjects? thanks In ArcObjects you can operate on a layer with a join and access the joined fields or query the joined records through the IDisplayTable interface. Some sample code (in VBA) that assumes the joined layer is the first layer in the map and already has a join in place is as follows: Public Sub GetDifferencesInJoinedRecords()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pFLayer As IFeatureLayer
Set pFLayer = pMxDoc.FocusMap.Layer(0) 'Get first layer
Dim pDisplayTable As IDisplayTable
Set pDisplayTable = pFLayer
If Not TypeOf pDisplayTable.DisplayTable Is IRelQueryTable Then
MsgBox "Feature Layer is not joined! Exiting Sub."
Exit Sub
End If
Dim pQF as IQueryFilter
Set pQF = New QueryFilter
' Add some type of SQL selection to compare your joined table. Test it first in the Select by Attributes dialog
pQF.Whereclause = "ParentTableName.MyField <> JoinTableName.MyField"
Dim pTableCursor As ICursor
Set pTableCursor = pDisplayTable.SearchDisplayTable pQF, False
Dim pRow As IRow
Set pRow = pTableCursor.NextRow
Dim pParentIndex As Long
pParentIndex = pDisplayTable.DisplayTable.Fields.FindField("ParentTableName.myField") ' Substitute the actual Parent Table Name and Field Name
If pParentIndex = -1 Then
MsgBox "ParentTableName.myField Field Not Found! Exiting Sub." ' Substitute the appropriate message.
Exit Sub
End If
Dim pJoinIndex As Long
pJoinIndex = pDisplayTable.DisplayTable.Fields.FindField("JoinTableName.myField") ' Substitute the real Join Table Name and Field Name
If pJoinIndex = -1 Then
MsgBox "JoinTableName.myField Field Not Found! Exiting Sub." ' Fix the Message for your data
Exit Sub
End If
Do Until pRow Is Nothing ' Keep your loop as tight as possible and do not do Dim statements inside of it.
' Do something in the loop
Debug.Print pRow.Value(pParentIndex) & " <> " & pRow.Value(pJoinIndex) ' report value of field in join table
Set pRow = pTableCursor.NextRow
Loop
Exit Sub
... View more
10-29-2010
01:19 PM
|
1
|
0
|
1150
|
|
POST
|
I have a point shapefile with Name, address etc in the attribute field. I want to delete all the duplicate records from the attribute table with the same name. For example I have a 10 records that have SMITH in the name field. How can I remove/delete records to just list 1 record for SMITH. Can soactual meone suggest a better way than just sorting the data and doing it manually as there are thousands of records. Is there a tool or a selection method that will work or a script/python code I code easily apply to perform this task? Since this is a point shapefile are you wanting to delete the actual points or are you wanting a separate table derived from the points that has unique values for that field? For either case you can perform a Summary, but to delete the actual points you have to perform a few more steps. A Summary on the NAME field will create a new sorted table with the unique values of that field and a count of how many occurances of that value are in the point shapefile. If that is all you want, that is all you have to do. If you don't care which point is chosen to represent the unique Name value and you want to actually delete points, you would need to do a Summary, but also add a Min, Max or First summary on some other field that contains a value that represents a unique key for each of the points. The Summary tool may not let you use the ObjectID field directly, so you may want to add a temporary field of type Long and calculate the ObjectID into it. Then you could do a Min summary on the temporary OID field. Once you have the new Summary table with the summary field for the unique key, join the Summary table to the point class on the summary unique key field. If you want to create a new exported copy of the unique points, select all values where the joined table ObjectID is not Null, break the join and export the selected records. If you want to actually delete the unmatched points from the original point shapefile and have no back up, select all values where the joined table ObjectID is Null, break the join and do a deletion of the selected records in an Edit session. This method does not take into account any spatial characteristics of the points, so the point that is left will be basically random (but every unique NAME value will be preserved in the final result). If you want to preserve the point spatial data but reduce the number of attribute rows to a single row, you should convert your points to multipoints using the Dissolve tool. That will preserve all your point geometry within a single multi-point feature for each unique NAME value. If you want multiple fields to be used to select records with unique combinations rather than one field, I typically like to create a concatenated version of those field values and use that as a summary field with the above method. Some sort of script is another alternative for dealing with multiple field unique combinations. There may be other options depending on the final result you want and whether or not you want some spatial characteristic to be considered for choosing the points to keep and the points to be deleted.
... View more
10-29-2010
01:32 AM
|
1
|
0
|
4149
|
|
POST
|
I am back on Mondays and Wednesdays and telecommuting Tuesdays and Thursdays to cut down on commute time. So come by and see me on Monday.
... View more
10-21-2010
08:32 PM
|
0
|
0
|
1315
|
|
POST
|
If you are relying on the field calculator in ModelBuilder you should not use VBA, since there is no support for VBA in the field calculator once you upgrade to ArcGIS 10 (or beyond) and VB Script at ArcGIS 10 cannot do geometry calculations. You should use Python (ModelBuilder supports Python in the Field Calculator, at least by 9.3). That way you can not only use the code in ModelBuilder, but also in a python script (which can then be run in task scheduler) and it should port to future versions of ArcGIS. The two expressions below should get you the Centroid X and Y coordinates in Python with the Field Calculator. float(!SHAPE.CENTROID!.split()[0]) float(!SHAPE.CENTROID!.split()[1])
... View more
10-21-2010
04:22 PM
|
0
|
0
|
1706
|
|
POST
|
I recently tried to use the Make Query Table, thinking that its kinda like the Spatial Views in sde command line, but in ArcMap, and I was using a layer with over 700,000 parcels, with multiple tables, which each have around a million records. The process ran for 23 hours before I killed it because it sucked up about 23 GBs of memory in my Local Setting Temp directory. Is this the expected behavior of the Make Table Query or perhaps I am misusing this tool, and should stay with sde command line, which takes a few seconds to process this much data. Ted: I would definitley stick with views using sde command line for performance on an FC of this size. I have used this tool with the 700K features you are talking about to see a join to Building permits (only about 36K records). It took about 7 minutes to process after I indexed the criteria fields on both the FC and the table (without indexed fields I killed it after 30 minutes). If I had not specified any criteria for how the fields of the table relate to each other, the tool would have cross-multiplied every record in the FC and the table (700,000 * 36,000 = 25,200,000,000 combinations). With criteria it only keeps matching records which reduces it to about the number of records within the smaller table. There is no way to get the tool to behave like a Keep All Records join, where every unmatched record displays Null values, so any unmatched features in your tables would cause the unmatched features to disappear in the result. I don't think it is optimized for memory usage any where near as well as an sde view. (I used to work with the combination of all the tables you are talking about as a view and it performed fairly well, but the current version my agency uses is actually processed so that the view is exported to a permenent FC to improve performance by doing such things as adding field indexes) So again, I think your SDE view is going to out perform this tool and give you better results.
... View more
10-21-2010
03:54 PM
|
0
|
0
|
1315
|
|
POST
|
Neil thanks for the suggestion. I got the ContextMenu to work after looking at some of your other older posts. In addition to setting the ContextMenu value to False I also had to alter the Mousedown behavior to detect the right-click button and send the clicked coordinates to the ContextMenu of the tool. So the minimum code required to get the behavior I wanted is: Private Function UIToolControl1_ContextMenu(ByVal x As Long, ByVal y As Long) As Boolean
UIToolControl1_ContextMenu = False
End Function
Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
If button = 2 Then
UIToolControl1_ContextMenu x, y
ElseIf button = 1 Then
' Whatever the tool does
End If
End Sub
... View more
10-19-2010
04:45 PM
|
0
|
0
|
849
|
|
POST
|
In the code editor, choose ContextMenu from the right-hand dropdown list and have it return False. Thanks for the reply. I added the code below but the behavior of the tool has not changed and the code below is not fired. I still do not get a context menu if the right button is clicked. What am I missing? Private Function UIToolControl1_ContextMenu(ByVal x As Long, ByVal y As Long) As Boolean UIToolControl1_ContextMenu = False End Function
... View more
10-18-2010
01:46 PM
|
0
|
0
|
849
|
|
POST
|
I have created a UIToolControl in VBA that I would like to activate only if the left mouse button is clicked within the map. However, if the right mouse button is clicked I would like the normal ArcMap context menu to be activated. I know how to test for the left button event, but if all I do is determiine that another button was clicked and exit the sub, no context menu is activated. Do I have to explicitly call the context menu when the right mouse button is clicked or can I somehow pass the right click event to ArcMap? What do I need to do to get the right mouse click to activate the normal ArcMap context menu when my tool is active? Thanks.
... View more
10-18-2010
08:47 AM
|
0
|
3
|
1057
|
|
POST
|
I have created a new version of the split code designed to work as a UIToolControl that can split a selected LR Line Event where a mouse was clicked. Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pEditor As IEditor
Dim pID As New UID
pID = "esriEditor.Editor"
Set pEditor = Application.FindExtensionByCLSID(pID)
If Not pEditor.EditState = esriStateEditing Then
MsgBox "Not in an Edit Session!. Please start Editor."
Exit Sub
End If
Dim pMxDoc As IMxDocument
Set pMxDoc = Application.Document
Dim pMap As IMap
Set pMap = pMxDoc.FocusMap
Dim i As Long
Dim pLayer As ILayer
For i = 0 To pMap.LayerCount - 1
Set pLayer = pMap.Layer(i)
If pLayer.Name = "SIDEWALKS Events" Then
Exit For
End If
Next i
If pLayer Is Nothing Then
MsgBox "Layer Not Found"
Exit Sub
End If
Dim pFLayer As IFeatureLayer
Set pFLayer = pLayer
If pFLayer Is Nothing Then
MsgBox "Layer is not a Feature Layer!"
Exit Sub
End If
If Not TypeOf pFLayer.FeatureClass Is IRouteEventSource Then
MsgBox "Layer is not a Route Event Source!"
Exit Sub
End If
Dim pRouteEventSource As IRouteEventSource
Set pRouteEventSource = pFLayer.FeatureClass
If Not TypeOf pRouteEventSource.EventProperties Is IRouteMeasureLineProperties Then
MsgBox "Layer is not a Line Event Layer!"
Exit Sub
End If
Dim pDataset As IDataset
Set pDataset = pRouteEventSource.EventTable
Dim pProps As IPropertySet
Set pProps = pEditor.EditWorkspace.ConnectionProperties
If Not pDataset.Workspace.ConnectionProperties.IsEqual(pProps) Then
MsgBox "Workspace of Sidewalk Events Layer is not being edited!"
Exit Sub
End If
'Get the point where the user clicked
If pMxDoc.CurrentLocation.IsEmpty Then Exit Sub
'Clone the point because we don't want to alter
'the actual document's current location point
Dim pClone As IClone
Set pClone = pMxDoc.CurrentLocation
Dim pPoint As IPoint
Set pPoint = pClone.Clone
Dim pFSel As IFeatureSelection
Set pFSel = pFLayer
Dim pSelSet As ISelectionSet
Set pSelSet = pFSel.SelectionSet
If pSelSet.Count < 1 Then
MsgBox "No Sidewalks selected"
Exit Sub
End If
' Read selected records to create an update where clause using OID values
Dim pCursor As ICursor
Dim pRow As IRow
pSelSet.Search Nothing, False, pCursor
Set pRow = pCursor.NextRow
Dim strWhere As String
strWhere = """OBJECTID"" IN ("
' This where clause is specific to my sidewalk data.
Dim lFIDC As Long
lFIDC = pRow.Fields.FindField("FID_CENTERLINE")
Dim lRoadSide As Long
lRoadSide = pRow.Fields.FindField("ROAD_SIDE")
Dim strWhere2 As String
Dim strwhere3 As String
strWhere2 = """FID_CENTERLINE"" IN ("
strwhere3 = " AND ""ROAD_SIDE"" IN ("
' Loop through selected records to create two where clauses.
Do While Not pRow Is Nothing
' This clause is common to all GDBs
strWhere = strWhere & pRow.OID & ","
strWhere2 = strWhere2 & pRow.Value(lFIDC) & ","
strwhere3 = strwhere3 & "'" & pRow.Value(lRoadSide) & "',"
Set pRow = pCursor.NextRow
Loop
' Complete where clause common to all GDBs.
strWhere = Left(strWhere, Len(strWhere) - 1) & ")"
strWhere2 = Left(strWhere2, Len(strWhere2) - 1) & ")"
strwhere3 = Left(strwhere3, Len(strwhere3) - 1) & ")"
strWhere2 = strWhere2 & strwhere3
Dim pQF As IQueryFilter
Set pQF = New QueryFilter
' Do the Split in an edit operations so that it can be undone
pEditor.StartOperation
SplitLRRecord pPoint, pRouteEventSource, strWhere
' Reselect original records and added records for split in the event layer.
pQF.WhereClause = strWhere2
pFSel.SelectFeatures pQF, esriSelectionResultNew, False
Set pSelSet = pFSel.SelectionSet
pEditor.StopOperation "Split Event Record"
' Switch tool to Select Feature tools to avoid accidental split and allow new selection
Dim pItem As ICommandItem
Set pItem = CommandBars.Find(arcid.Query_SelectFeatures)
Set Application.CurrentTool = pItem
End Sub
Sub SplitLRRecord(ByVal pPoint As IPoint, ByVal pRouteEventSource As IRouteEventSource, ByVal strWhere As String)
' Select the records in the underlying event table.
Dim pQF As IQueryFilter
Set pQF = New QueryFilter
pQF.WhereClause = strWhere
Dim pTable As ITable
Set pTable = pRouteEventSource.EventTable
Dim pICursor As ICursor
Set pICursor = pTable.Insert(True)
Dim pRowB As IRowBuffer
Set pRowB = pTable.CreateRowBuffer
Dim pCursor As ICursor
Set pCursor = pTable.Update(pQF, False)
' Get the event fields for selecting Routes
Dim pEventRouteField As String
pEventRouteField = pRouteEventSource.EventProperties.EventRouteIDFieldName
Dim pEventRouteIndex As Long
pEventRouteIndex = pTable.FindField(pEventRouteField)
' Get Route Feature Class and fields
Dim pRouteFC As IFeatureClass
Set pRouteFC = pRouteEventSource.RouteLocator.RouteFeatureClass
Dim pRouteField As String
pRouteField = pRouteEventSource.RouteLocator.RouteIDFieldName
'Create QueryFilter and Feature Cursor for querying routes
Dim pQFRoute As IQueryFilter
Set pQFRoute = New QueryFilter
Dim pFCursor As IFeatureCursor
Dim pFeature As IFeature
' Variables for NearestMToPoint Sub
Dim pCurve As ICurve
Dim dMeas As Double
Dim pNearPoint As IPoint
Dim dNearDist As Double
Dim bRight As Boolean
Dim dFromMeas As Double
Dim dToMeas As Double
' Find records that the point splits and modify measures of existing and inserted event.
Dim pRow As IRow ' Normal row for modifying original row measure
Set pRow = pCursor.NextRow
Dim lFromMeas As Long
Dim lToMeas As Long
Dim pRMLP As IRouteMeasureLineProperties
Set pRMLP = pRouteEventSource.EventProperties
lFromMeas = pRow.Fields.FindField(pRMLP.FromMeasureFieldName)
lToMeas = pRow.Fields.FindField(pRMLP.ToMeasureFieldName)
Do While Not pRow Is Nothing
pQFRoute.WhereClause = """" & pRouteField & """ = '" & pRow.Value(pEventRouteIndex) & "'"
Set pFCursor = pRouteFC.Search(pQFRoute, False)
Set pFeature = pFCursor.NextFeature
If Not pFeature Is Nothing Then
Set pCurve = pFeature.ShapeCopy
NearestMToPoint pCurve, pPoint, dMeas, pNearPoint, dNearDist, bRight
dMeas = Round(dMeas, 0) ' Apply Rounding if desired or comment out
dFromMeas = pRow.Value(lFromMeas)
dToMeas = pRow.Value(lToMeas)
If dFromMeas < dToMeas And dMeas > dFromMeas And dMeas < dToMeas And dMeas <> -1 Then
Set pRowB = pRow
pRowB.Value(lFromMeas) = dMeas
pICursor.InsertRow pRowB ' This duplicates the record in the event table.
pRow.Value(lFromMeas) = dFromMeas
pRow.Value(lToMeas) = dMeas
pCursor.UpdateRow pRow
ElseIf dFromMeas > dToMeas And dMeas > dToMeas And dMeas < dFromMeas And dMeas <> -1 Then
Set pRowB = pRow
pRowB.Value(lToMeas) = dMeas
pICursor.InsertRow pRowB ' This duplicates the record in the event table.
pRow.Value(lToMeas) = dToMeas
pRow.Value(lFromMeas) = dMeas
pCursor.UpdateRow pRow
End If
End If
Set pRow = pCursor.NextRow
Loop
End Sub
' Sub to Get Nearest M value, Point on Curve, Distance, and Side of Curve from original Point
Private Sub NearestMToPoint(ByRef pCurve As ICurve, ByRef pPoint As IPoint, _
ByRef dMeas As Double, ByRef pNearPoint As IPoint, ByRef dNearDist As Double, ByRef bRight As Boolean)
' Set dMeas to a value that is invalid so that result can be tested by calling code
dMeas = -1
' Validate Minimum input variables
If pCurve Is Nothing Then
Err.Raise vbObjectError + 11282003, "NearestMToPoint", "No Input Curve Provided"
Exit Sub
End If
If pPoint Is Nothing Then
Err.Raise vbObjectError + 11282002, "NearestMToPoint", "No Input Point Provided"
Exit Sub
End If
' Initialize resulting pNearPoint if it is not already initialized to avoid causing an error
If pNearPoint Is Nothing Then
Set pNearPoint = New Point
End If
' Make sure input curve is MAware
Dim pMA As IMAware
Set pMA = pCurve
If pMA.MAware Then
' initialize variables used to QueryPointAndDistance
Dim bAsRatio As Boolean
bAsRatio = True
Dim dAlong As Double
pCurve.QueryPointAndDistance esriNoExtension, pPoint, bAsRatio, pNearPoint, dAlong, dNearDist, bRight
' Initialize variables to find the best M value of point
Dim pMSeg As IMSegmentation
Set pMSeg = pCurve
Dim Ms As Variant
Ms = pMSeg.GetMsAtDistance(dAlong, bAsRatio)
If UBound(Ms) > 0 Then
Dim iCount As Long
Dim lCount As Long
Dim pGeomColl As IGeometryCollection
Dim pGeom As IGeometry
Dim pTestPoint As IPoint
Set pTestPoint = New Point
For iCount = LBound(Ms) To UBound(Ms)
Set pGeomColl = pMSeg.GetPointsAtM(Ms(iCount), 0)
For lCount = 0 To pGeomColl.GeometryCount - 1
Set pGeom = pGeomColl.Geometry(lCount)
Set pTestPoint = pGeom
' Make sure the M value returns a Point that matches the point returned by QueryPointAndDistance.
If Round(pTestPoint.x, 8) = Round(pNearPoint.x, 8) And Round(pTestPoint.y, 8) = Round(pNearPoint.y, 8) Then
dMeas = Ms(iCount)
End If
Next lCount
Next iCount
If dMeas = -1 Then
Err.Raise vbObjectError + 11282001, "NearestMToPoint", "No M Values Located"
End If
Else
dMeas = Ms(0)
End If
Else
Err.Raise vbObjectError + 11282000, "NearestMToPoint", "Not M Aware"
End If
End Sub
... View more
10-15-2010
02:11 PM
|
0
|
0
|
581
|
|
POST
|
It sounds as though my next step is to create a bunch of If/Then statements (or a python equivalent) and assign a route number based on what direction from the intersection it is located. So if my accident was Daily Dr 100' West of Carmen Dr I would need to programatically find the right segment and have it measure away from the intersection. Daily at Carmen -100'. Between 225 and 315 degrees would be considered West. I see what you mean about complicated. I don't need to do any if/then statements or python scripts other than to construct the intersection pair table. I would have an entry in the table that would read "{DAILY DR}{CARMEN DR}", which would give me the Route ID of the route that is derived from all Centerline sections of DAILY DR and a measure at that intersection (say 1123.125 feet). Since my routes are normally built from upper left, west would normally translate to -1. (I can use the intersection angle to validate my assumption and it does tell me where I built the route differently because they were better oriented from upper right or lower right, but those cases are the exception for my model). My formula would be 1123.125 + 100 * -1 and the collision would therefore be at measure 1023.125 feet. My Routes have already chained all of my related Centerline segments together using the Create Routes tool and assigned measures on a single route for all portions of DAILY DR. I do not use a script to construct any sort of segment chain during the collision geocoding phase (where a collsion potentially could be offset from an intersection across more than one Centerline segment if the officer did not use an alley for example, but a primary street interection with an offset that crossed over the alley). If I want to know which Centerline segment it falls on I do a Locate Features on Routes with my Centerlines (keeping either the ObjectID or other ID of the segment stored in a calculated field) and merge the collision and Centerline event tables. Working from segmented Centerlines to LR measures is backwards from my perspective if that is what you are trying to do and not really an LR solution (IMHO). The set of collisions with the same Route ID have ordered measures which allow me to sort the collisions as they travel west or east (in the case you mentioned) on the route and detect the order of the Centerline segments apart from whether the Centerline segments have ordered IDs or not. The continuous Route also lets me do cluster analysis based on distances that may or may not fall within a single Centerline segment, such as looking at bands of 1000 feet which probably would find the largest collision cluster falling 500 on both sides of the intersection with the highest collision rate (if an alley fell in the 500 feet offset on either side breaking it into more segments it probably has only negligible impact on the accident rate, but it would fall within the cluster analysis). This is where scripting and a series of if/then SQL statements is most useful for examining chains of collisions and Centerlines.
... View more
10-12-2010
05:54 PM
|
0
|
0
|
1647
|
|
POST
|
Thanks Richard. I was able to build a Macro in Excel that does a find and replace on my street names to clean them up. I also have a point layer with all the intersections, so I just added a field and concantonated them. I guess the part I am not sure about is how do I assign route numbers to the lines that they sit on. I also didn�??t get much of a join when I joined the data, I need to clean it up more. Then I can try to do the distance multiplier field. Thank you for sharing. The Route ID and measure are assigned to the intersections by doing a Locate Features Along Route with the ooption to find all routes that the intersection point touches. The Centerlines, routes, and intersections need to be all topologically related to get the best results. I guess I am not sure how you have created your Routes from what you have said so far. My Routes do not break at intersections but continue through all logically related Centerline segments that have the same Street name and that are connected or potentially connected (I allow gaps with measures that account for the gap length). I personally do not use numbers for my Route IDs, although that is the normal way Routes are identified. On my Centerlines I have fields for a Community Plan abbreviation and an optional 3 character subroute field for distinguishing branches which I append with the Street Name to create my Route IDs. I find that make it easier for me to know which Route I am working with. However, a number is fine as long as the Street Name and number association is easy to join to derivatives of your Route Data. Normally an intersection point class has the street names listed in order. That does not work for the approach I take. The join works best with a table that has all possible street name pairings in all possible orders of street names (but the first street name always relates to the Route ID and measure). I do a series of queries and table extractions from the locate result and append them together to create that table. The table will contain two or three records with identical Route ID and Measure values if 3 street names or 4 street names meet at a single intersection. It is best to begin developing a model for the process as you create this so that it can be repeated to reflect changes as they occur on your network. The steps to maintain synchronization of multiple FCs grows pretty quickly and it is nearly impossible to do them all manually in the correct order.
... View more
10-11-2010
04:57 PM
|
0
|
0
|
1647
|
|
POST
|
Thanks Richard, I will take a look at this and see if I have any problems. You most likely will have quite a few problems. I know I encountered 100s of them, but I was able to build a script that exclusively originated in ModelBuilder. To do it that way you must have an ArcInfo licence. I found relatively little help on the forums to piece all of this together. It is not like there are just a few tools I used to build what I have created. It took me a huge amount of trial and error over many months and I ended up using over 120 tool steps to achieve the result I wanted. Most of the script involves adding fields, summarizing, doing joins, calculating data transfers, concatenating results, resummarizing, derive new feature class, etc. I kept adding new features as I found I wanted more derived data that would help me solve new problems that came up as I started use the model (I have been using it for about 2 years now). One of the trickier parts was figuring out how to use the Collect events and pivot tool to collapse many Centerline end points into a single interesection point that could be attributed with all of its street names. The other trick to making the model work was concatenating X and Y coordinates into a formatted concatenated string in curly brackets that could be used as a join field. I have found the model and script were worth the effort because I am now able focus my maintenance task on the Centerline FC and rederive every all other classes from it weekly. The detivatives the script buiilds include my LR network, my intersection points, a cross street pair table, a table history of all points every on my centerline network, a maintained only route class, and a cul-de-sac and stub point class. The intersection pair table also can identify if the intersection includes maintained roads or not and has fields to tell me if duplicate intersection names exist and the amount of distance and relative direction of the duplicates going north to south or west to east as either a direction (for duplicate pairs) or a number (for 3 or more duplicates). It also has 5 different fields I use for joins to make it easier for me to revalidate my event data if street name changes or realignments occur (duplicate intersections make this many jion possibilities necessary). I am willing to share what I learned to save you the effort of all of the trial and error I went through. (It will help me revist parts of what I did in the process and refine it for myself, and I also need a refresher on what I did to make sure it will continue to work in ArcGIS 10).
... View more
10-11-2010
02:53 PM
|
0
|
0
|
1647
|
|
POST
|
I am trying to get my data in order so I can place points along my centerlines to represent traffic collisions. I have a centerline feature with street names and a unique number for each segment. This centerline is broken at alleys and cross streets. I have a table with a list of collisions. It has a column for the street, distance, direction and cross-street. So a collision may be something like this. Carmen Dr, 120�??, East, Daily Dr. From what I have read this is a bit more complicated than what Linear Referencing can do. I was wondering if I can specify columns for street and cross street, distance and direction, and have the program place my points. Is this possible? If not, what are my other options? There is no built in methods for using your data directly. What I do is I derive an intersection point class from my Centerlines. I then process that through the Locate Features Along Routes tool. I then extract all cross street pairings and insert them into a table. The cross streets are concatenated in curly brackets and the final table has all route ID and measure information of each intersection. All of this is created by a python script that is triggered by windows scheduler each weekend (the script takes about 2 1/2 hours to run for about 120K Centerlines and 200K intersection pairings, but since it is automated during non-working hours I don't mind). The final Intersection table can be displayed on a map as either an X/Y Event Table or an LR Event Table. Once you have a table like that you can create a similar cross street concatenation field in your collission data. You process a join and transfer your street route ID and measure reference to your collission. Then you convert your direction field into another field containing a distance multiplier of 1 or -1. If your offset distance is a text field convert it to new a numeric field using units that match your measure system. Then your collision position is calculated using a formula of: Intersection_Measure + Offset_Distance * Direction_Multiplier If your data is good and you can get matches on your intersection table, the whole process can take about 10 minutes to finish. If you have a lot of spelling variations or many intersections with duplicate names (loop streets, branched roads, complex routes, etc) the process is more time consuming, but that kind of data always takes longer to evaluate and a program won't do it for you accurately. (My method will choose a position according to the first join if there are duplicates, but it is not always the correct choice and I have to reevaluate them even if it got it right.) Spell checking takes the most amount of time and I always create new fields to store the spelling corrections I make rather than overwrite the original spellings. The intersection table makes the spell checking process much easier as well. I also use the Event Error field to determine when the measure given is not on my Route so that I can examine them (sometimes field measurements overshoot a route or I used the wrong direction multiplier for a route. I create new fields for overrides of these values as well, since I never want to overwrite original field data, even if it was wrong to begin with). I use this same process for translating Pavement Management data, Traffic Control Device Inventory (Signs and pavement markings), Traffic Signals, Transporation Improvement Program data (capital projects) and almost any other kind of data described in the format you have mentioned. (You are fortunate to have your data preparsed. Only one of the databases I get is parsed for me. The rest I have to parse, which adds about 1 hour to the process). Using the tools to Overlap Events makes it possible to correllate these different data types into a single table that can be sorted by Route ID and measure to get all of their relative positions to each other.
... View more
10-11-2010
12:04 PM
|
0
|
0
|
1647
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2026 08:01 PM | |
| 6 | 02-23-2026 08:34 AM | |
| 1 | 03-31-2025 03:25 PM | |
| 1 | 03-28-2025 06:54 PM | |
| 1 | 03-16-2025 09:49 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-24-2026
07:54 PM
|