Skip to content

Latest commit

 

History

History
122 lines (90 loc) · 2.75 KB

FME.md

File metadata and controls

122 lines (90 loc) · 2.75 KB

FME

Transformers

Remove geometry dimension

  • Elevation: 2DForcer
  • Measure: MeasureRemover

Convert GeometryCollection to MultiPolygon or MultiLineString

  • GeometryRefiner

Create an unique identifier

  • CRCCalculator

Batch process

Use multiple source datasets

for %%f in (*.ext) do fme <workspace>.fmw --parameter "%%f"

String replacer

Add thousand separator

  • Mode: Replace regular expression
  • Text to replace: (?<=\d)(?=(\d\d\d)+(?!\d))
  • Replacemeent text: '

Python scripts

Check if file exists

import fmeobjects
import os

def processFeature(feature):
    doesFileExist = os.path.exists(feature.getAttribute("path"))
    feature.setAttribute("file_exists", doesFileExist)

Remove accents

import fmeobjects
import unicodedata as ud

def rmdiacritics(char):
    '''
    Return the base character of char, by "removing" any
    diacritics like accents or curls and strokes and the like.
    '''
    desc = ud.name(unicode(char))
    cutoff = desc.find(' WITH ')
    if cutoff != -1:
        desc = desc[:cutoff]
    return ud.lookup(desc)

def removeAccents(feature):
    attribute_list = ("name", "type", "state") # Modify as needed
    for attrib in feature.getAllAttributeNames():
        if attrib in attribute_list:
            value = feature.getAttribute(attrib)
            if value:
                value = unicode(value)
                new_value = ''.join([rmdiacritics(char) for char in value])
                feature.setAttribute(attrib, new_value)

Expressions

Check if attribute is integer

(@Value(attribute) == int(@Value(attribute))) ? 1 : 0

Coordinates systems

Projections

MN03

  • EPSG:21781
  • CH1903 / LV03

MN95

  • EPSG:2056
  • CH1903+ / LV95 (Swiss CH1903+ / LV95)

Transformers

ReframeReprojector

  • FINELTRA (reframereproject.dll)
  • Triangles
  • ~ cm

Reprojector

  • NTv2 (CHENYX06.gsb)
  • Grids
  • ~ dm