Skip to main content

Hello,

How to extract a GML geometry from feature with keeping the original

CircleByCenterPoint type and the UOM instead of a posList of points ?

Out of curiosity: what does your "GeometryReplacerCerde" do?  :)


The problem in your case is that FME is not extracting a circle, but an ellipse. In your screenshot, there is a primary and a secondary radius. I've tested extracting a circle (so where the secondary radius is not defined/equal to the primary one) and FME 2017 gives me this:

<gml:Curve xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="id-2d39993a-6018-11e7-b4b2-c42c033923d4-0" srsDimension="2">
  <gml:segments>
    <gml:CircleByCenterPoint numArc="1">             <gml:posList>10 60</gml:posList>      
      <gml:radius>2</gml:radius>         </gml:CircleByCenterPoint>
  </gml:segments> </gml:Curve>

So that seems to work. However, if I feed it an ellipse, it gets stroked by FME into a line and you end up with the posList like you did. I'm not sure, but I don't think GML supports storing elliptical geometry..?

Depending on what the spatial reference of your output GML needs to be and what your input is, you could try to create a true circle (reprojection probably turned it into an ellipse). This question might provide some insight there.


Just a tip for the future: when having problems like these it would be very helpful if you could post a GML sample dataset in addition to the screenshots. In case the screenshot isn't obvious by itself, it's really helpful for those trying to help debug the issue without having to type the GML manually :-)


I'm not sure I understand what the GML labelled "AttributeCreator" is meant to be in your screenshot. If it's the source data, why extract to GML when it's already GML?

Anyway, like you - but differently to @sander_s - when I extract a circle feature to GML then I get a LinearRing. It seems to be that a circle or ellipse that is an area will not be written to GML as a circle feature. It needs to be a closed, circular arc.

For example, if I use the Creator and create an ellipse (x,y,radius = 5,5,5) then I get a LinearRing. When I create an arc (x,y,radius,sweep angle = 5,5,5,360) then I get a CircleByCentrePoint

The simple solution is to take your circles/ellipses and use a GeometryCoercer to coerce them to a line. It actually coerces them to a circular arc which then is written in GML correctly.

I will also query our GML developers about this, since the Readers and Writers manual says we don't support circles/ellipses when we clearly do (in a fashion).


I'm not sure I understand what the GML labelled "AttributeCreator" is meant to be in your screenshot. If it's the source data, why extract to GML when it's already GML?

Anyway, like you - but differently to @sander_s - when I extract a circle feature to GML then I get a LinearRing. It seems to be that a circle or ellipse that is an area will not be written to GML as a circle feature. It needs to be a closed, circular arc.

For example, if I use the Creator and create an ellipse (x,y,radius = 5,5,5) then I get a LinearRing. When I create an arc (x,y,radius,sweep angle = 5,5,5,360) then I get a CircleByCentrePoint

The simple solution is to take your circles/ellipses and use a GeometryCoercer to coerce them to a line. It actually coerces them to a circular arc which then is written in GML correctly.

I will also query our GML developers about this, since the Readers and Writers manual says we don't support circles/ellipses when we clearly do (in a fashion).

Ah, the manual says circular arc = yes, but elliptical arc = no, so that might be why

 

 


Ah, the manual says circular arc = yes, but elliptical arc = no, so that might be why

 

 

Exactly, I also noticed that (but by trying, not reading ;)). I was converting a closed circular arc (not an area/polygon as these are always stroked, right?), which I made with a Creator.

 

 


Exactly, I also noticed that (but by trying, not reading ;)). I was converting a closed circular arc (not an area/polygon as these are always stroked, right?), which I made with a Creator.

 

 

Yes, anything with a filled area becomes stroked in the GML. Not sure why a pure circle feature wouldn't become one in the output, but I guess that's a design decision.

 


Reply