Question

Steps to create SHP Bounding boxes from GetCapabilites document

  • 23 November 2013
  • 2 replies
  • 9 views

Badge
I am trying to learn how to manipulate xml files with fme. I thought it would help me to set a small project, but I´m already lost. 

 

 

Project outline: Retrieve GetCabilities.xml from a URL. Manipulate the xml file to extract layer names, contact person, Boundingboxes, and KeyWords and write these into a Shapefile.

 

 

I´m basically lost at the first hurdle because I can´t really understand which methods/transformers I should be using. 

 

 

1. Create xml Writer and tell fme to create fme-feature types for Layer, Contact, BBOX,KEyword.

 

 

2. This splits the elements up into 4 fme-feature  types. Next I thought I should somehow extract the coordinates and make a point feature which can be grouped according to layer-name and converted to a polygon. Obviously this is not easy.

 

 

 

Could someone offer me a step for step way to do this? or is it too difficult for a beginner?

 

 

Yours,

 

 

Rob

 

 

 

 

 

 

 


2 replies

Userlevel 2
Badge +17
Hi Rob,

 

 

I think it's not so difficult if you divide the workflow into several steps. The main flow would be: 1) Read the XML file. i.e. create features having required attributes  - layer name, contact person, coordinate values of bounding box etc. - from XML elements and / or attributes. 2) Create geometries (bounding boxes) based on attributes holding coordinate values. 3) Merge required attributes to bounding boxes if necessary. 4) Write bounding boxes with attributes into a shape file.  

 

At first, you will have to learn how to read an XML file. There are many related documentations in FMEpedia, I think these are good starting point. XML FAQ: Reading and Writing XML http://fmepedia.safe.com/articles/FAQ/XML-FAQ-Reading-and-Writing-to-the-Extensible-Markup-Language-Format Reading XML - Simple Approach using Feature Paths http://fmepedia.safe.com/articles/How_To/Reading-XML Reading XML/GML http://fmepedia.safe.com/articles/How_To/Reading-XML-GML

 

 

Takashi
Userlevel 4
Badge +13
Hi,

 

In addition to Takashi's answer for step 2 have a look at the GeometryReplacer, it will convert your XML geometry holding attribute into features .

 

 

Itay

Reply