@Reproject

@Reproject(<sourceCS>,<destCS>[,COORDINATES_ONLY][,<rasterInterpolationType>][,<rasterCellSize>])

or

@Reproject(<reprojectionEngine>,<sourceCS>,<destCS>[,<param1>[,<param2>...]],--[,COORDINATES_ONLY][,<rasterInterpolationType>][,<rasterCellSize>])

or

@Reproject(<sourceCS>,<destCS>,<xFieldName>,<yFieldName>)

or

@Reproject(<reprojectionEngine>,<sourceCS>,<destCS>[,<param1>[,<param2>...]],--,<xFieldName>,<yFieldName>)

Function Type: Feature

Arguments:

Name

Range

Description

Optional

<sourceCS>

Coordinate System Name

The name of the source coordinate system.

No

<destCS>

Coordinate System Name

The name of the destination coordinate system.

No

<reprojectionEngine>

FME, ESRI, GTRANS

The reprojection engine to use when reprojecting coordinates.

Yes

<param1>

Varies based on reprojection engine

For the ESRI reprojection engine, this is the optional geotransformation name.

 

For the GTRANS reprojection engine, this is the translation file path.

Yes

<param2>

Varies based on reprojection engine

For the ESRI reprojection engine, this is the geotransformation direction (either "forward" or "reverse").

 

For the GTRANS reprojection engine, this is the inverse translation file path.

Yes

<rasterCellSize>

SquareCells, StretchCells, PreserveCells

For raster reprojection, determines how the cell size of the output raster will be calculated. See the Reprojector transformer help text.

Yes

<rasterInterpolationType>

NEARESTNEIGHBOR, BILINEAR, BICUBIC, AVERAGE4, AVERAGE16

For raster reprojection, determines how each cell is interpolated. See the Reprojector transformer help text.

Yes

<xFieldName>

Attribute Name

The name of the attribute containing the x coordinate value.

Yes

<yFieldName>

Attribute Name

The name of the attribute containing the y coordinate value.

Yes

Description

The @Reproject function is only required in rare cases during FME translations. The recommended approach to performing coordinate conversions is to use the <readerKeyword>_COORDINATE_SYSTEM and <writerKeyword>_ COORDINATE_SYSTEM. Search Coordinate System Support in the FME Universal Translator on-line help.

This function provides direct access to the FME’s coordinate conversion capabilities. With this function, feature coordinates may be converted from one coordinate system to another during data translation.

When executed in the forward direction on the destination line of a feature correlation or on an INPUT or OUTPUT clause of a factory definition, the coordinate conversion operation is performed in the forward direction. In this case, coordinates are converted from the source coordinate system to the destination coordinate system.

If xFieldName and yFieldName are specified, then a single point coordinate conversion will be performed on the values of these attributes. The resulting new coordinates will be stored back into these same attributes. In this case, the feature’s geometry coordinates are left untouched.

The field name parameters are usually used to convert the coordinates of an inside point, often stored as an attribute of a polygonal feature.

When xFieldName and yFieldName are not specified, the coordinate conversions are performed on the geometry of the feature. This is the usual mode of operation. In this mode, if the input features have a coordinate system defined, that system is used as the source of the reprojection, and the sourceCS parameter is ignored (destCS in the case of inverse operation).

Reprojection of arcs, ellipses, and text is handled differently based on whether the input features are represented with classic or enhanced geometry. For classic geometry, FME performs additional operations just prior to reprojecting the feature. These operations typically include stroking arcs and ellipses (converting them to lines and polygons), and may be skipped by specifying the COORDINATES_ONLY flag. With the COORDINATES_ONLY flag, only the center points of classic arcs and ellipses are reprojected. For enhanced geometry, the additional operations and COORDINATES_ONLY flag do not apply. All of the relevant control points and properties of arcs, ellipses, and text are reprojected. Arcs and ellipses are only stroked when maintaining them as arcs and ellipses would introduce significant distortion.

interpolationType only has an effect on raster.

NearestNeighbor is the fastest but produces the poorest image quality. Bicubic is the slowest but produces the best image quality. Bilinear provides a reasonable intermediate option. Average4 and Average16 have a performance similar to Average4 and can be useful for numeric rasters such as DEMs.

rasterCellSize also only applies to raster features. If it is set to StretchCells, the cell size of the raster will be adjusted to maintain the same number of rows and columns in the reprojected raster as there were in the input raster. If it is set to SquareCells, the number of rows and columns as well as the spacing will be changed to maintain approximately the same cell ground area and form square cells where the horizontal and vertical cell sizes are equal. Like the SquareCells option, PreserveCells will change both the number of rows and columns and the spacing to maintain cell ground area, but will also try to preserve the original cell aspect ratio, taking into account any warping caused by the reprojection.

Note: If the source coordinate system is not fixed and may change from feature to feature, and the features themselves have been tagged with a coordinate system from the reader that produced them, then a single Reprojector may still be able to be used. In such a case, both the source and destination coordinate system can be set to the same value – the destination coordinate system – and the desired behavior will be accomplished.

This function is currently unaffected by raster and/or palette sub-selection.

Inverse Operation

When executed in the reverse direction source line of a feature correlation, the coordinate conversion operation converts coordinates from the destination coordinate system to the source coordinate system.

Example

In the example below, the correlation line is used to convert the Design features from UTM zone 10 based on NAD27 datum to lat/long coordinates based on NAD83 datum, for only the road features in the data set.

# Specify the correlation lines from IGDS to SHAPE.

# The Reproject command is placed on the SHAPE line.

# When converting data from IGDS to SHAPE the

# coordinates are converted from UTM zone 10 based on

# NAD 27 to Lat/Long coordinates based on NAD 83. When

# converting data from SHAPE to IGDS the coordinates

# are converted from Lat/Long coordinates (NAD83) to

# UTM zone 10 (NAD 27).

 

IGDS 23 igds_type igds_line

SHAPE roads @Reproject(UTM27-10, LL83)

The second example illustrates how to use the coordinate conversions to change coordinate values stored as attributes of a feature. When translating from SAIF to Shape, the coordinate geometry is translated as in the previous example. The features also have inside point coordinates stored in the attributes insideX and insideY which must also be translated. These are done using a second @Reproject command invocation.

SAIF Lake::MOF insideX %x insideY %y

SHAPE lake insideX %x insideY %y \

@Reproject(UTM27-10, LL83) \

@Reproject(UTM27-10, LL83, insideX, insideY)

The third example takes a raster image in UTM84-17N and reprojects it to LL. The interpolationType is set to Bicubic to get the most accurate result, and the rasterCellSize is set to StretchCells to get an output raster with the same number of rows and columns as the input raster.

GEOTIFF utm @Reproject(UTM84-17N, LL, NearestNeighbor, StretchCells)