Geomedia: Useful functional attributes

Useful functional attributes expressions.
Arguments separator could be different according to your international settings.

  • Distance (projected) from point to point
    There might be a bug in the DISTANCE function in case of coincident points, so you better workaround like this:
  • LENGTH( CREATEPOLYLINE( pointgeometry_1 ; pointgeometry_2 ) ; 1 )

  • Add leading zeros
    examples to get a four-digit string like 0001, 0012, 0123
    • to a numeric field:
      TEXT( numericfield ; "0000" )
    • to a text field all filled with numeric strings:
      TEXT( VALUE( textfield ) ; "0000" )
    • to a text field:
      REPT( "0"; 4 - LEN( textfield ) ) + textfield

  • Trim leading zeros
    MID( textfield ; SEARCH( "[^0]" ; textfield ) )

  • Point projected coordinates
    • north:
      X( geometryfield ; 1 )
    • east:
      Y( geometryfield ; 1 )

  • Convert text geometry to point geometry
    ORIGIN( textgeometryfield )

  • In analytical merge, count those records that fulfill a specified where condition
    example: count all the records where field is less than 20
    SUM( IF( numericfield < 20 ; 1 ; 0) )

  • Casting a numeric value to text
    TEXT( textfield ; "" )
    Fundamentals of text formatting: put a "0" to get a digit-value or a 0; put a "#" to get a digit-value or nothing; add a section in the mask for negative values. Examples:
    TEXT( 2.715 ; "0.00"  ) returns "2.72"
    TEXT( 2.71  ; "0.000" ) returns "2.710"
    TEXT( 2.71  ; "0.###" ) returns "2.71"
    TEXT( -2.7  ; "0.###;-0.000" ) returns "-2.700"


  • Rotate a point or a label by an attribute value in degrees
    SPIN( {text}pointgeometryfield ; numericfield )

  • Create a linestring from rows of points aggregated by an attribute value
    Use Analytical merge for this. Select the By Attribute option and choose the discriminating attribute in the list below. Then edit the Geometry attribute in the Output functional attributes box clicking on Properties. Delete the default MERGE(Input.Geometry) and type
    CREATEPOLYLINE( pointgeometryfield ; numericfield )
    numericfield is an optional but recommended attribute to set the order of the point sequence

5 comments:

  1. thanks toni to have nice ideas on Geomedia prof.
    regarding functional attribute query for distance between two point features, i used Aggregation instead of Funtional attrib./Analytical merge SYTAX I USED-
    LENGTH( CREATEPOLYLINE( pointgeometry_1, pointgeometry_2 ),1,METER )
    but not any out put.
    -ram
    singhramkumar@gmail.com

    ReplyDelete
  2. Do you know how to get total length inside and area, when there are multiple length segments ie roads inside an area? I tried Functional Attribute but all I got was the same length as the length of the segment.

    ReplyDelete
    Replies
    1. Try "aggregation". Pick "contain" as spatial relation, then in the output tab type something like SUM( LENGTH(Detail.Geometry) ) hope this helps

      Delete
  3. Hi Tony,

    Could you please show me how to convert Text geometry to Point Geometry?.
    Now, my Text geometry layer is not have any attribute.

    Thanks

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete