Question

How to create a good geometry with coordinates x,y


Badge

Hello

I have a lot of points with coordinates x,y in latitude,longitude.

These points are grouped in records. Each record is identified with an unique identifier. Call it "Id". Each record can have multiple points

In a record each point must be joined to the next one following it by 2 means :

1- a straight line

2 - an arc of circle

When the arc of circle is used, we need to have the center point coordinates and the radius. An attribute is used for that with the coordinates of the 2 points which have to be joined to form the arc.

The end point has to be joined with the first one by a straight line.

I have to draw this geometry for each record and i don't know the way of doing this.

1 - polygones

2 - polygones with arc of circles.

Any help would be great


13 replies

Userlevel 2
Badge +17
There should be a way, but specifically depending on the source data structure. Could you please share a sample source dataset with us?

 

 

Badge

45-lfbd-2-1.png

Here is a short sample of the dataset

Userlevel 2
Badge +17

45-lfbd-2-1.png

Here is a short sample of the dataset

hmm, it's hard to understand what the XML snippet means without any explanation on the meaning of each element. I guess:

 

 

  • The Abd element represents the boundary of a polygon.
  • Each Avx element represents a vertex with the coordinates (geoLong, geoLat).
  • codeType = CWA means that this Avx and the next Avx should be connected by an arc with the center (geoLongArc, geoLatArc) and the radius valRadiusArc.
  • codeType = GRC means that this Avx and the next Avx should be connected by a straight line segment.
  • geoLat(Arc) and geoLong(Arc) are DMS coordinates. e.g. 450724.00N = 45 degrees 7 minutes 24.00 seconds north latitude, 0010341.00W = 0 degrees 3 minutes 41.00 seconds west longitude.
Am I right?

 

 

The missing information is what the coordinate system WGE is, and what the unit NM of the arc radius is. Unless those are clarified, the arc cannot be created anyway.

 

 

Userlevel 2
Badge +17

45-lfbd-2-1.png

Here is a short sample of the dataset

And please attach an XML document (text file) that contains at least one complete Adb element (polygon), rather than screenshots.

 

Userlevel 2
Badge +17

45-lfbd-2-1.png

Here is a short sample of the dataset

One more missing information. How can you identify the orientation of each arc segment?

 

Perhaps does the codeType "CWA" mean "ClockWise Arc"?

 

If so, is there the code "CCWA" - "Counter-ClockWise Arc" too?

 

Badge

Hi

I confirm you are right with all.

CWA means ClockWise Arc.

CCA means Counter Clockwise Arc.

NM means Nautical Miles ( 1 NM = 1852 m)

The initial format is in XML

WGE is for WGS 84.

<abd> is for the record of one boundary

<avx> is the set of vertices for one boundary.

I can send you tomorrow a more complete dataset. I'm not at office today.

Userlevel 2
Badge +17
One more missing information. How can you identify the orientation of each arc segment?

 

Perhaps does the codeType "CWA" mean "ClockWise Arc"?

 

If so, is there the code "CCWA" - "Counter-ClockWise Arc" too?

 

oops, the information regarding orientation was not necessary, since the orientation of an arc can be determined by start, end, and center points. Ignore the comment above.

 

 

Badge

20171018-154525.png

Userlevel 2
Badge +17

Hi

I confirm you are right with all.

CWA means ClockWise Arc.

CCA means Counter Clockwise Arc.

NM means Nautical Miles ( 1 NM = 1852 m)

The initial format is in XML

WGE is for WGS 84.

<abd> is for the record of one boundary

<avx> is the set of vertices for one boundary.

I can send you tomorrow a more complete dataset. I'm not at office today.

Thanks for your confirmation. I wait for the dataset.

 

 

Badge

Hi,

As discussed yesterday, i send you a short dataset in XML format.

Let me know if you have some advices for the drawing of such geometries.

Thanks in advance

airspace45.xml

Userlevel 2
Badge +17

Hi @philippe33, thanks for sharing the XML document. If I understood the requirement correctly, this workspace would work as expected.

xml2none.fmwt (FME 2017.1)

Badge

Hi Takashi

Your workbench is wonderfull !!! It gives me really a good approching result.

After attaching a geometryExtractor at the end of the workbench the GML Description obtained is < gml: Curve> with properties like radius , startAngle,sweepAngle ....

For the drawing of airspaces in the ellipsoid representation of Earth the correct geometry to represent them is an Ellipse.

I obtained a formula which seems to be correct (known as Vincenty inverse iterative formula ) to obtain such accurate geometries.

With this iterative formula ( 2 points geolat geolong in input and the coordinates of the center) we obtain the azimuth for the first point (startAngle ) with a very nice accuracy and the azimuth of the second point (endAngle ).the sweepAngle is the sum of the two angles obtained .

In FME representation this arc is an ellipsoid arc with the definition of the radius ,startAngle,sweepAngle ,and the beginning and ending points.

I have to put this formula written in C # probably in the Python transformer to replace your initial calculation or in different FME transformers

If you can help me to translate this formula in Python script. ...

Many many thanks in advance for your help

Badge

Hi @takashi

I have this formulae to insert in a PythonCaller transformer to retrieve the value of startAngle and EndAngle in order to have the correct bearing indication (maximum of accurate ) for the arc. And then construct the arc with only these values ( center, startAngle, endAngle radius ).

I find the formulae in Python and i would like to know if i have to copy/paste this one in a transformer to match with the desired result.

I know i have to call the FMEarc() function with center, startAngle, endAngle, radius to obtain in output a geometry "arcbycenterpoint " but i don't know Python language at all ...

Can you give me an advice please ?

Thanks .

-init.py

Reply