Hi

as pointet out in my mail yesteday I was not satisfied with to code i send, 
attatched is an new version adressing some of the issues

Peter


>From: "Ron Cook" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: <[email protected]>
>Subject: [fme] Sorting for PointConnector
>Date: Sun, 13 Nov 2005 18:15:08 -0700
>
>Hello,
>
>I am trying to create lines using the pointconnector operator in workbench.
>Each row of data refers to a NEXT_POINT(char) and a PREV_POINT(char)
>The first point has a PREV_POINT values of A and the last point has a
>NEXT_POINT value of Z. A unique line is define by the combination of
>TYP,ST_ID and JOB_NUM How do I sort the rows so that they are in the 
>correct
>order for the pointconnector? Any ideas would be greatly appreciated.
>
>
>TYP,ST_ID,PNT_ID,JOB_NUM,MEAS_ACC,NORTHING,EASTING,NEXT_POINT,PREV_POINT
>MM,0002,-4230-75,030932,1,63212.74,458589.08,-4138-33,-4138-32
>MM,0002,-4138-33,030932,1,63212.40,458579.29,-4138-34,-4230-75
>MM,0002,-4138-34,030932,1,63211.97,458581.98,-4138-35,-4138-33
>MM,0002,-4138-35,030932,1,63211.89,458565.12,-4138-36,-4138-34
>MM,0002,-4138-36,030932,1,63211.74,458553.82,-4138-37,-4138-35
>MM,0002,-4138-37,030932,1,63211.22,458554.15,-4138-38,-4138-36
>MM,0002,-4138-38,030932,1,63211.56,458564.37,-4138-39,-4138-37
>MM,0002,-4138-39,030932,1,63211.49,458567.05,-4138-8,-4138-38
>MM,0002,-4138-32,030932,1,63212.16,458588.87,-4230-75,A
>MM,0002,-4138-8,030932,1,63211.05,458577.80,Z,-4138-39
>
>
>Thank you
>
>Ron Cook B.Sc.
>Geo-Innovations Inc
>11713 10a Avenue
>Edmonton AB
>T6J 7A7
>(780) 951-0050
>
>
>
>
>
>
>Get the maximum benefit from your FME, FME Objects, or SpatialDirect via 
>our Professional Services team.  Visit www.safe.com/services for details.
>Yahoo! Groups Links
>
>
>
>
>
>

_________________________________________________________________
Find alt det, du søger på MSN Søg http://search.msn.dk


Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our 
Professional Services team.  Visit www.safe.com/services for details. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/fme/

<*> 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/
 
TYP,ST_ID,PNT_ID,JOB_NUM,MEAS_ACC,NORTHING,EASTING,NEXT_POINT,PREV_POINT
MM,0002,-4230-75,030932,1,63212.74,458589.08,-4138-33,-4138-32
MM,0002,-4138-33,030932,1,63212.40,458579.29,-4138-34,-4230-75
MM,0002,-4138-34,030932,1,63211.97,458581.98,-4138-35,-4138-33
MM,0002,-4138-35,030932,1,63211.89,458565.12,-4138-36,-4138-34
MM,0002,-4138-36,030932,1,63211.74,458553.82,-4138-37,-4138-35
MM,0002,-4138-37,030932,1,63211.22,458554.15,-4138-38,-4138-36
MM,0002,-4138-38,030932,1,63211.56,458564.37,-4138-39,-4138-37
MM,0002,-4138-39,030932,1,63211.49,458567.05,-4138-8,-4138-38
MM,0002,-4138-32,030932,1,63212.16,458588.87,-4230-75,A
MM,0002,-4138-8,030932,1,63211.05,458577.80,Z,-4138-39
/* ============================================================================

  Navn          : Peter Laulund, KMS

  Oprettet dato : 16 november 2005 - 10:01

  Beskrivelse   :

  Problemer     :


============================================================================*/

# INIT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MAPPING_FILE_ID "Version 1.0, 16 november 2005"

#LOG_FILENAME  $(FME_MF_DIR)TEST.LOG
LOG_APPEND    no

#FME_DEBUG MAPPING_FILE

# MACRO- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DEFAULT_MACRO SourceFormat    TEXTLINE
DEFAULT_MACRO DestFormat      FFS

DEFAULT_MACRO SourceDataset   $(FME_MF_DIR)data.txt
DEFAULT_MACRO DestDataset     ${FME_TEMP}\csv.ffs

DEFAULT_MACRO SourceCoordSys
DEFAULT_MACRO DestCoordSys
DEFAULT_MACRO Dim             2D

READER_META_ATTRIBUTES    fme_feature_type fme_dataset fme_basename

# DATA DEF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
READER_TYPE               $(SourceFormat)
READER_KEYWORD            INPUT
INPUT_DATASET            "$(SourceDataset)"
#INPUT_COORDINATE_SYSTEM   $(SourceCoordSys)

WRITER_TYPE               $(DestFormat)
WRITER_KEYWORD            OUTPUT
OUTPUT_DATASET           "$(DestDataset)"
#OUTPUT_COORDINATE_SYSTEM  $(DestCoordSys)

# =============================================================================
Tcl2 source $(FME_MF_DIR_UNIX)/csv.tcl

# ============================================================================= FACTORY_DEF * SortFactory \ FACTORY_NAME "CSV: Input Transformer and init array" \ INPUT FEATURE_TYPE * \ @Tcl2( initFeature ) \ OUTPUT SORTED FEATURE_TYPE * \ @SupplyAttributes(Finalfeature, @FeatureType()) \
     @Log("Input logger", 3, 0)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACTORY_DEF * TeeFactory \ FACTORY_NAME "CSV: Drop header" \
  INPUT  FEATURE_TYPE csvHeader

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACTORY_DEF * SortFactory \ FACTORY_NAME "CSV: Featur sorter" \ INPUT FEATURE_TYPE * \ @Tcl2(getSortID) \ SORT_BY sortOrder NUMERIC ASCENDING \
  OUTPUT SORTED FEATURE_TYPE *

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACTORY_DEF * ConnectionFactory \ FACTORY_NAME "CSV: Connect points to line" \ INPUT FEATURE_TYPE * \ BREAK_BEFORE_FIELD_CHANGE featId \ FEATURE_CONNECTION ORDERED \ OUTPUT POINT FEATURE_TYPE * \ OUTPUT LINE FEATURE_TYPE * \
    @SupplyAttributes(FinalFeature, csvLine)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACTORY_DEF * TeeFactory \ FACTORY_NAME "CSV: Output Transformer" \ INPUT FEATURE_TYPE * \ @FeatureType(&FinalFeature) \ OUTPUT FEATURE_TYPE * \ @Transform(FME_GENERIC, $(DestFormat)) \ @KeepAttributes(fme_type, fme_geometry,TYP,ST_ID,JOB_NUM,MEAS_ACC) \
     @Log("Output logger", 3, 1)

# =============================================================================
INPUT *

OUTPUT *

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # =============================================================================

Attachment: csv.tcl
Description: Binary data

Reply via email to