Hi
My first idear to this problem was to use Tcl or @Evaluate() to calculate
the attributes fme use to describe an Arc, yeasteday I had to look in the
manual and discoverede that fme already support this functionality
We can use the @Arc() to convert the point and attributes into a line and
then use the @ConverTtoArc() tho convert thsi linesting into a Arc feature
the attatched mapping file illustrate hov to do this
RTFM
Peter
NB Now marks just have to convert this into a transformer
>From: "Bruce Harold" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: <[email protected]>
>CC: "'Greg Drummond'" <[EMAIL PROTECTED]>
>Subject: RE: [fme] Re: Creating an Arc from values in coordinates and
>attributes
>Date: Thu, 25 Jan 2007 11:56:25 +1300
>
>Mark
>
>
>
>Yes we would find arc replacement transformers useful here in NZ, the two
>styles you mention plus one more.
>
>Our national cadastre stores arcs in a bulge style (I assume your bulge
>parameter would encode left/right using sign?).
>
>We would need a transformer which works with inputs being chord bearing,
>chord length, arc radius and bulge left/right. We have to retrieve the end
>point coordinates with a join or merge in a preliminary step.
>
>I attach LINZ's dictionary entry for the data.
>
>
>
>If you build this into FME it would ease the way for LINZ to publish data
>via WFS etc.
>
>
>
>Regards
>
>
>
>Bruce.
>
>
>
>Bruce Harold
>
>Geographic Information Solutions
>
> <http://www.gis.co.nz> www.gis.co.nz
>
>Ph. (64) (0) 9 537 3247
>
>Mb. (+64) (0) 21 2995995
>
> _____
>
>From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
>mark2atsafe
>Sent: Thursday, 25 January 2007 11:42 a.m.
>To: [email protected]
>Subject: [fme] Re: Creating an Arc from values in coordinates and
>attributes
>
>
>
>Good to hear you have a working solution.
>Re this issue, we've updated the @Geometry function to permit creating
>an arc by 3 points...
>
><arcBy3Points>
><startCoord x="5" y="5" />
><midCoord x="2" y="8" />
><endCoord x="7" y="11" />
></arcBy3Points>
>
>...and an arc defined by bulge...
>
><arcByBulge>
><startCoord x="12" y="12" />
><endCoord x="20" y="20" />
><bulge>.5</bulge>
></arcByBulge>
>
>...and I'm sure these will appear in Workbench shortly. The 2 end
>points/centre-point is causing confusion because we think it would
>only work for a circular arc where the radius of the two end points is
>the same. Therefore the second point would be moved as necessary to
>fit the spec, eg, given...
>
>center: 0, 0
>start: 4, 3
>end: 0, -10
>
>...the end point would be updated to (0, -5). The XML generated by
>this would be
>
><arc>
><centerCoord x="0" y="0" />
><primRadius>5.0</primRadius>
><startAngle>36.8698976458440</startAngle>
><sweepAngle>143.1301023541559</sweepAngle>
><startCoord x="4" y="3" />
><endCoord x="0" y="-5" />
></arc>
>
>It's under discussion whether we'll do this one or not (or save it for
>later). Are there any other users apart from Michael who would find
>this useful? Would you ever need this in a "creator" transformer, or
>purely in a "replacer"?
>
>Mark
>
>Mark Ireland, Senior Product Specialist
>Safe Software Inc. Surrey, BC, CANADA
>[EMAIL PROTECTED] <mailto:support%40safe.com> com http://www.safe.
><http://www.safe.com> com
>Solutions for Spatial Data Translation, Distribution and Access
>
>--- In [EMAIL PROTECTED] <mailto:fme%40yahoogroups.com> com, "mhabarta"
><[EMAIL PROTECTED]> wrote:
> >
> > Hello
> >
> > Thanks for all the support on the arc problem.
> >
> > I solved it, using 2DArcReplacer and some ExpressionEvaluators
> > to calculate the radius, rotation, and sweep_angle from the attributes
> > containing the center, start- and endpoint, and put all this in an
> > embedded custom transformer.
> >
> > Michael
> >
> >
> > --- In [EMAIL PROTECTED] <mailto:fme%40yahoogroups.com> com,
>"mark2atsafe"
><mark.ireland@> wrote:
> > >
> > > > 4. Petition Safe to expand its arc support by adding different arc
> > > notation styles to Creator and (2D|3D)ArcReplacer.
> > >
> > > I'll file an enhancement request. It seems a reasonable thing to be
> > > able to do and with the new geometry model I believe the FME core can
> > > handle arcs defined in a number of ways (3 edge points, 2 end points +
> > > centre, etc).
> > >
> > > Regards,
> > >
> > > Mark
> > >
> > > Mark Ireland, Senior Product Specialist
> > > Safe Software Inc. Surrey, BC, CANADA
> > > support@ http://www.safe. <http://www.safe.com> com
> > > Solutions for Spatial Data Translation, Distribution and Access
> > >
> >
>
>
>
><< DataDictionaryforArcObservations.doc >>
_________________________________________________________________
Download din yndlingsmusik på MSN Music: http://www.msn.dk/music det er
nemt og billigt
For insights into what's up at Safe Software and what's on the development
horizon, visit Safe's blog at spatial-etl.blogspot.com.
Safe Software has also made slides available that outline enhancements planned
for FME 2007. The slides are from the "Road Ahead" presentation given on Day 2
of the FME Worldwide Users Conference. To view these slides, visit
www.safe.com/2006uc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/fme/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/fme/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
/*
============================================================================
Navn : Peter Laulund, KMS
Oprettet dato : 03 juli 2006 - 13:53
Beskrivelse :
Problemer :
============================================================================*/
#
=============================================================================
#
-----------------------------------------------------------------------------
MAPPING_FILE_ID "Version 1.0, 03 juli 2006"
#LOG_FILENAME $(FME_MF_DIR)TEST.LOG
LOG_APPEND no
#FME_DEBUG MAPPING_FILE
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
INCLUDE [ puts "MACRO mfRoot $(FME_MF_DIR_UNIX)" ]
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
DEFAULT_MACRO SourceFormat NULL
DEFAULT_MACRO DestFormat NULL
DEFAULT_MACRO SourceDataset nullin
DEFAULT_MACRO DestDataset nullout
DEFAULT_MACRO SourceCoordSys UTM32-EUREF89
DEFAULT_MACRO DestCoordSys S34S
DEFAULT_MACRO Dim 2D
READER_META_ATTRIBUTES fme_feature_type fme_dataset fme_basename
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
READER_TYPE $(SourceFormat)
READER_KEYWORD INPUT
INPUT_DATASET "$(SourceDataset)"
WRITER_TYPE $(DestFormat)
WRITER_KEYWORD OUTPUT
OUTPUT_DATASET "$(DestDataset)"
#
=============================================================================
FACTORY_DEF * CreationFactory
\
FACTORY_NAME "Create point feature with attributes"
\
2D_GEOMETRY 0 0
\
NUMBER_TO_CREATE 1
\
OUTPUT FEATURE_TYPE *
\
@SupplyAttributes(X1, 10, Y1, 0)
\
@SupplyAttributes(X2, 0, Y2, 10)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "Convert from point and attributes to Arc"
\
@Arc(CCW, &X1, &Y1, &X2, &Y2, 3)
\
@SupplyAttributes(fme_type, fme_line)
\
INPUT FEATURE_TYPE *
\
@ConvertToArc(fme_primary_axis,fme_secondary_axis,fme_start_angle,fme_sweep_angle)
\
@RoundOffCoords(x, 2)
\
@RoundOffCoords(y, 2)
\
@SupplyAttributes(fme_type, fme_arc)
\
OUTPUT FEATURE_TYPE Arc
\
@Log("Arc logger", 3, 1)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
FACTORY_DEF * CreationFactory
\
FACTORY_NAME "Create dummy feature"
\
2D_GEOMETRY -1 -1 11 11
\
NUMBER_TO_CREATE 1
\
OUTPUT FEATURE_TYPE Linje
#
=============================================================================
INCLUDE visData.fmi
#
=============================================================================
INPUT *
OUTPUT *
#
-----------------------------------------------------------------------------
#
=============================================================================
/*
============================================================================
Navn : Peter Laulund, KMS
Oprettet dato : 13 oktober 2004
7 november 2006 version 2
Beskrivelse : Transformer der logger et datasæt til en FFS fil og
derefter
viser det med FmeView (inspireret af Visualizer i
WorkeBench)
Hvordan skal initiering være
Er der behov for en SamplingFactory til at minimere data
Hvordan med navngivningen af tmpfilen skal den være
anderledes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
DEFAULT_MACRO vis -1
INCLUDE [ if { $(vis) > 0 } { \
puts "INCLUDE [regsub -all -- {\\} $env(MY_FME)
{/}]/KMSLIB/VIS/VisData.fmi" }]
============================================================================*/
#
=============================================================================
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
DEFAULT_MACRO VisName
DEFAULT_MACRO toViewFile VisData
INCLUDE [ puts "MACRO toViewDir [regsub -all -- {\\} $env(FME_TEMP) {/}]"]
INCLUDE [ catch {file delete "$(toViewDir)/$(toViewFile).ffs" }]
#
-----------------------------------------------------------------------------
Tcl2 namespace eval vis { variable isOk 0 }
; \
proc vis::setOk {} { set ::vis::isOk 1 }
; \
proc vis::runViewer {f} {
; \
if $::vis::isOk { eval exec fmeview.exe /ownffs $f & } ; } ;
#
=============================================================================
FACTORY_DEF * RecorderFactory
\
FACTORY_NAME "KMS VisData: Gem til FFS $(VisName)"
\
INPUT FEATURE_TYPE *
\
@Tcl2(vis::setOk)
\
FEATURE_FILE "$(toViewDir)/$(toViewFile).ffs"
\
MODE RECORD_PASS_THROUGH
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
FACTORY_DEF * CreationFactory
\
FACTORY_NAME "KMS VisData: Start FMEVIEW $(VisName)"
\
CREATE_AT_END
\
OUTPUT FEATURE_TYPE kms_dummy
\
@Tcl2("vis::runViewer $(toViewDir)/$(toViewFile).ffs" )
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "KMS VisData: Drop startup dummy $(VisName)"
\
INPUT FEATURE_TYPE kms_dummy
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
#
=============================================================================