Often there is a request to generate points evenly distributed along a linear feature. There exist several solutions of this task, however, none of them seems to be straightforward. The possible solutions may involve customization or other product to be installed and licensed. They can be summarized into the following three groups:
We will use LRS in this sample, however, the Events table will be generated dynamically using custom functional attribute.
So first of all, install the custom function package using the install and download instructions bellow. After that, the function named GENEVENTS will appear in the Misc category of functional attributes.
Then open a gws with the linear feature class you would like to generate markers on:
Create two functional attributes on this feature class. First named BegMeas with constant value 0.0:
And the second one called EndMeas with value LENGTH(Input.Geometry):
Save the query as "Bounds of FeatureClass1" and let it to be shown neither in Map window nor in Data window:
Next create another functional attribute based on the last query and use the new GENEVENTS functional attribute. The function has the following arguments:
offset - the distance from the beginning of the line
distance - the distance between the stops
count - the number of stops to be generated
See the next picture and choose values appropriate for your data:
Save the query as "Stops of FeatureClass1" and again don't show it anywhere.
Finally, let's use LRS to create the markers. Run "Dynamic Segmentation" command from the Analysis ribbon tab. Select the "Bounds of FeatureClass1" as the "LRS Features", "LRS Measure" as "LRS Model" and "Stops of FeatureClass1" as "Event Feature, LRM Based".
Click "Properties" of "LRS Model" and set "LRS Primary Key" to "id" (or primary key of your original feature class), "Begin measure" to "BegMeas" and "End measure" to "EndMeas":
Click "Properties" of "Event feature" and set "Event Type" to "Point", "Event Reference Type" to "Measure", "Primary key" to "id" (the same as for LRS Model) and "Event Measure" to "Stops":
The "Dynamic Segmentation" dialog should be filled by defaults as soon as you click OK on the previous dialog. So click OK on Dynamic Segmentation and examine the result in your map:
You should either compile the source code while running Visual Studio (2010 or newer) "As Administrator", or to register the assembly dll using regasm with /codebase switch. Then you need to manually create some registry entry. The code contains a file RegisterProcedure.txt with details.
C# version for GeoMedia 2014 or newer: HGDN / Mod_CommCustomFunctions_2016CS or git command git fetch && git checkout Mod_CommCustomFunctions_2016CS
Note: the sample custom functions package contains more sample functions.