FME and LabelEZ – when 1 + 1 = 3

21
CONNECT. TRANSFORM. AUTOMATE. MapTextLabeller - when 1 + 1 = 3 Peter Laulund Cand. scient. Specialkonsulent

description

Focused on the use of the new LabelEZFactory to label cadastral maps on a daily basis where changes to the map are detected. The labels are stored in an Oracle database and used when distributing cadastral maps as GIS data. See more presentations from the FME User Conference 2014 at: www.safe.com/fmeuc

Transcript of FME and LabelEZ – when 1 + 1 = 3

Page 1: FME and LabelEZ – when 1 + 1 = 3

CONNECT. TRANSFORM. AUTOMATE.

MapTextLabeller - when 1 + 1 = 3 Peter Laulund Cand. scient. Specialkonsulent

Page 2: FME and LabelEZ – when 1 + 1 = 3

Who am I

!  Peter Laulund !  Certified FME professional !  Works at Geodatastyrelsen !  Working with FME since 1997 and with

SpatialDirect / FMEServer since 2000 !  Recent Projects

!  GST Data distribution system !  GST INSPIRE data to GML !  Labeling our cadaster with MapTextLabeller

Page 3: FME and LabelEZ – when 1 + 1 = 3

Background

!  In 2008 we got a new Cadastral system !  This system has no cartographic labels !  To create labels for this system, MapText

developed an integration between Label-EZ and FME

!  With FME 2013 this was integrated into standard FME as an extra cost plugin, the MapTextLabeller

!  With this transformer we now have intelligent rule based labelling in FME

CONNECT. TRANSFORM. AUTOMATE.

Page 4: FME and LabelEZ – when 1 + 1 = 3

Cadastral dataset

!  2.4 mill. parcels !  45 mill. features in 30 feature types !  3.8 mill. labels !  9033 districts – Ejerlav in Danish !  Changes in 20 to 100 districts per day !  Data are free !  Available in 10 formats and a number of

projections

Page 5: FME and LabelEZ – when 1 + 1 = 3

Rule based label creation

Page 6: FME and LabelEZ – when 1 + 1 = 3

MapTextLabeller - Features

!  Place label inside or parallel to feature !  Rotate and / or scale to fit inside !  Place outside with leader line !  Split on multiple lines !  Handel conflicts !  Add style – font and color

Page 7: FME and LabelEZ – when 1 + 1 = 3

Label workspace

Page 8: FME and LabelEZ – when 1 + 1 = 3

Demo

Page 9: FME and LabelEZ – when 1 + 1 = 3

System architecture

Job_view

Log

Label

Matrikel

BATCH.fmw

LABEL.fmw

Log2Html.fmw Log2day.html

FMEServer Oracle

Page 10: FME and LabelEZ – when 1 + 1 = 3

Workspace – batch

select SEQ_LBZ_JOBID.NEXTVAL "JobId" , a.* from job_label a

Page 11: FME and LabelEZ – when 1 + 1 = 3

JOB View – Pseudo sql

create view JOB_LABEL as Select ejerlav from ( select ejerlav , jordstykke.from_time as j_from_time , nvl(label.from_time, ‘17530501’) as l_from_time from jordstykke left join label (on jordstykke.id = label.id ) group by ejerlav ) where j_from_time > l_from_time

Page 12: FME and LabelEZ – when 1 + 1 = 3

Database design

!  In GST we use Oracle as company database !  Tables to label features !  Log and error log table !  Lookup and metadata tables !  Job view to control the daily update !  Sequences and triggers for ‘house keeping’ !  createDb.sql script to create the database

!  Including a cmd script to run it in batch

Page 13: FME and LabelEZ – when 1 + 1 = 3

Database design

!  Oracle has no text feature !  We save the text parameters as string, font, size,

rotation and the geometry as a point !  Reading is done using sql converting text

parameters into fme system attributes, in FME we convert the geometry to a text with TextAdder

!  Different formats handle text differently, we therefore has to scale and offset the text feature depending on the output formats

Page 14: FME and LabelEZ – when 1 + 1 = 3

Database design

MAT_TEKST Feature Id JobId Ejerlav Font Font size

MAT_LEADER Geometry

MAT_TEKST_ELEM SubString Rotation Geometry

CADASTRE

FEATURE_CODE

METADATA

FONT

LOG JobId BatchId Ejerlav Time

SEQUENCE BatchId JobId

JOB_LABEL

Page 15: FME and LabelEZ – when 1 + 1 = 3

Reading from the database

SELECT ...... , MTE_SUB_TEKST AS "fme_text_string" , MTE_ROTATION AS "fme_rotation" , MAT_TEXT_SIZE AS "fme_text_size" , MTE_INDSAT_KODE AS "fme_justification" , MTE_COLOR AS "fme_color" , FNT_FONT AS "kms_font" , FNT_BOLD AS "kms_bold" , 'fme_text' AS "kms_type" , MTE_GEOMETRI AS GEOMETRI FROM MAT_TEKST_ELEM JOIN MAT_TEKST ON ( MTE_MAT_ID = MAT_ID AND MAT_TIL_DATO IS NULL ) .....

Page 16: FME and LabelEZ – when 1 + 1 = 3

Log rapport

Page 17: FME and LabelEZ – when 1 + 1 = 3

Design principles

!  Let the database do the job !  Generic workspace

!  Separate logic data and metadata !  Place metadata, initiation, script etc. outside the

workspace !  Control data flow with transformation attributes

rather than feature types !  All jobs is logged to a database

Page 18: FME and LabelEZ – when 1 + 1 = 3

Problems

!  We can still work with the rules !  Where there is many small parcels the labels are

not ok !  Sometime the leader lines points to an incorrect

parcel !  There is an bug in Oracles buffer function

!  ..SDO_BUFFER(geometri, 65 + mod(to_char(sysdate, 'SS' ), ..

Page 19: FME and LabelEZ – when 1 + 1 = 3

Conclusion

!  The system is working and has now been in production for 8 months

!  In general the labels is ok, but we can still improve some of the rules

!  We can label the whole country in 20 hours !  By combining FME and LabelEZ we get best from

both programs

Page 20: FME and LabelEZ – when 1 + 1 = 3

FME + Label-EZ = 1 + 1 = 3

Page 21: FME and LabelEZ – when 1 + 1 = 3

Thank You!

!  Questions?

!  For more information: !  Peter Laulund, [email protected] !  Geodatastyrelsen - The Danish Geodata Agency

!  Safe blog !  Webinar

CONNECT. TRANSFORM. AUTOMATE.