Question

How to map FMEDataReader GEOMETRY column to another GEOMETRY column name in FMEDataWriter using FMEObjectsDotnet4.dll

  • 13 January 2023
  • 1 reply
  • 1 view

Badge

Hi FME team

 

I started on using FMEObjectsDotNet4.dll and started reading CHM help

and I started to write some simple code, and I'm stuck on mapping FMEReader GEOMETRY column to another GEOMETRY column in FMEWriter

 

FMEReader is from shapefile

but the target database oracle table has 2 columns and I want to directly update to 2nd column, and seems cannot find the right "keyword" in CHM help, also the samples is not really helping with this problem

 

C:\\Program Files\\FME\\fmeobjects\\dotnet\\apidoc\\FMEObjectsDotNet4.chm

C:\\Program Files\\FME\\FMEObjectsDotNet4.dll

 

Also in IFMEOWriter seems lacking IsOpen method

to check whether the connection still open or not

so we can do something about it. Maybe like manually commit ..

 

 

 

 

on another topic:

1) is there a NUGET feed from you for this library

like Telerik nuget feed

https://docs.telerik.com/devtools/maui/get-started/install-nuget

https://nuget.telerik.com/v3/index.json

2) is there a link/resource/forum/video/training/repository

for those interested only in FMEObject in C# only

 

Thank you in advance!

 

 

 


1 reply

Userlevel 2
Badge +17

Hi @sebastianolaf​,

The reader will interpret the source data and return features containing the attributes and geometry in a standard FME feature object. This object can be written directly to the writer, which will convert it to the necessary structure for the output format.

 

A pseudocode template for a simple conversion process would be:

create reader
create writer
open reader
open writer
 
create new feature
while reader.readSchema(feature) == true
    writer.addSchema(feature)
    create new feature
 
create new feature
while reader.read(feature) == true
    writer.write(feature)
    create new feature
 
close reader
close writer

The schema defines the table attribute structure and geometry type, and must be written before any of the data features.

 

However, we have been de-emphasizing the full use of FME Objects and recommend setting up your conversion process within FME Workbench, since this is faster and easier to create and maintain. You can silently run the finished workspace in your .NET application using the FME Objects IFMEOWorkspaceRunner interface.

 

 

Reply