span8
span4
span8
span4
writingmultiplegeometry-oracle-2016.fmwt
writingmultiplegeometry-sqlserver-2016.fmwt
There are two multiple-geometry writing scenarios:
Reading and Writing Multiple Geometries
In aMultiple -> Multipletranslation FME handles the reading and writing automatically.
Reading Single and Writing Multiple Geometries
When converting single geometries to multiple,the key is in how to identify two features that are related,and how to assign each of them to the appropriate geometry column.
Because FME doesn't yet handleSingle -> Multipletranslations automatically within Workbench,the setup for each database record to be written must be defined manually.It will be composed of two or more features,each of which contributes its geometry to the final record.
The functionality used to do this involves geometry names and aggregates.
1) A geometry name is applied to each feature with aGeometryNameSetterand this geometry name identifies the geometry columns to write to.
2) The features are grouped together as an aggregate—usually with anAggregatortransformer—and this identifies which features form a particular database record.
Creating Multiple Geometry Tables
FME isn't yet able to create tables with multiple geometry columns.You may either use an existing table with multiple geometry columns,or you can use a SQL script within the FME translation to create one.
The goals of the SQL script are to:
Notes:
The script is divided into four sections:
A second sample scriptOracle_SimpleSQL.txtis also attached.
For working with a SQLServer database the sample scriptSQLServer_SimpleSQL.txtis also attached.
Notes:
The difference here is,rather than trap errors in the script,a specific FME device is used to ignore them.Notice the hyphen character that precedes the DROP and DELETE commands.This prompts FME to ignore any errors from these commands,such as would occur when trying to drop a table that does not exist.
ProsA shorter,simpler script
ConsNon-standard SQL
Commits are performed automatically,and do not need to be included
Either of these scripts can be used in the Writer Advanced Parameter > SQL Statement to Execute Before Translation.This ensures that the table is built correctly before the workspace is to be run.Then it is importantNOTto specify "Drop and Create" in the Table Handling Parameters on the Feature Type.
The attached workspace for Writing Multiple Geometry columns performs the following steps:
- Create the Oracle table.FME cannot create multiple geometry tables
- make sure the database writer has the parameter "Handle Multiple Spatial Columns"=Yes
1 - Set the name of the geometry column for each set of features
2 - Turn the features into an aggregate
3 - Flag the aggregates such that they are setup where each part is independent of the others and it's own complete geometry.
4 - Write to the table - truncate the table and don't set a geom column name
SQL Server
If working with SQL Server it is possible to have two geometry columns with differing geometry types.e.g.one column that uses the geometry model and one column that uses the geography model.In the SQL Server sample workspace,the table has been created such that the Polygons will be stored as GEOGRAPHY data.We have added a Reprojector to reproject the polygon features into a Lat/Long coordinate system and then they will be written correctly.
Handling Data that contains Multiple Geometry columns
Performing spatial queries on database tables using the FeatureReader
Updating SRID values in an Oracle geometry column
Let the Database Do the Work: Reading
FME is loading features with invalid geometries into my Database
Writing multiple geometry types to an existing PostGIS table
Loading Data to Oracle Spatial for GeoMedia Consumption
FME,SQL Server Spatial and GeoMedia
Why when writing to Oracle,are the fieldnames in my table pre-fixed with Q_?
© 2019 亚搏在线Safe Software Inc |Legal