Skip to main content
Question

Parsing Text File to Create Geometry


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

4 replies

ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • 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
  • May 13, 2020
ebygomm wrote:

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+33
  • Influencer
  • May 13, 2020
mark_f wrote:

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
  • May 13, 2020
ebygomm wrote:

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


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