Hi
a bit off tcl will do the trick, look at the attatched mapping file and tcl
script
you shoud be able to use the tcl function via the TCL Caller
peter
>From: "mark2atsafe" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: [fme] Re: Any way to assign list histogram results as new
>attributes/headings?
>Date: Thu, 31 May 2007 22:27:07 -0000
>
>Hi Steve,
>I've just put the workspace up there as a zip file. Sometimes web
>browsers try to interpret fmw's a little too literally since the
>content is XML based.
>
>I think you should be in luck. The FMEFunctionCaller is a sort of
>roundabout fix because 2007 won't let you use a function within the
>AttributeCopier. 2006GB should let you do that. So replace the
>FunctionCaller with an AttributeCopier and where the function is...
>
>@CopyAttributes(@Value([EMAIL PROTECTED](_loopCount)}.value),[EMAIL
>PROTECTED](_loopCount)}.count)
>
>In the AttributeCopier use...
>
>@Value([EMAIL PROTECTED](_loopCount)}.value
>
>...for the attribute to create and...
>
>[EMAIL PROTECTED](_loopCount)}.count
>
>...as the value for the attribute.
>
>Hope this works!
>
>Mark
>
>--- In [email protected], "snelsons2006" <[EMAIL PROTECTED]> wrote:
> >
> > Damn, looks like I'm outta luck as the FMEFunctionCaller was
> > introduced in build 4133 - I'm stuck way back in build 2651 for
> > 2006GB! Our IT dept won't let me update either.
> >
> > Mark - For some reason all the example FMWs posted here <
> > http://www.fmepedia.com/index.php/Sandbox > , I can't download them,
> > get an xml error. But the data in the .zip file is fine..?
> >
> > Thanks for taking the time to put together the fmw, very interested in
> > seeing how it all works!
> >
> > Steve
> >
>
>
_________________________________________________________________
Få 250 MB gratis lagerplads på MSN Hotmail: http://www.hotmail.com
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.
Love FME? Then open your diary to March 6-7, 2008 and write this... "Second
Worldwide FME User Conference - Must Attend!" See
http://www.safe.com/company/fmeuc2008/index.php for more details.
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)"
Tcl2 source test.tcl
#
=============================================================================
FACTORY_DEF * CreationFactory
\
FACTORY_NAME "Opret dummy feature"
\
2D_GEOMETRY 718447 6171283
\
NUMBER_TO_CREATE 1
\
OUTPUT FEATURE_TYPE *
\
@SupplyAttributes(_DEP_histogram{0}.count, 78 )
\
@SupplyAttributes(_DEP_histogram{0}.value, OnTime )
\
@SupplyAttributes(_DEP_histogram{1}.count,9 )
\
@SupplyAttributes(_DEP_histogram{1}.value, LeaveEarly )
\
@SupplyAttributes(_DEP_histogram{2}.count, 7 )
\
@SupplyAttributes(_DEP_histogram{2}.value , LeaveVeryLate )
\
@SupplyAttributes(_DEP_histogram{3}.count: 3 )
\
@SupplyAttributes(_DEP_histogram{3}.value , LeaveLate )
\
@SupplyAttributes(_DEP_histogram{4}.count, 1 )
\
@SupplyAttributes(_DEP_histogram{4}.value, LeaveVeryEarly )
\
@Log()
FACTORY_DEF * TeeFactory
\
FACTORY_NAME "_factory_name_"
\
INPUT FEATURE_TYPE *
\
@Tcl2("list2attr _DEP_histogram")
\
OUTPUT FEATURE_TYPE *
\
@Log()
#
=============================================================================
#FME_BEGIN_TCL source $(mfRoot)/test.tcl ; puts \"Hello World\"
#FME_END_TCL test
#
=============================================================================
INPUT *
OUTPUT *
#
-----------------------------------------------------------------------------
#
=============================================================================
set comment {
===============================================================================
Navn : Peter Laulund, KMS
Oprettet dato : 31 maj 2006 - 14:29
Beskrivelse :
===============================================================================}
#
=============================================================================
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
proc list2attr {l} {
set N [ FME_Execute NumElements $l ]
for { set i 0 } { $i < $N } { incr i } {
FME_SetAttribute [ FME_GetAttribute $l{$i}.value ] [
FME_GetAttribute $l{$i}.count ]
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
#
=============================================================================