Contruct points in Model Builder

3925
9
04-20-2011 11:45 AM
KatieMcHugh
New Contributor
Hi, I'm trying to add a model builder step using Construct Points. This is an editor toolbar tool, rather than a tool in the Editing Tools toolbox. Does anyone know how I can use an editor toolbar tool in Model Builder?  Or if there's a tool similar to Construct Points in a toolbox that I haven't unearthed?  I want to do this with Model Builder b/c I have to iterate through records to do it, making it inefficient to do manually.

Thanks!
katie
0 Kudos
9 Replies
DarrenWiens2
MVP Honored Contributor
Can you go into more detail? What are you making points from (other geometry, or are you digitizing)?
0 Kudos
KatieMcHugh
New Contributor
Hi,

I have a stream network that I am splitting into 1 mile segments.  At the moment I have a feature class with approx. 60 streams as individual records, and each record (stream) needs to be split into 1 mile segments.  To do this I construct points along each stream at 1 mile distances. The points are created in their own feature class.

The construct points tool only works (constructs points) on a single selected feature (line) at a time, so I want to set this up in Model Builder so I don't have to manually go through the table, selecting each record and constructing points.  (That would be ok if it were just this set but I have lots more to do!). 

Once I've got the points set I can split the lines with the "Split lines at points" tool, which is in ArcToolbox so that's easy.

Does that help?
Thanks! 🙂
0 Kudos
KatieMcHugh
New Contributor
Hi there,

I'm still trying to solve this issue if anyone has any advice...

Thanks!
katie
0 Kudos
JedRoberts
New Contributor II
I am interested as well.  I also don't see an Arcpy module that can access this function.
0 Kudos
curtvprice
MVP Esteemed Contributor
I am interested as well.  I also don't see an Arcpy module that can access this function.


Out side of third-party tools like XTools, I bet dynamic segmentation may be the ticket to do what you want. Search for "dynamic segmentation" in the help.
0 Kudos
RajatChopra
New Contributor
Hi, I'm trying to add a model builder step using Construct Points. This is an editor toolbar tool, rather than a tool in the Editing Tools toolbox. Does anyone know how I can use an editor toolbar tool in Model Builder?  Or if there's a tool similar to Construct Points in a toolbox that I haven't unearthed?  I want to do this with Model Builder b/c I have to iterate through records to do it, making it inefficient to do manually.

Thanks!
katie


Did u got any answers, as i am also struck with similar problem...??
0 Kudos
RichardFairhurst
MVP Honored Contributor
Did u got any answers, as i am also struck with similar problem...??


Here is how I have done it.  The instructions are fairly detailed so they are a bit long, but hopefully understandable to even the most novice user.

I first create or use a file geodatabase, since several of the tools will not work with shapefiles or dbf tables.  Everything I am describing will be placed in this file geodatabase unless I indicate otherwise.

Then I created Linear Referenced Routes from my line network using the Create Routes Tool in the Linear Referencing Toolbox.  This tool provides several ways to convert your input network to routes affecting the way the lines are chained together and measures are created.  For your data you should use a unique stream ID for each stream segment.  Click the Environments... option button and expand the M values section to set the M tolerance and M resolution to fractional values to get correctly applied measures on each vertex and make sure they are small enough for the units and precision you will want.  In my case, my units are in feet and my M tolerance is set to .001 and my M resolution is set to .0001 (M resolution should always be 10 times the M tolerance as a general rule).

In general try to avoid branched routes unless you control the stream measures to flow with the same initial measure at each branch point.  This can require more sophisticated route construction techniques, which are beyond the scope of this post.  Similar control is needed if you are just merging lines prior to creating your routes.

Add two double fields to the Route Feature Class and name them FROM_MEAS and TO_MEAS.  Use the Field Calculator and using the Python option to calculate each field to be !Shape.FirstPoint.M! and !Shape.LastPoint.M! respectively.  Create a Long field and call it Parts.  Use the Field Calculator and using the Python option to calculate this field to be !Shape.PartCount!.  Select streams with PARTS > 1.  Compare the TO_MEAS value to the reported Line Length (accounting for any unit conversion needed).  The differences in measures will indicate how gaps and branches affected the way the line was measured and may indicate additional editing is needed to get the ultimate results you want.  Sort the table on the TO_MEAS field and find the highest measure value and convert that measure value to miles (if your measures are not already in miles).  This will define the highest mile post possible.

In a new Excel spreadsheet add a name in the first column called MILES.  Type the numbers 1 in the next row and then 2 in the row after that.  Highlight these two numbered rows and drag the lower right little black box that should appear to extend the numbering pattern down for as many rows as you need to exceed your highest measure (you can go several rows beyond what you currently need as a precaution).  If your routes use measures that are not actually in miles, in the next column to the right place a name indicating the measure units of your actual route measures, such as Feet.  Below that heading name place a unit conversion calculation to convert the miles in the first column to those units.  In my case the second column was named FEET and the formula was =A2*5280.  Double click the lower right corner of the formula cell to extend it downward next to every row that has a mileage number.  Save this file to a cvs file and call it Mile_Posts.cvs.

