Skip to main content
Question

Deagregate compound geometries? Compoundcurve to linestring

  • April 3, 2025
  • 1 reply
  • 21 views

so_much_more
Supporter
Forum|alt.badge.img+6

In postgis i can flatten compound geometries like so
SELECT ST_AsText(ST_CurveToLine(ST_GeomFromText('COMPOUNDCURVE (CIRCULARSTRING (576285.49817038781 7034469.7208286244, 576325.10797829565 7034483.5911118472, 576367.02 7034485.76), (576367.02 7034485.76, 576396.53 7034483.05), CIRCULARSTRING (576396.53 7034483.05, 576447.15568394249 7034473.94116881, 576495.46 7034456.26, 576500.76470677822 7034454.0120333815, 576506.21 7034452.13, 576508.88920362911 7034451.3602161128, 576511.59 7034450.67), (576511.59 7034450.67, 576517.82000000007 7034449.45), CIRCULARSTRING (576517.82000000007 7034449.45, 576521.86965882347 7034448.9300352931, 576525.94000000006 7034448.61, 576543.62140925834 7034449.5502338214, 576560.694903961 7034454.2419341141))')))

But how do i do the same thing in FME?

ArcStroker can only flatten Circular strings, but not compound geometries?

1 reply

takashi
Influencer
  • April 4, 2025

Hi ​@so_much_more 

I suppose you would like to replace every CIRCULARSTRING (arc defined with 3 points) with LINESTRING (polyline) approximately equivalent to the original arc, then create a new COMPOUNDCURVE representation consisting of LINESTRINGs. If I understand your requirement correctly, this workflow might help you.

  1. GeometryReplacer (Geometry Encodieng: OGC Well Known Text) : Create a Path geometry from the original text - i.e. ‘COMPOUNDCURVE (CIRCULARSTRING (576285.49817038781 7034469.7208286244, 576325.10797829565 7034483.5911118472, 576367.02 7034485.76), … CIRCULARSTRING (576517.82000000007 7034449.45, 576521.86965882347 7034448.9300352931, 576525.94000000006 7034448.61, 576543.62140925834 7034449.5502338214, 576560.694903961 7034454.2419341141))’
  2. PathSplitter : Split the Path into individual arcs.
  3. ArcStroker : Transform the arcs to approximately equivalent polylines.
  4. GeomertyExtractor (Geometry Encoding: OGC Wel Known Text) : Extarct WKT representation for each polyline as an attribute called e.g. “_geometry”.
  5. Aggregator : Cocatenate all the WKT representations separating by comma.
    • Attributes to Concatenate: _geometry
    • Separator Character: ,
  6. StringConcatenator (or AttributeManager, AttributeCreator) : Build the required text string with this expression.
    • COMPOUNDCURVE(@Value(_geometry))

Result: ‘COMPOUNDCURVE(LINESTRING (576285.4981703878 7034469.720828624,576295.004178631 7034474.239712696,576304.8078873551 7034478.070091426,576314.8595043488 7034481.192510645,576325.1079782957 7034483.591111847,576335.5012580589 7034485.25371274,576345.9865570456 7034486.171869113,576356.5106213049 7034486.340917728,576367.02 7034485.76), … LINESTRING (576525.9400000001 7034448.61,576531.8512345924 7034448.500295475,576537.7551456395 7034448.8142442545,576543.6214092583 7034449.550233821,576549.4198949317 7034450.704483961,576555.1208202662 7034452.27106617,576560.694903961 7034454.241934114))’

Hope this helps.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings