Hexagon Geospatial
MENU

GeoMedia

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
Super Contributor
Posts: 421
Registered: ‎10-27-2015

Calculating distances in Geomedia

Dear all,

I have two shapefiles: one shapefile with some points and one shapefile with a networks. I would like to calculate the minimum distance between each point and the network. Is it possibile ? Is it possible using the DISTANCE Functional Attribute?

thank you very much

Regards

Giuseppe M.

Regular Contributor
Posts: 182
Registered: ‎05-25-2016

Re: Calculating distances in Geomedia

try aggregation with nearest operator and DISTANCE()

Highlighted
Staff
Posts: 147
Registered: ‎02-02-2016

Re: Calculating distances in Geomedia

In Aggregation you might want to use the "accumulate nearest" spatial operator option for relating information from your network lines to the points. Accumulate nearest ensures that each summary feature is associated to one detail feature (the nearest).

 

Let's say that for every city (points) you want to know the name of the nearest river (lines) and you want to know the distance to the river.

  1. Analysis > Aggregation
    Summary feature: Cities
    Detail feature: Rivers
    Spatial operator: Accumulate Nearest
  2. Click on the Output tab to define desired expressions. Since there is only 1 nearest detail for each summary feature you can just use FIRST to get desired attributes. You can use the DISTANCE expression to calculate distance.
  3. Try right-clicking in the Output functional attributes field for New > First > Multiple Attributes... Here you can select which attributes such as River_Name that you want to summarize to each city point. You can use the Properties button to modify the name of the expression if desired.
  4. You can use the New... button to access the Functional Attributes expression building dialog where you can build any expression that is a summarizing or aggregating (Many to One) type expressions.

DISTANCE expression syntax:
DISTANCE(Geometry1, Geometry2, MeasType, UnitOfMeasure, TwoD)

The following example would calculate from the nearest river, FIRST(Detail.Geometry) to each summary city Input.geometry in projected 2D Kilometers:
DISTANCE(FIRST(Detail.Geometry),Input.Geometry,ProjectedMeas,Kilometer,TRUE())

 

The TwoD parameter is a boolean flag where TRUE() is the default which represents 2D. If you want 3D use FALSE(). If you don't specify ProjectedMeas, then TrueMeas (True Measure) is the default. The default unit of measure is meter if not specified. The measure types and units can be found in the Constants category listed along the left.

 

Note!  Be aware that all geometry calculations done in the expression system are based on the coordinate system assigned for feature class storage. Functional calculations for distance, area, perimeter, etc.. do NOT use the GeoWorkSpace coordindate system.

 

Good Resource: Expression Function Packages help topic has a hyperlinked list of functions for a quick review of syntax.  Some have examples.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.