Sep. 21-22, 2006 v FME Worldwide User Conference - Vancouver Using FME Objects Python API to Provide Platform Independent Translations Andrew Smith, Lagen.

Slides:



Advertisements
Similar presentations
Publishing GIS Services to ArcGIS for Server
Advertisements

Sep , 2006 v FME Worldwide User Conference - Vancouver FME Translation Customization with Python Tom Weir, Safe Software.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Integrating GIS and CAD Data with the Free FME FDO Provider Dale Lutz VP Development, Safe Software Inc.
Esri UC 2014 | Technical Workshop | Audience Participation URL: goo.gl/tN4Vzq Open in device browser… CAD: The ArcGIS for AutoCAD Plug-in.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
MIS2502: Data Analytics MySQL and SQL Workbench David Schuff
Adding Automated Functionality to Office Applications.
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
Esri International User Conference | San Diego, CA Technical Workshops | Managing and Editing Annotation Natalie Vines Samantha Keehan July 14, 2011.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Editing in ArcMap:
So – You want to learn how to put an advanced article submission (cut and paste) onto the state website. (Note: If you have not done so, you will need.
Managing Data Interoperability with FME Tony Kent Applications Engineer IMGS.
ETL for GIS - What's it all about? 2009 Ohio GIS Conference September 16-18, 2009 Crowne Plaza North Hotel Columbus, Ohio 2009 Ohio GIS Conference September.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
ArcGIS Workflow Manager An Introduction
CSCI 6962: Server-side Design and Programming
Sep , 2006 v FME Worldwide User Conference - Vancouver What’s New in ArcGIS Data Interoperability Extension Kim Avery, ESRI, California, USA, and.
Sep , 2006 v FME Worldwide User Conference - Vancouver Flexible Extraction and Transformation from ArcSDE to AutoCad Ulf Månsson, SWECO Position.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
GIS 1 GIS Lecture 4 Geodatabases. GIS 2 Outline Administrative Data Example Data Tables Data Joins Common Datasets Spatial Joins ArcCatalog Geodatabases.
Sep , 2006 v FME Worldwide User Conference - Vancouver David Eagle – Consultant / Trainer Dotted Eyes Ltd, UK Production.
Network Analysis with Python
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Python: An Introduction
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
An introduction to SQL 1/21/2014 – See chapter 2.3 and 6.1 PostgreSQL -
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
Using KML, XML, and XSL to Create Google Earth Applications: A Tutorial Betsy Page Sigman and William Garr Georgetown University Southeast Decision Sciences.
Designing and Developing WS B. Ramamurthy. Plans We will examine the resources available for development of JAX-WS based web services. We need an IDE,
Galaxy for Bioinformatics Analysis An Introduction TCD Bioinformatics Support Team Fiona Roche, PhD Date: 31/08/15.
Publishing to ArcGIS for Server
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Data Interoperability Basics Bruce Harold & Dale Lutz.
Sep , 2006 v FME Worldwide User Conference - Vancouver Customizing SpatialDirect Ken Bragg, Safe Software, Vancouver, BC.
WinGapSQL and GIS Mark Lovett & Rusty Scoven
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
GIS 1 GIS Lecture 4 Geodatabases Copyright – Kristen S. Kurland, Carnegie Mellon University.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
Sep , 2006 v Tcl and Mapping Files – Best Practices Peter Laulund, National Survey and Cadastre, Denmark FME Worldwide User Conference - Vancouver.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
WDDX Case Study: Building a Cross CFUG Search April Fleming.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
ESRI Education User Conference – July 6-8, 2001 ESRI Education User Conference – July 6-8, 2001 Introducing ArcCatalog: Tools for Metadata and Data Management.
Is this going to be difficult? Identify by Radius?
Transportation Agenda 165. Transportation About Pages Pages organize and present information Pages are files that end in.aspx 166.
Publishing GIS Services to ArcGIS Server
Esri UC 2014 | Technical Workshop | Editing in ArcMap: An Introduction Lisa Stanners, Phil Sanchez.
MYSQL AND MYSQL WORKBENCH MIS2502 Data Analytics.
Robot Cataloger Using Macro Express to transfer records from MS Access to MARC format. inFIRE Conference Karlstad, Sweden Martha Gunnarson June 22, 2006.
Introduction to GIS PythonScript CGIS-NURIntroduction to ArcGIS II.
SQL and SQL*Plus Interaction
PYTHON: AN INTRODUCTION
Java programming lecture one
COMPSCI 111 / 111G An introduction to practical computing
Testing REST IPA using POSTMAN
Geoprocessing with ArcGIS for Server
Download: Vensim Download:
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
Getting Started With Solr
Input and Output Python3 Beginner #3.
Survey Results Respondents: 39 of 51 – 76%
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Sep , 2006 v FME Worldwide User Conference - Vancouver Using FME Objects Python API to Provide Platform Independent Translations Andrew Smith, Lagen Spatial, Australia

FME Objects Python API 2 Using FME Objects Python API to Provide Platform Independent Translations Andrew Smith Spatial Technical Consultant Lagen Spatial - Australia

FME Objects Python API 3 Using FME Objects Python API to Provide Platform Independent Translations Introduction  Who am I?  Project Overview Python and FMEObjects  Method for Development  Pitfalls  Tips and Tricks Output Examples Questions

FME Objects Python API 4 Using FME Objects Python API to Provide Platform Independent Translations Who am I? Name:Andrew Smith Company:Lagen Spatial Pty Ltd Official Title:Spatial Technical Consultant

FME Objects Python API 5 Using FME Objects Python API to Provide Platform Independent Translations Project Overview  Geoscience Australia  plays a critical role by producing first-class geoscientific information and knowledge. This can enable the government and the community to make informed decisions about the exploration of resources, the management of the environment, the safety of critical infrastructure and the resultant wellbeing of all Australians.

FME Objects Python API 6 Using FME Objects Python API to Provide Platform Independent Translations Project Overview  Geographic Data Management Division  Solution Name - Geoflex  Project Leader - Tony Hunter  Formats Supported  ESRI Shape File (.shp,.shx,.dxf)  Personal Geodatabase  Mapinfo Native Format (.tab), Mapinfo Data Interchange Format (.mif), and  Geographic Mark-up Language (.gml)

FME Objects Python API 7 Using FME Objects Python API to Provide Platform Independent Translations Project Overview  Requirements  Be platform independent i.e. the core extraction process is able to execute on both Windows and Unix Operating Systems  Allow a User to Select the Feature Dataset to be extracted  Allow a User to Extract the datasets to on 3 scales  National  State/Province  Map Tile  Custom Symbology Developed by GA to be applied to the Output Datasets  Dynamically update the list of Feature Datasets that are available for extraction through interrogating the underlining Spatial DBMS schema

FME Objects Python API 8 Using FME Objects Python API to Provide Platform Independent Translations Platform Independent Translations with FMEObject for Python  Method  FME Workbench to Develop the Translation Process

FME Objects Python API 9 Using FME Objects Python API to Provide Platform Independent Translations

FME Objects Python API 10 Using FME Objects Python API to Provide Platform Independent Translations  Copy the Transformers into a text editor to get the FME Script that defines Translation

FME Objects Python API 11 ArcSDEQuerier MACRO wheremac SDE_SEARCH_METHOD_FIELD __SEARCH_METHOD INCLUDE [ if { {SDE_AREA_INTERSECT} == {SDE_NONE} } { puts {MACRO wheremac}} ] FACTORY_DEF * TeeFactory \ FACTORY_NAME ARCSDEQUERIER_Globber \ INPUT FEATURE_TYPE clip_area_0 \ OUTPUT FEATURE_TYPE __GLOBBED__ FACTORY_DEF * SDE30QueryFactory \ FACTORY_NAME ARCSDEQUERIER_Querier \ INPUT FEATURE_TYPE __GLOBBED__ 1,__INSTANCE,esri_sde,__DATASET,sde,__USERID,sde,__PASSWORD,sdeuser,__TARGET_TABLE,STONNING_CAD,__SEA RCH_METHOD,SDE_AREA_INTERSECT,__WHERE_CLAUSE,"",__VERSION,SDE.DEFAULT) \ SDE_SERVER_FIELD __SERVER \ SDE_INSTANCE_FIELD __INSTANCE \ SDE_DATASET_FIELD __DATASET \ SDE_USERID_FIELD __USERID \ SDE_PASSWORD_FIELD __PASSWORD \ SDE_VERSION_NAME_FIELD __VERSION \ SDE_TARGET_TABLE_FIELD __TARGET_TABLE \ $(wheremac) \ WHERE_CLAUSE_FIELD __WHERE_CLAUSE \ QUERY_MODE QUERY \ SEARCH_ORDER SPATIAL_FIRST \ COMBINE_ATTRIBUTES ADD \ OUTPUT_DUPLICATES NO \ GET_SPATIAL_RELATIONS \ OUTPUT RESULT FEATURE_TYPE * \ \

