Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

15
CONNECT. TRANSFORM. AUTOMATE. LEVERAGING FME WORKBENCH AND PYTHON SCRIPTS TO CREATE STYLIZED OIL AND GAS KMZ DATASETS MARCO A. TERRAZAS GIS ANALYST

description

Presented by Marco Terrazas, Talisman See more FME World Tour 2014 presentations at www.safe.com/recap2014

Transcript of Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Page 1: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

CONNECT. TRANSFORM. AUTOMATE.

LEVERAGING FME WORKBENCH AND PYTHON SCRIPTS TO CREATE STYLIZED OIL AND GAS KMZ DATASETS

MARCO A. TERRAZASGIS ANALYST

Page 2: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

FGDB to KMZ

Page 3: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Startup & Shutdown Python Scripts

- FME allows us to run python scripts before and after a translation.

- This is very useful because you can carry out maintenance tasks on your datasets before they are pushed into a different format.

- In this example I will be compacting the FGDB before the translation then call a batch file to clean up the FME’s log after the translation.

Page 4: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Startup Python Script- The following python script “compacts” our main data source, the FGDB.

- A regularly used FGDB should be compacted periodically as the records on the database lose their order and unused space is developed. This affects the reading performance as the file system needs to work harder to catch up.

- ESRI recommends compacting your databases once a month if you delete and add data frequently.* Which is often the case if you perform surveyor pipeline and facility updates.

* © ESRI compacting file and personal geodatabases: http://webhelp.esri.com/arcgisserver/9.3/dotnet/index.htm#geodatabases/compac-1530230024.htm

Page 5: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

FME Workbench 2 (Pipelines)

FGDB Reader

Reprojection:NAD27 ->

WGS84

As-Built

Test: PL is Existing (Not Surveyed)

Symbolization(Colors/Styles)

Export all KMLsInto a single KMZ

Test: PL is As-Built (Surveyed)

Test: PL is in Construction

Page 6: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

EsriReprojector Transformer

The EsriReprojector transformer reprojects feature coordinates from one coordinate system to another using the Esri reprojection library.*

Don’t forget your

Geographic Transformatio

n!

*© Safe Software EsriReprojector Reference: http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/esrireprojector.htm

Page 7: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

FGDB Projection:NAD_1927_StatePlane_Texas_South_Central_FIPS_4204

Page 8: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Google Earth Projection

Google Earth uses Simple Cylindrical (Plate Carree) projection with a WGS84 datum for its imagery base*

*© 2014 Google Earth Projection: https://support.google.com/earth/answer/148110?hl=en

Page 9: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

KMLStyler Transformer

The KMLStyler transformer allows us to create a common symbology for a set of features.*

Color

Icon

Line Style

Label Style

* © Safe Software KMLStyler Reference: http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/kmlstyler.htm

Page 10: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

FME Workbench 1 (All Features)

Well Pads

Offices

Leases

Facilities

Pipelines

Page 11: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Shutdown Python Script- The following python script runs a batch

file named “LogClipper.bat” after the translation is done.

- Once the batch file runs the Python script closes.

- more +94 command: Using the original FME log file “Pipelines.log” it creates a “Pipelines.log.new” file which only shows the logs data from line 95 down to the end of the log.

- Move /y command: Replaces the original log with the new condensed version.

- Notepad opens showing the clipped log containing the feature counts.

LogClipper.bat

Page 12: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Clipped FME Log

Page 13: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

LIVE DEMO- Initial Python Script

- FME Workbench 1 & Python Scripts- FME Workbench 2 & Python Scripts

- Batch File & Logs

SHOWCASEFinal Product: KMZ!

Page 14: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

References

ESRI compacting file and personal geodatabases: http://webhelp.esri.com/arcgisserver/9.3/dotnet/index.htm#geodatabases/compac-1530230024.htm

Safe Software EsriReprojector Reference: http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/esrireprojector.htm

Safe Software KMLStyler Reference: http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/kmlstyler.htm

Google Earth Projection Information: https://support.google.com/earth/answer/148110?hl=en

Page 15: Leveraging FME Workbench and Python Scripts to Create Stylized Oil and Gas KMZ Datasets

Thank You!

Questions?

For more information: Marco Terrazas ([email protected]) Talisman Energy USA Inc.