Skip to main content

Hi,

I wonder how I can control what type of Arc is created with GMLFeatureComposer. 

I have tried to convert every nativ IFMEArc to Arc by 3 points, by using a PathSplitter, GeometryFilter ArcStroker (number of interpolated egdes = 2) ArcEstimator-> now every Arc is IFMEArc Arc by 3 points. then I send them into the GMLFEatureComposer and output is:

<gml:ArcByCenterPoint numArc="1">								<gml:posList>610994.229288738 6650770.14554273</gml:posList>				<gml:radius uom="EPSG:25832">24.6290249574635</gml:radius>				<gml:startAngle uom="degree">65.8899835987118</gml:startAngle>				<gml:endAngle uom="degree">57.0505172196457</gml:endAngle>
</gml:ArcByCenterPoint>

I want:

<gml:Arc>
 <gml:posList>60.02 10.1 60.01 10.2 60.03 10.03
 </gml:posList>
</gml:Arc>

Don't mind the numbers its from 2 different examples.

How can I control what type of arc is created?

Anyone? The manual apporche would be to try and replace them afterwords, but I really don't wanna do that.

 

 


Anyone? The manual apporche would be to try and replace them afterwords, but I really don't wanna do that.

 

 

I'm really not sure how this works. I don't see a parameter on the transformer or GML writer, so I wonder if this is hard-coded. Anyway, I've asked our developers and will let you know what they say.

 

 


So it looks like there is no way to control what type of arc gets written. I'm told that the different forms of arc are all mathematically the same geometry, so in that sense it shouldn't matter. Of course, I realize that depends on where you're going to use the XML and if it's acceptable to have the arc in a different structure.

From a support point of view I can only suggest you post an idea to this site, to have the ability to choose what arc form to write, and if enough people like the idea we would implement it. In the meantime, I think doing a semi-manual replace is the best we can do. The XMLUpdater transformer is the one that is meant for this sort of task, in preference to a straight text replace with the StringReplacer. I guess that depends on what you feel more comfortable with. If you have problems with either method, let us know and we can try and help.

Apologies for any inconvenience this is causing.


So it looks like there is no way to control what type of arc gets written. I'm told that the different forms of arc are all mathematically the same geometry, so in that sense it shouldn't matter. Of course, I realize that depends on where you're going to use the XML and if it's acceptable to have the arc in a different structure.

From a support point of view I can only suggest you post an idea to this site, to have the ability to choose what arc form to write, and if enough people like the idea we would implement it. In the meantime, I think doing a semi-manual replace is the best we can do. The XMLUpdater transformer is the one that is meant for this sort of task, in preference to a straight text replace with the StringReplacer. I guess that depends on what you feel more comfortable with. If you have problems with either method, let us know and we can try and help.

Apologies for any inconvenience this is causing.

Thanks for this answer. I have posted and idea about this matter. Its our national SOSI GML that only supports 1 implementation of the arc geometry.

 

So our solution is to stroke every arc, but I wish to maintain true arcs, cause overlapping stroked arcs might not share the same boundary after stroking.
Thanks for this answer. I have posted and idea about this matter. Its our national SOSI GML that only supports 1 implementation of the arc geometry.

 

So our solution is to stroke every arc, but I wish to maintain true arcs, cause overlapping stroked arcs might not share the same boundary after stroking.
I'm looking into this a bit more. An XML developer hinted there is a solution, but I'm not sure what it is so I've asked for clarification. Another XML expert here chimed in to say...

 

 

"One workaround to explore would be to write this with a XMLTemplater. Filter geometry by arc. Use an ArcPropertyExtractor to get the first, middle and last vertex. use these to build the posList for the arc object they want. Then XMLUpdater for the gml arcs"

 

 

So are you using the SOSI format writer in FME? Sorry I'm not too familiar with it, and just wondering if the GMLFeatureComposer is necessary. The SOSI writer itself might have the required functionality built in (ie it knows which arc to use where the transformer does not).

 


why not extract 3 points from a arc (non stroked of course)

Instead of extracting upi can use arcporperty extractor and calculate a third point. Or just use center and radius to calculate 3 points

and the construct the gml snippets?

Or use the output from the GMLFEatureComposer and calculate a 3thd point to create the required gml snippet. (the math is prtty easy)


I'm looking into this a bit more. An XML developer hinted there is a solution, but I'm not sure what it is so I've asked for clarification. Another XML expert here chimed in to say...

 

 

"One workaround to explore would be to write this with a XMLTemplater. Filter geometry by arc. Use an ArcPropertyExtractor to get the first, middle and last vertex. use these to build the posList for the arc object they want. Then XMLUpdater for the gml arcs"

 

 

So are you using the SOSI format writer in FME? Sorry I'm not too familiar with it, and just wondering if the GMLFeatureComposer is necessary. The SOSI writer itself might have the required functionality built in (ie it knows which arc to use where the transformer does not).

 

No there is nothing wrong with using this in the SOSI GML, its when syncing data with our government things fail. At the recievers point, they have only implemented support for the gml:arc geometry when storing data in their database. So if a GML contains ArcByCenterPoint it all fails.

So it looks like there is no way to control what type of arc gets written. I'm told that the different forms of arc are all mathematically the same geometry, so in that sense it shouldn't matter. Of course, I realize that depends on where you're going to use the XML and if it's acceptable to have the arc in a different structure. 

From a support point of view I can only suggest you post an idea to this site, to have the ability to choose what arc form to write, and if enough people like the idea we would implement it. In the meantime, I think doing a semi-manual replace is the best we can do. The XMLUpdater transformer is the one that is meant for this sort of task, in preference to a straight text replace with the StringReplacer. I guess that depends on what you feel more comfortable with. If you have problems with either method, let us know and we can try and help.