FME Objects Python API 12 ClippingFactory FACTORY_DEF * ClippingFactory \ FACTORY_NAME CLIPPER \ INPUT CLIPPER FEATURE_TYPE clip_area_1 \ INPUT CLIPPEE FEATURE_TYPE ARCSDEQUERIER_STONNING_CAD \ MULTICLIP YES \ CLIPPEE_ON_BOUNDARY INSIDE \ MERGE_CLIPPER_ATTRIBUTES No \ DO_NOT_AGGREGATE NO \ CLIPPER_ATTR_PREFIX "clipper_" \ OUTPUT INSIDE FEATURE_TYPE CLIPPER_INSIDE \ OUTPUT CLIPPED_INSIDE FEATURE_TYPE CLIPPER_CLIPPED_INSIDE \ OUTPUT EXTRA_CLIPPER FEATURE_TYPE fme_warn {Deleting extra clipper feature encountered which entered transformer CLIPPER}") \ OUTPUT NONPOLY_CLIPPER FEATURE_TYPE fme_warn {Deleting non-polygonal clipper feature which entered transformer CLIPPER}") FACTORY_DEF * TeeFactory \ FACTORY_NAME CLIPPER_Nuker \ INPUT FEATURE_TYPE CLIPPER__delete__ feature was:")

