FME and LabelEZ – when 1 + 1 = 3
-
Upload
safe-software -
Category
Technology
-
view
308 -
download
1
description
Transcript of FME and LabelEZ – when 1 + 1 = 3
CONNECT. TRANSFORM. AUTOMATE.
MapTextLabeller - when 1 + 1 = 3 Peter Laulund Cand. scient. Specialkonsulent
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
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.
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
Rule based label creation
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
Label workspace
Demo
System architecture
Job_view
Log
Label
Matrikel
BATCH.fmw
LABEL.fmw
Log2Html.fmw Log2day.html
FMEServer Oracle
Workspace – batch
select SEQ_LBZ_JOBID.NEXTVAL "JobId" , a.* from job_label a
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
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
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
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
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 ) .....
Log rapport
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
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' ), ..
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
FME + Label-EZ = 1 + 1 = 3
Thank You!
! Questions?
! For more information: ! Peter Laulund, [email protected] ! Geodatastyrelsen - The Danish Geodata Agency
! Safe blog ! Webinar
CONNECT. TRANSFORM. AUTOMATE.