Apologies for any inconvenience this is causing.

Ok so I have had som more time to look into this matter.

 

So far I have manage to build my new segments. Now I want to update my existing gml. by replacing every child of gml:segments with my new segments:

 

 

Existing GML feature: 

 

<app:RpFormålGrense xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:app="http://skjema.geonorge.no/SOSI/produktspesifikasjon/Reguleringsplan/20171020" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:sc="http://www.interactive-instruments.de/ShapeChange/AppInfo" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="app.RpFormalGrense_0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6">
   <app:identifikasjon>
      <app:Identifikasjon>
         <app:lokalId>0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6</app:lokalId>
         <app:navnerom>kartverket.no</app:navnerom>
      </app:Identifikasjon>
   </app:identifikasjon>
   <app:kvalitet>
      <app:Posisjonskvalitet>
         <app:målemetode>99</app:målemetode>
      </app:Posisjonskvalitet>
   </app:kvalitet>
   <app:grense>
      <gml:Curve gml:id="app.RpFormalGrense_0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6-0" srsName="EPSG:25832" srsDimension="2">
         <gml:segments>
            <gml:LineStringSegment>
               <gml:posList>610579.84 6648725.95 610574.96 6648726.95</gml:posList>
            </gml:LineStringSegment>
            <gml:ArcByCenterPoint numArc="1">
               <gml:posList>610576.478987209 6648726.95624881</gml:posList>
               <gml:radius uom="EPSG:25832">1.51900006254298</gml:radius>
               <gml:startAngle uom="degree">180.235702157121</gml:startAngle>
               <gml:endAngle uom="degree">116.130228200224</gml:endAngle>
            </gml:ArcByCenterPoint>
         </gml:segments>
      </gml:Curve>
   </app:grense>
</app:RpFormålGrense>
new segments:

 

<gml:segments>
    <gml:LineStringSegment>
        <gml:posList>
            610579.84 6648725.95 610574.96 6648726.95
        </gml:posList>
    </gml:LineStringSegment>
    <gml:Arc>
        <gml:posList>
        610574.95999999996 6648726.9499999993 610575.18823819596 6648727.7570784912 610575.80999999959 6648728.3200000003
        </gml:posList>
    </gml:Arc>
</gml:segments>
Now I have tried to use the python xml.etree library, but all the namespaces is giving me a hard time replacing without declaring all the namespaces first. I don't even know how to declare them correct anyway.

 

 

I want to be able to do this with the XMLUpdater, how would I use this when both gml strings is attributes on the same feature?

 

@Mark2AtSafe

 

 


Ok so I have had som more time to look into this matter.

 

So far I have manage to build my new segments. Now I want to update my existing gml. by replacing every child of gml:segments with my new segments:

 

 

Existing GML feature: 

 

<app:RpFormålGrense xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:app="http://skjema.geonorge.no/SOSI/produktspesifikasjon/Reguleringsplan/20171020" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:sc="http://www.interactive-instruments.de/ShapeChange/AppInfo" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="app.RpFormalGrense_0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6">
   <app:identifikasjon>
      <app:Identifikasjon>
         <app:lokalId>0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6</app:lokalId>
         <app:navnerom>kartverket.no</app:navnerom>
      </app:Identifikasjon>
   </app:identifikasjon>
   <app:kvalitet>
      <app:Posisjonskvalitet>
         <app:målemetode>99</app:målemetode>
      </app:Posisjonskvalitet>
   </app:kvalitet>
   <app:grense>
      <gml:Curve gml:id="app.RpFormalGrense_0A99A7B5-5483-4EBF-BCCA-2FA5BDC7A8A6-0" srsName="EPSG:25832" srsDimension="2">
         <gml:segments>
            <gml:LineStringSegment>
               <gml:posList>610579.84 6648725.95 610574.96 6648726.95</gml:posList>
            </gml:LineStringSegment>
            <gml:ArcByCenterPoint numArc="1">
               <gml:posList>610576.478987209 6648726.95624881</gml:posList>
               <gml:radius uom="EPSG:25832">1.51900006254298</gml:radius>
               <gml:startAngle uom="degree">180.235702157121</gml:startAngle>
               <gml:endAngle uom="degree">116.130228200224</gml:endAngle>
            </gml:ArcByCenterPoint>
         </gml:segments>
      </gml:Curve>
   </app:grense>
</app:RpFormålGrense>
new segments:

 

<gml:segments>
    <gml:LineStringSegment>
        <gml:posList>
            610579.84 6648725.95 610574.96 6648726.95
        </gml:posList>
    </gml:LineStringSegment>
    <gml:Arc>
        <gml:posList>
        610574.95999999996 6648726.9499999993 610575.18823819596 6648727.7570784912 610575.80999999959 6648728.3200000003
        </gml:posList>
    </gml:Arc>
</gml:segments>
Now I have tried to use the python xml.etree library, but all the namespaces is giving me a hard time replacing without declaring all the namespaces first. I don't even know how to declare them correct anyway.

 

 

I want to be able to do this with the XMLUpdater, how would I use this when both gml strings is attributes on the same feature?

 

@Mark2AtSafe

 

 

Face slap. This was easy to solve with regex substitue.


Face slap. This was easy to solve with regex substitue.

This is still unsolved


I have switched to using the gml writer. It still writes ArcByCenterPoint. Is there not anyone in this world who countered this same problem?


Reply