FME Objects Python API 13 Joiner (Relate) ‘Factory’ Relate CACHE_SIZE "JOINER:all_symbology_lookup_table" 5000 Relate TABLE_LOCATION "JOINER:all_symbology_lookup_table" "d:\User Documents\LagenSpatial\Projects\GA - FME Data Migration\Symbology Library (new)\version \all_symbology_lookup_table.csv" Relate TABLE_DEF "JOINER:all_symbology_lookup_table" CSV \ FACTORY_DEF * TeeFactory \ FACTORY_NAME JOINER \ INPUT FEATURE_TYPE CLIPPER_INSIDE \ INPUT FEATURE_TYPE CLIPPER_CLIPPED_INSIDE \ OUTPUT FEATURE_TYPE JOINER_JOINED

FME Objects Python API 14 Using FME Objects Python API to Provide Platform Independent Translations  Save the pasted output as one or more.fmi files  Use the FMEFactoryPipeline.addFactoriesFrom File() method to include your translation pipeline.fmi files into your PyFMEObjects Script.

FME Objects Python API 15 Using FME Objects Python API to Provide Platform Independent Translations  WHY???  Reduce possible errors in your script  Special Characters \n – New line \r – Carriage Return \w – White Space \t – Tab !!!  Special characters MEAN something in both Python and FME Mapping Files

FME Objects Python API 16 Using FME Objects Python API to Provide Platform Independent Translations  Allows you to solve other bugs  Logical  Programmatic  Data Flow  Logical –  If…Then…Else  Do…Loop  Switch…Case

FME Objects Python API 17 Using FME Objects Python API to Provide Platform Independent Translations  Allows you to solve other bugs  Logical  Programmatic  Data Flow  Programmatic –  Incorrect Method use  String Manipulation  Reading Multiple Source Datasets

FME Objects Python API 18 Using FME Objects Python API to Provide Platform Independent Translations  Allows you to solve other bugs  Logical  Programmatic  Data Flow  Data Flow –  Combination of Logical and Programmatic Errors  Unexpected output

FME Objects Python API 19 Using FME Objects Python API to Provide Platform Independent Translations  Once you have your Python script reproducing the same output as Workbench, its time to Embed your Factories  …which is also where the fun begins!!

FME Objects Python API 20 Using FME Objects Python API to Provide Platform Independent Translations  First of all…  Use the Python Lists i.e.  stringListVariable = [‘green’, ‘eggs’, ‘and’, ‘ham’]  Cuts out the possibility of naughty special characters sneaking their way into your Factory Definition  i.e. DON’T USE THE “””green eggs and ham“”” strings – it tells Python to use the string as it is, Naughty Special Characters and all