In ArcCatalog right click the cvs file you just created with mile post numbers and convert it at first to a dbf file called Mile_Posts.dbf.  This file will not be inside the file geodatabase where your routes are.  Now export the dbf file to make another new table in your file geodatabase and call it Mile_Posts.

Now use the Make Query Table tool in the Data Management toolbox in the Layers and Table Views toolset.  Use these settings:

Input Tables: First add your Route feature class and then add the Mile_Post table from the same file geodatabase to the table list.

Fields: Check the unique Route ID field defining your routes and then check the Miles field and then your Feet field (or whatever actual measure units you used on your  route other than miles, if applicable).

Expression:  Create an expression where the actual units field of your routes is less than or equal to the TO_MEAS field value of your routes.  In my case it was:

Mile_Posts.Feet <= MyRoutes.TO_M

Use the Add Virtual Key Field option.

The Query Table output is only created in memory within a given map document or model.  To make the output permanent use the Table to Table tool under the Conversion Tools toolbox in the To Geodatabase toolset.  Use the field name list of this tool to rename the filed so that they will be saved without creating long qualified field names that include the origin table names for the fields.

The table can now act as an event table that can be used to create points on your stream network.  Right click the table in the Table of Contents of a map that has the Route features in it and click the context menu option to Display Route Events.  Set the Route ID values for the Routes and the Events to be the same and use the field that contains the mile posts values in the actual units of your measures (in my case the Feet field).  You don't need an offset field.  You should also check the Advanced Options button at the lower right and check the Generate a field for locating errors option.  You can also check the Create an angle field for point events option if you would like to know the actual angle of orientation of the stream at the mile post location. 

The resulting output will place points at every mile post on every stream that is at least one mile in length.  Shorter streams will not have any points.  If you don't like the location of a given mile post for some reason and want to offset it up or down the stream simply select that point and recalculate the measure value by adding or subtracting a distance in the units of your measures.  So if I wanted a given mile post to adjust by 1000 down a stream I would simply add 1000 to the selected point's FEET field.

Examine the LOC_ERROR field which was generated to show location errors of he events.  Select all values where "LOC_ERROR" <> 'NO ERROR'.  These are locations that fell in measure gaps or off the ends of the stream lines for some reason.  This may indicate routes where you would want to fix gaps, adjust the line part order, or adjust the measure assigned at branch points.  Reverse the selection to see all of the mile post points that actually fell on the lines or use the query "LOC_ERROR" = 'NO ERROR' eitehr to select them or as a layer definition query to filter them.

The event layer can be used directly for your split points, although it only exists in memory within a given map or model.  You can export the layer or use the Feature Class to Feature Class tool with the layer to make it a normal point feature class that is permanently stored.  That should be all you need to split your lines at the mile posts or mark the mile posts with points.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Just to be clear, I actually did my method with my route network of 32,000 roads derived from a Centerline network.  I created over 7,000 mile post points within about 60 minutes.  Almost of that time was spent writing the post as I went.  I also did have to do some experimentation with the Make Query Table tool, which I don't use a lot (I tried 3 different settings for the ObjectID field before settling on the Virtual ObjectID option).  Now with the steps laid out I could easily do it again in under 15 minutes since my Route Network is already to go.

Building the routes can take considerably more time if you have never created a route system from your streams, but the uses of LR are extensive and the only way I would ever work with polylines and points that need to match up with each other.  And LR offers a lot more options than standard lines or points in my opinion so I would recommend developing LR routes even if you didn't need mile post points.
0 Kudos
RichardFairhurst
MVP Honored Contributor
If you would like to make 1 mile line segments instead of or in addition to mile post points, modify the Excel spreadsheet to include 2 columns for miles called From_Mile and To_Mile and two for your other units (in my case From_Feet and To_Feet).

Make the first two rows below the headings with these values (or their equivalent for your measure units):

From_Mile       To_Mile    From_Feet     To_Feet
0               1             0           5280
1               2          5280          10560


Then drag the lower right corner of that two row group down as many rows until the From_Mile is greater than your highest mile post measure on your routes.  Then include all of those fields in the Make Query Table field list and make the query expression

Mile_Post.From_Feet <= MyRoutes.To_Meas

Then you can make that event table into two different mile-post point event layers (marking either the beginning or end of the mile) or into a one-mile line segments layer with the Display Route Events context menu option.

Note:  To make the same set of points that my original method made create the Route Event layer as points using the From_Feet field and then put a definition query on the event layer with the expressioin:

FROM_FEET <> 0.
0 Kudos