Skip to main content
Question

Parsing Text File to Create Geometry

  • May 13, 2020
  • 4 replies
  • 49 views

Forum|alt.badge.img+2

Hello

 

 

I'm looking for inspiration to parse a tab delimited text file that defines features. Geometry can be Point (single row), or Line/Poly multiple rows with the order maintained in the file and also with a sequenece number if required.

This is all fairly simple except the segments for Line/Poly can be a mix of straight lines and arc segments.

Looking for ideas how to construct the geometry for Lines/Polys containing arcs?

 

My current approach might be to build the geometry in an attribute value (FME OGC WKT doesn't support arcs) and use GeometryReplacer

Further suggestions appreciated - Thanks

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • May 13, 2020

How are the arcs defined? Could you build the text string as FME XML/gml and follow with the geometry replacer?

 


Forum|alt.badge.img+2
  • Author
  • 325 replies
  • May 13, 2020

How are the arcs defined? Could you build the text string as FME XML/gml and follow with the geometry replacer?

 

0684Q00000ArKHlQAN.png

There's a coordinate, radius and also two angle (start/end). Your approach is what I'm thinking, and might stay away from GML if I can.

 

Here's a slightly different example extracted from Oracle:

<?xml version="1.0" encoding="US_ASCII" standalone="no" ?>
<geometry>
    <polygon>
        <path>
            <line>
                <coord x="6" y="10"/>
                <coord x="10" y="1"/>
                <coord x="14" y="10"/>
            </line>
            <arcBy3Points>
                <startCoord x="14" y="10"/>
                <midCoord x="10" y="14"/>
                <endCoord x="6" y="10"/>
            </arcBy3Points>
        </path>
    </polygon>
</geometry>

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • May 13, 2020

There's a coordinate, radius and also two angle (start/end). Your approach is what I'm thinking, and might stay away from GML if I can.

 

Here's a slightly different example extracted from Oracle:

<?xml version="1.0" encoding="US_ASCII" standalone="no" ?>
<geometry>
    <polygon>
        <path>
            <line>
                <coord x="6" y="10"/>
                <coord x="10" y="1"/>
                <coord x="14" y="10"/>
            </line>
            <arcBy3Points>
                <startCoord x="14" y="10"/>
                <midCoord x="10" y="14"/>
                <endCoord x="6" y="10"/>
            </arcBy3Points>
        </path>
    </polygon>
</geometry>

It looks like you can omit the secondary radius and the end point without issues, so you'd just need to calculate the sweep angle if you have coordinate, radius and also two angles (start/end)  - I'm not sure if you just have start and end how you know whether to go clockwise or counterclockwise though?


Forum|alt.badge.img+2
  • Author
  • 325 replies
  • May 13, 2020

It looks like you can omit the secondary radius and the end point without issues, so you'd just need to calculate the sweep angle if you have coordinate, radius and also two angles (start/end) - I'm not sure if you just have start and end how you know whether to go clockwise or counterclockwise though?

Just finding the code for ACW/CW direction

Next up Great Circle and Rhumb lines