FME Objects Python API 21 GOOD fme_session.config(['Relate', 'RELATION_DEF', 'JOINER', '1:0..1+', 'TABLE', 'JOINER:all_symbology_lookup_table', 'UNIQUE(Esri_No,feature_type)', 'JOIN', 'Esri_No', 'TO', 'SYMBOL', 'JOIN', 'feature_type', 'TO', 'fme_type', 'MATCHED_RECORDS_ATTR', 'matched_records', 'TRIM_TRAILING', 'No', 'TRANSFER', 'mapinfo_brush_background', 'TO', 'mapinfo_brush_background', 'TRANSFER', 'mapinfo_brush_foreground', 'TO', 'mapinfo_brush_foreground', 'TRANSFER', 'mapinfo_brush_pattern', 'TO', 'mapinfo_brush_pattern', 'TRANSFER', 'mapinfo_pen_color', 'TO', 'mapinfo_pen_color', 'TRANSFER', 'mapinfo_pen_pattern', 'TO', 'mapinfo_pen_pattern', 'TRANSFER', 'mapinfo_pen_width', 'TO', 'mapinfo_pen_width', 'TRANSFER', 'mapinfo_symbol_angle', 'TO', 'mapinfo_symbol_angle', 'TRANSFER', 'mapinfo_symbol_color', 'TO', 'mapinfo_symbol_color', 'TRANSFER', 'mapinfo_symbol_file_name', 'TO', 'mapinfo_symbol_file_name', 'TRANSFER', 'mapinfo_symbol_font', 'TO', 'mapinfo_symbol_font', 'TRANSFER', 'mapinfo_symbol_shape', 'TO', 'mapinfo_symbol_shape', 'TRANSFER', 'mapinfo_symbol_size', 'TO', 'mapinfo_symbol_size', 'TRANSFER', 'mif_brush_background', 'TO', 'mif_brush_background', 'TRANSFER', 'mif_brush_foreground', 'TO', 'mif_brush_foreground', 'TRANSFER', 'mif_brush_pattern', 'TO', 'mif_brush_pattern', 'TRANSFER', 'mif_pen_color', 'TO', 'mif_pen_color', 'TRANSFER', 'mif_pen_pattern', 'TO', 'mif_pen_pattern', 'TRANSFER', 'mif_pen_width', 'TO', 'mif_pen_width', 'TRANSFER', 'mif_symbol_angle', 'TO', 'mif_symbol_angle', 'TRANSFER', 'mif_symbol_color', 'TO', 'mif_symbol_color', 'TRANSFER', 'mif_symbol_file_name', 'TO', 'mif_symbol_file_name', 'TRANSFER', 'mif_symbol_font', 'TO', 'mif_symbol_font', 'TRANSFER', 'mif_symbol_shape', 'TO', 'mif_symbol_shape', 'TRANSFER', 'mif_symbol_size', 'TO', 'mif_symbol_size',])

FME Objects Python API 22 BAD fme_pipeline.addFactoryFromString( """FACTORY_DEF * SDE30QueryFactory \ FACTORY_NAME ARCSDEQUERIER_Querier \ INPUT FEATURE_TYPE __GLOBBED__ + server + """,__INSTANCE,port:""" + instance +""",__DATASET,""" + _dataset + """,__USERID,""" + username + """,__PASSWORD,""" + password + """,__TARGET_TABLE,""" + _owner + "." + featuredataset.upper() + """,__SEARCH_METHOD,SDE_ENVELOPE,__VERSION,SDE.DEFAULT) \ SDE_SERVER_FIELD __SERVER \ SDE_INSTANCE_FIELD __INSTANCE \ SDE_DATASET_FIELD __DATASET \ SDE_USERID_FIELD __USERID \ SDE_PASSWORD_FIELD __PASSWORD \ SDE_VERSION_NAME_FIELD __VERSION \ SDE_TARGET_TABLE_FIELD __TARGET_TABLE \ SDE_SEARCH_METHOD_FIELD __SEARCH_METHOD QUERY_MODE QUERY \ SEARCH_ORDER OPTIMIZE \ COMBINE_ATTRIBUTES MERGE \ GET_SPATIAL_RELATIONS \ OUTPUT RESULT FEATURE_TYPE ARCSDEQUERIER_OUTPUT ET_TABLE,__SEARCH_METHOD,__WHERE_CLAUSE,__VERSION) \ )

FME Objects Python API 23 Using FME Objects Python API to Provide Platform Independent Translations  Why Use Python?  Great ‘Whipitupability’  It is an ‘interpreted’ language  Its free and powerful!!! With a great open source community  Supported by ESRI and FME  You can write your own transformers for FME

FME Objects Python API 24 Using FME Objects Python API to Provide Platform Independent Translations Example - Sydney

FME Objects Python API 25 Using FME Objects Python API to Provide Platform Independent Translations Example - Darwin

FME Objects Python API 26 Using FME Objects Python API to Provide Platform Independent Translations Example - Perth

FME Objects Python API 27 Using FME Objects Python API to Provide Platform Independent Translations Example – Pt. Lincon

FME Objects Python API 28 Using FME Objects Python API to Provide Platform Independent Translations QUESTIONS??? Name: Andrew Smith Phone: