Shared Samples

GeoMedia, a comprehensive and dynamic GIS, extracts compelling intelligence from geospatial data and integrates it to present actionable information. Please note a HGDN subscription is required to download code samples
Showing results for 
Search instead for 
Do you mean 

Generate Line Markers

by Technical Evangelist on ‎01-04-2017 10:05 AM (880 Views)


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:

  1. Create custom command which employs CustomFieldPipe to generate the points
  2. Create an additional table to be served as Events table and use LRS to generate the points
  3. Use Transportation Manager to generate the Events table and use LRS

We will use LRS in this sample, however, the Events table will be generated dynamically using custom functional attribute.


Create the line markers

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:



Installation instructions

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.


Download links

C# version for GeoMedia 2014 or newer: HGDN / Mod_CommCustomFunctions_2016CS or git command git fetch && git checkout Mod_CommCustomFunctions_2016CS


Knowledge level



Note: the sample custom functions package contains more sample functions.