GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 36
Registered: ‎05-23-2016

Create points features along a line feature

Happy New year.

IHAC working with GeoMedia 2016. They wants to create points features along a line feature (streets)  each every 100 meters

 

How could we get it? 

 

Any idea about how to do it?

It doesn't matter Functional attribution or Spatial Modeler

 

Thanks a lot

 

 

Maria Martinez

Highlighted
Technical Evangelist
Posts: 556
Registered: ‎09-11-2015

Re: Create points features along a line feature

Hello Maria,

 

I can think of several ways, unfortunately none of them is straightforward.

 

  1. If you don't require a high precision, you can use the DENSIFY functional attribute. However, this is really just a rough approximation.
  2. You can use LRS for exact result. You need to add two functional attributes to your feature class: BeginMeasure, defined as constant 0.0, and EndMeasure defined as LENGTH(Input.Geometry). Then you need to create an "Event" table which consists of two columns, ID and EventPosition. For each id from you geometry table, there should be as many events as to cover your whole line. So the table should contain pars such as {1, 100}, {1, 200}, {1, 300}, ... until the second number exceeds the value of EndMeasure for the record with id 1. The same for id 2 and so on. You can use for example MS Excel to generate such table, then save it as a text file and use Text Schema Definition file to load this table to GeoMedia.
  3. If you don't mind some simple programming, you could create your own custom function package to implement an expansion function, which adds the event stops to your original table, so that you could use LRS without any external table. This may be a little bit more work, but the solution would be quite general (I might think about creating such a function as a shared sample myself).
  4. Install GeoMedia Transaction Manager and generate the stops using the commands from Routing tab. I don't know details of this solution, but I believe there should be a way to generate the Events table from your geometries and store them as a new table in your read/write connection. This should be quite simple solution, however it requires an additional product to be installed and licensed.

Pavel

Highlighted
Technical Evangelist
Posts: 556
Registered: ‎09-11-2015

Re: Create points features along a line feature

Hello Maria,

 

so I have created a shared sample to demonstrate the procedure. It requires a custom functions package, available to HGDN subscribers.

 

Pavel

Highlighted
Staff
Posts: 156
Registered: ‎05-26-2016

Re: Create points features along a line feature

How to do with Functional Attributes

 

Densify a line so that a uniform distance (ie 50m) is maintained between points, except for corner vertices using functional attributes.

 

1              Create a functional attribute query that segments the polylines and also saves some properties called SEGMENTS_OF_LINES

 

segs = SEGMENTS(Input.Geometry)  –   geometry segments

length_seg = LENGTH(Output.segs, ProjectedMeas, Meter) –  length of geometry segments

num_points_seg = INT(Output.length_seg/50) – number of full 50m sections

angle_segs = ANGLE(Output.segs, ProjectedMeas, Degree) – azimuth angle of segments

start_seg_pt = STARTPOINT(Output.segs) – starting point of segment

 

2              Create a functional attribute query that segments the SEGMENTS_OF_LINES query to extract the full 50m long sections, removing the remainder of line, called LONG_SEGMENTS_OF_LINES

 

long_seg = CREATEPOLYLINE(Input.start_seg_pt, MOVEBYDISTDIR(Input.start_seg_pt, 50*Input.num_points_seg, Input.angle_segs, ProjectedMeas))

 

3              Create a functional attribute query that uses DENSIFY on the LONG_SEGMENTS_OF_LINES query to get the desired 50m points.

long_seg_dens = POINTS(DENSIFY(Input.long_seg, 50, 24*(Input.num_points_seg+1)+20+1))

 

The DENSITY operator can have a mind of its own, but can be controlled if the Maxsize count in bytes can be determined. We know that there are (Input.num_points_seg+1) points and each point having 24 bytes( 3 x 8 bytes for X,Y and Z). A polyline also has 20 bytes for its header(guid and number of vertices). All you need to do is add 1 extra byte.

 

As the endpoint of the original polyline may not be divisable by 50m a Functional Attribute of  ENDPOINT(Input.Geometry) can be used to get point if desired.