#! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! #! GUI IGNORE SourceDataset_JPEG_1 DEFAULT_MACRO SourceDataset_JPEG $(FME_MF_DIR)capitolEdited.jpg GUI MULTIFILE SourceDataset_JPEG JPEG_Files(*.jpg)|*.jpg|All_Files(*.*)|*.* Original JPEG Dataset: INCLUDE [ if {{$(SourceDataset_JPEG)} == {}} { puts_real {Parameter SourceDataset_JPEG must be given a value on the commandline.}; exit 1; }; ] #! START_HEADER #! WORKSPACE_VERSION 1 # ============================================================================ # # This mapping file was generated by FME Workbench # on 10/03/07 22:14:39 for translation between JPEG and GEOTIFF # # This workspace was generated with FME build 5095 # # You may edit this mapping file to customize its operation. Comments are # placed throughout to assist you. # # Modification History: # # Name Date Description # ================= ======== ============================================= # # # ============================================================================ # ============================================================================ # The following line defines the title presented to the user when this # mapping file is run through the FME GUI. You may modify this # if a more meaningful title would be appropriate. GUI TITLE JPEG to GEOTIFF Translation # ============================================================================ # The following line names the log file to which useful statistics about # the translation will be written. This line can be uncommented and # updated if you do wish to keep these statistics. # LOG_FILENAME translation.log # LOG_APPEND NO # ============================================================================ # The following line instructs the FME to log any features that do not # match any of the source feature patterns listed further down in # this file. If you are modifying this mapping file, this will be # useful to describe to you exactly which features you are losing # during translation, if the statistics indicate that features are # not being correlated or grouped. Uncorrelated features do not # match any source specification, ungrouped features do not have # any corresponding _DEF line. # FME_DEBUG UNGROUPED UNCORRELATED # ============================================================================ # The following two lines define the type of reader and writer to be # used for this translation. If you want to translate your data # back into its original format, you may make a copy of this file # and switch the reader and writer types. If you rerun the FME, you # will get your original data back again (together with any modifications # you made in the meantime). Note that several formats are NOT # bi-directional (for example, GIF can only be used as a WRITER) # so a reverse translation may not always be possible. #! START_WB_HEADER READER_TYPE JPEG READER_KEYWORD JPEG_1 WRITER_TYPE NULL WRITER_KEYWORD NULL_DEST NULL_DEST_DATASET null #! END_WB_HEADER #! START_WB_HEADER MACRO WB_KEYWORD "JPEG_1" #! END_WB_HEADER #! START_SOURCE_HEADER JPEG JPEG_1 DEFAULT_MACRO GROUP_BY_DATASET_JPEG_1 No JPEG_1_GROUP_BY_DATASET "$(GROUP_BY_DATASET_JPEG_1)" # ======================================================================= # The following GUI line prompts for a file to be used as the source JPEG file. # The user input is stored in a macro, which is then used to define # the dataset to be read. # The dataset this mapping file was generated from was: GUI FILENAME SourceDataset_JPEG_1 JPEG_Files(*.jpg)|*.jpg|All_Files(*.*)|*.* Original JPEG Dataset: JPEG_1_READER_META_ATTRIBUTES fme_dataset fme_basename #! END_SOURCE_HEADER #! START_WB_HEADER DEFAULT_MACRO SourceDataset INCLUDE [ if {"$(SourceDataset)" != ""} { \ puts {DEFAULT_MACRO SourceDataset_JPEG_1 $(SourceDataset)} \ } ] #! END_WB_HEADER #! START_SOURCE_HEADER JPEG JPEG_1 DEFAULT_MACRO SourceDataset_JPEG_1 $(SourceDataset_JPEG) JPEG_1_DATASET "$(SourceDataset_JPEG_1)" #! END_SOURCE_HEADER #! END_HEADER LOG_FILENAME "$(FME_MF_DIR)ContoursFromRasters.log" LOG_APPEND NO LOG_MAX_FEATURES 200 LOG_MAX_RECORDED_FEATURES 200 FME_CACHED_OBJECTS_HINT 7500 FME_REPROJECTION_ENGINE FME FME_USE_RICH_GEOMETRY yes DEFAULT_MACRO DATASET_KEYWORD_JPEG_1 JPEG_1 # ------------------------------------------------------------------------- JPEG_1_READER_META_ATTRIBUTES fme_basename fme_feature_type # ------------------------------------------------------------------------- MULTI_READER_CONTINUE_ON_READER_FAILURE No # ------------------------------------------------------------------------- MACRO WORKSPACE_NAME ContoursFromRasters # ------------------------------------------------------------------------- JPEG_1_DEF JPEG # ------------------------------------------------------------------------- Lookup ___KnownFeatureTypes___ JPEG yes "" no # ------------------------------------------------------------------------- FACTORY_DEF * TestFactory FACTORY_NAME "Unexpected Input Remover" INPUT FEATURE_TYPE * TEST @Lookup(___KnownFeatureTypes___,@FeatureType()) == yes OUTPUT PASSED FEATURE_TYPE * # ------------------------------------------------------------------------- FACTORY_DEF * TeeFactory FACTORY_NAME "Source -> Generic" INPUT FEATURE_TYPE * OUTPUT FEATURE_TYPE * @Transform(JPEG,FME_GENERIC,PRESERVE_GEOMETRY) DEFAULT_MACRO WB_CURRENT_CONTEXT # ------------------------------------------------------------------------- FACTORY_DEF * SurfaceModelFactory FACTORY_NAME SurfaceModeller INPUT POINTS FEATURE_TYPE JPEG TOLERANCE 5 SAMPLE_SPACING 1 1 NODATA_VALUE -32767.0 DRAPE_TYPE VERTEX INTERPOLATION_TYPE PLANAR CONTOUR_DIMENSION 3 CONTOUR_INTERVAL 20 MAXIMUM_EDGE_CALC_LENGTH 0.0 OUTPUT CONTOURS FEATURE_TYPE SurfaceModeller_CONTOURS @RenameAttributes(_elevation,SurfaceModel.elevation) FACTORY_DEF * TeeFactory FACTORY_NAME "SurfaceModeller CONTOURS Splitter" INPUT FEATURE_TYPE SurfaceModeller_CONTOURS OUTPUT FEATURE_TYPE SurfaceModeller_CONTOURS_0 OUTPUT FEATURE_TYPE SurfaceModeller_CONTOURS_1 # ------------------------------------------------------------------------- FACTORY_DEF * TeeFactory FACTORY_NAME ExpressionEvaluator INPUT FEATURE_TYPE SurfaceModeller_CONTOURS_1 OUTPUT FEATURE_TYPE ExpressionEvaluator_OUTPUT fme_color @Evaluate("@Value(_elevation)/255.0") # ------------------------------------------------------------------------- Tcl2 set {Concatenator_valList} [split &fme_color,,&fme_color,,&fme_color ,]; # We use TCL here instead of @Concatenate because TCL is more flexible. Tcl2 proc Concatenator_concatter {} { global {Concatenator_valList}; set val {}; foreach {valEnc} [set {Concatenator_valList}] { append val [FME_DecodeTextOrAttr $valEnc]; }; FME_SetAttribute {fme_color} $val; } FACTORY_DEF * TeeFactory FACTORY_NAME Concatenator INPUT FEATURE_TYPE ExpressionEvaluator_OUTPUT OUTPUT FEATURE_TYPE Concatenator_OUTPUT @Tcl2(Concatenator_concatter) # ------------------------------------------------------------------------- # Set the directive to add all the meta-attributes to the features. # We do this so users see all possible information in the viewed # features. READER_META_ATTRIBUTES fme_feature_type fme_dataset fme_basename # First, set up the temporary directory that will be used for # the recordings we will be viewing (these three lines do this) # They assume that the WORKSPACE_NAME macro has already been set DEFAULT_MACRO WORKSPACE_TEMP_DIR INCLUDE [ if {[string length {$(WORKSPACE_TEMP_DIR)}] < 2} { if {[info exists env(TEMP)]} {set gVisualizerTemp $env(TEMP)} else {set gVisualizerTemp c:} ; regsub -all {[ ,]} {$(WORKSPACE_NAME)} {_} wsname; set gVisualizerTemp $gVisualizerTemp\\${wsname}_[clock format [clock seconds] -format %H%M%S] ; puts "MACRO WORKSPACE_TEMP_DIR $gVisualizerTemp"; } ; if { [string length {}] > 0 } { set catter "" ; set comma "" ; foreach attr "" { set catter "$catter$comma&$attr" ; set comma ",_," ; } ; puts "MACRO CATMAC _@Concatenate($catter)" ; } else { puts "MACRO CATMAC " ; }; set safeName "[regsub -all {[^a-zA-Z0-9]} {ContourLines} _]_[expr round(rand() * 1000000)]_[clock clicks]"; puts "MACRO SAFE_FFS_NAME $safeName"; ] # Make the temporary directory that the FFS files will live in. FACTORY_DEF * CreationFactory FACTORY_NAME ContourLines_DirCreator OUTPUT FEATURE_TYPE __nukeme__ @Tcl2("catch {file mkdir {$(WORKSPACE_TEMP_DIR)}}") FACTORY_DEF * TeeFactory FACTORY_NAME ContourLines_DirCreatorCleanerUpper INPUT FEATURE_TYPE __nukeme__ # Now route all the features into the recorder, changing their # feature type to the transformer name so that they view nicely FACTORY_DEF * TeeFactory FACTORY_NAME ContourLines_SetterUpper INPUT FEATURE_TYPE Concatenator_OUTPUT OUTPUT FEATURE_TYPE __viewme__ FACTORY_DEF * RecorderFactory FACTORY_NAME ContourLines_Recorder INPUT FEATURE_TYPE __viewme__ @FeatureType(ContourLines$(CATMAC)) FEATURE_FILE "$(WORKSPACE_TEMP_DIR)/$(SAFE_FFS_NAME).ffs" MODE RECORD_PASS_THROUGH FACTORY_DEF * CreationFactory FACTORY_NAME ContourLines_Trigger CREATE_AT_END OUTPUT FEATURE_TYPE __nukeme__ @TCL("lappend gVisualizerFilesToView $(SAFE_FFS_NAME)") FACTORY_DEF * TeeFactory FACTORY_NAME ContourLines_CleanerUpper INPUT FEATURE_TYPE __nukeme__ # ------------------------------------------------------------------------- FACTORY_DEF * PolygonFactory FACTORY_NAME PolygonBuilder GROUP_BY _elevation INPUT FEATURE_TYPE SurfaceModeller_CONTOURS_0 END_NODED REPORT_PROGRESS OUTPUT POLYGON FEATURE_TYPE PolygonBuilder_POLYGON # ------------------------------------------------------------------------- FACTORY_DEF * TeeFactory FACTORY_NAME AreaCalculator INPUT FEATURE_TYPE PolygonBuilder_POLYGON OUTPUT FEATURE_TYPE AreaCalculator_OUTPUT _area @Area(1) # ------------------------------------------------------------------------- FACTORY_DEF * SortFactory FACTORY_NAME Sorter INPUT FEATURE_TYPE AreaCalculator_OUTPUT SORT_BY _area NUMERIC ASCENDING OUTPUT SORTED FEATURE_TYPE Sorter_SORTED # ------------------------------------------------------------------------- FACTORY_DEF * TeeFactory FACTORY_NAME ExpressionEvaluator_2 INPUT FEATURE_TYPE Sorter_SORTED OUTPUT FEATURE_TYPE ExpressionEvaluator_2_OUTPUT fme_color @Evaluate("@Value(_elevation)/255.0") # ------------------------------------------------------------------------- Tcl2 set {Concatenator_2_valList} [split &fme_color,,&fme_color,,&fme_color ,]; # We use TCL here instead of @Concatenate because TCL is more flexible. Tcl2 proc Concatenator_2_concatter {} { global {Concatenator_2_valList}; set val {}; foreach {valEnc} [set {Concatenator_2_valList}] { append val [FME_DecodeTextOrAttr $valEnc]; }; FME_SetAttribute {fme_color} $val; } FACTORY_DEF * TeeFactory FACTORY_NAME Concatenator_2 INPUT FEATURE_TYPE ExpressionEvaluator_2_OUTPUT OUTPUT FEATURE_TYPE Concatenator_2_OUTPUT @Tcl2(Concatenator_2_concatter) # ------------------------------------------------------------------------- FACTORY_DEF * TeeFactory FACTORY_NAME AttributeCopier INPUT FEATURE_TYPE Concatenator_2_OUTPUT OUTPUT FEATURE_TYPE AttributeCopier_OUTPUT @CopyAttributes(fme_fill_color,fme_color) # ------------------------------------------------------------------------- # Set the directive to add all the meta-attributes to the features. # We do this so users see all possible information in the viewed # features. READER_META_ATTRIBUTES fme_feature_type fme_dataset fme_basename # First, set up the temporary directory that will be used for # the recordings we will be viewing (these three lines do this) # They assume that the WORKSPACE_NAME macro has already been set DEFAULT_MACRO WORKSPACE_TEMP_DIR INCLUDE [ if {[string length {$(WORKSPACE_TEMP_DIR)}] < 2} { if {[info exists env(TEMP)]} {set gVisualizerTemp $env(TEMP)} else {set gVisualizerTemp c:} ; regsub -all {[ ,]} {$(WORKSPACE_NAME)} {_} wsname; set gVisualizerTemp $gVisualizerTemp\\${wsname}_[clock format [clock seconds] -format %H%M%S] ; puts "MACRO WORKSPACE_TEMP_DIR $gVisualizerTemp"; } ; if { [string length {}] > 0 } { set catter "" ; set comma "" ; foreach attr "" { set catter "$catter$comma&$attr" ; set comma ",_," ; } ; puts "MACRO CATMAC _@Concatenate($catter)" ; } else { puts "MACRO CATMAC " ; }; set safeName "[regsub -all {[^a-zA-Z0-9]} {ContourPolygons} _]_[expr round(rand() * 1000000)]_[clock clicks]"; puts "MACRO SAFE_FFS_NAME $safeName"; ] # Make the temporary directory that the FFS files will live in. FACTORY_DEF * CreationFactory FACTORY_NAME ContourPolygons_DirCreator OUTPUT FEATURE_TYPE __nukeme__ @Tcl2("catch {file mkdir {$(WORKSPACE_TEMP_DIR)}}") FACTORY_DEF * TeeFactory FACTORY_NAME ContourPolygons_DirCreatorCleanerUpper INPUT FEATURE_TYPE __nukeme__ # Now route all the features into the recorder, changing their # feature type to the transformer name so that they view nicely FACTORY_DEF * TeeFactory FACTORY_NAME ContourPolygons_SetterUpper INPUT FEATURE_TYPE AttributeCopier_OUTPUT OUTPUT FEATURE_TYPE __viewme__ FACTORY_DEF * RecorderFactory FACTORY_NAME ContourPolygons_Recorder INPUT FEATURE_TYPE __viewme__ @FeatureType(ContourPolygons$(CATMAC)) FEATURE_FILE "$(WORKSPACE_TEMP_DIR)/$(SAFE_FFS_NAME).ffs" MODE RECORD_PASS_THROUGH FACTORY_DEF * CreationFactory FACTORY_NAME ContourPolygons_Trigger CREATE_AT_END OUTPUT FEATURE_TYPE __nukeme__ @TCL("lappend gVisualizerFilesToView $(SAFE_FFS_NAME)") FACTORY_DEF * TeeFactory FACTORY_NAME ContourPolygons_CleanerUpper INPUT FEATURE_TYPE __nukeme__ # ------------------------------------------------------------------------- FACTORY_DEF * TestFactory FACTORY_NAME "Final Output Feature Type Router" INPUT FEATURE_TYPE * TEST @Value(__wb_out_feat_type__) != "" OUTPUT PASSED FEATURE_TYPE * @FeatureType(@Value(__wb_out_feat_type__)) # ------------------------------------------------------------------------- DEFAULT_MACRO WORKSPACE_TEMP_DIR INCLUDE [ if {{$(WORKSPACE_TEMP_DIR)} == {}} { puts {MACRO __WB_ENABLE_VISUALIZER__ no} } else { puts {MACRO __WB_ENABLE_VISUALIZER__ *} } ] FACTORY_DEF $(__WB_ENABLE_VISUALIZER__) CreationFactory CREATE_AT_END OUTPUT FEATURE_TYPE __NUKEME__ @TCL("eval FME_Execute System \173fmeview /ownffs {$(WORKSPACE_TEMP_DIR)} $gVisualizerFilesToView & }") FACTORY_DEF * TeeFactory INPUT FEATURE_TYPE __NUKEME__