Skip to main content

Hello,

I am new to FME. I want to load multiple shapefiles into Oracle spatial tables. I just have a problem with the extents. I would like to get them from shapefiles and use them as parameter in the Oracle writer but I don't know how to do it.

I know the BoundsExtractor transformer but I don't know how to store xmin, xmax, ymin and ymax values as parameters, even more with multiple shapefiles.

Thanks for your help!

To get the extents of all your SHAPE data you can use the BoundingBoxAccumulator transformer.

 

As for the spatial extents, unfortunately, these can only be set from a Parameter on the Orace Spatial Writer Feature Type (which must be set before the workspace runs) and cannot be set from an attribute value derived during the workspace run.

 

I think the best approach might be to alter the user_sdo_geom_metadata after you have written the data. That should be possible - see the Oracle Spatial docs. To do this use the FeatureWriter to write you Oracle data, and then connect a SQLExecutor to send the SQL to alter the user_sdo_geom_metadata table.

 

The alternative is to have a two part workflow, read the shape data to get the extents using BoundingBoxAccumulator and then use WorkspaceRunner to call the workspace that loads your data (and sets the extents parameters).

 


In this post I give some SQL commands to write the spatial extents of the table to the user_sdo_geom_metadata table.


Reply