3

Has anybody an example concerning accessing data from a WFS server by using the DataInteropability in ArcObjects?

I'm getting the right field definistion, but don't know how to read the data.

Here my current Java code:

FMEWorkspaceFactory fmeWorkspaceFactory = new FMEWorkspaceFactory();
IPlugInWorkspaceHelper plugInWorkspaceHelper = fmeWorkspaceFactory.openWorkspace("C:\\temp");
FMEWorkspaceHelper fmeWorkspaceHelper = new FMEWorkspaceHelper(plugInWorkspaceHelper);
FMEDatasetHelper fmeDatasetHelper = new FMEDatasetHelper(fmeWorkspaceHelper.openDataset("test.fdl"));
IFields fields = fmeDatasetHelper.getFields(0);

I suppose, I have to use the "fetchAll" method of the FMEDatasetHelper class.

2
  • 2
    Problem solved by using this code: bitbucket Jan 4 '12 at 12:14
  • 1
    When you get a chance would you be able to copy your Comment (solution) to an Answer that you then Accept, please? It is quite permissible to do this and gets one more Unanswered Question off our list.
    – PolyGeo
    Apr 24 '13 at 10:38
2

Take a look at the code below. Full code in git repository can be here: https://bitbucket.org/bugramovic/fme_arcobjects_interop_example

    PrintStream out = System.out;
    FMEWorkspaceFactory fmeWorkspaceFactory = new FMEWorkspaceFactory();
    IPlugInWorkspaceHelper plugInWorkspaceHelper = fmeWorkspaceFactory.openWorkspace( pathToFdlFiles );
    FMEWorkspaceHelper fmeWorkspaceHelper = new FMEWorkspaceHelper( plugInWorkspaceHelper );
    printDatasets( fmeWorkspaceHelper );

    IPlugInDatasetHelper dsHelper = fmeWorkspaceHelper.openDataset( fdlFile );
    FMEDatasetHelper fmeDatasetHelper = new FMEDatasetHelper( dsHelper );

    printClasses( fmeDatasetHelper );

    out.println( "Class-name:" + fmeDatasetHelper.getClassName( featureClassIdx ) );
    IFields fields = fmeDatasetHelper.getFields( featureClassIdx );
    printFields( fields );

    FMEReader reader = new FMEReader( fmeDatasetHelper );
    List<ArrayRowBuffer> lst = reader.readFeatures( featureClassIdx );
    for (ArrayRowBuffer el : lst) {
        out.println( el );
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.