Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

Fxp
2011-10-20 08:12:49

Hi Luc,you'll also need probably :
* to register the gdal jar lib in org.talend.libraries.sdi
* start Talend with the env options for gdal
* replace to file popup selection by a ogr connection text box (or a mix of the 2) because OGR does not only support files.

All this is not impossible but not trivial. From my side, I don't have time and funding to work on that currently but do not hesitate to ask questions here.

HTH.

Francois

lucvanlinden
2011-10-19 21:23:17

I had a quick look what this would take. I must say I do know a bit on java but not enough to go this route to undertake this.

From my observations, it does not seems to hard to accomplish this (always easy to say while standing a side, I know):

Using the ogrinfo.java example from the GDAL/OGR: http://trac.osgeo.org/gdal/browser/trun … rinfo.java


The schema can be accessed using bits of the the code inside the piece marked as:

.....

/* -------------------------------------------------------------------- */
/*      Report various overall information.                             */
/* -------------------------------------------------------------------- */

.....

if( poLayer.GetFIDColumn().length() > 0 )
358                    System.out.println( "FID Column = " + poLayer.GetFIDColumn() );
359          
360                if( poLayer.GetGeometryColumn().length() > 0 )
361                    System.out.println( "Geometry Column = " +  poLayer.GetGeometryColumn() );
362      
363                for( int iAttr = 0; iAttr < poDefn.GetFieldCount(); iAttr++ )
364                {
365                    FieldDefn  poField = poDefn.GetFieldDefn( iAttr );
366                  
367                    System.out.println( poField.GetNameRef() + ": " + poField.GetFieldTypeName( poField.GetFieldType() ) + " (" + poField.GetWidth() + "." + poField.GetPrecision() + ")");
368                }


......


and apply this into: org/talend/sdi/repository/ui/actions/metadata/ImportGeoSchemaWizard.java

in the section:
......

/**
     * Load feature type model for SHP, MIF, GPX Datastore.
     *
     */

.......


Also, the file types probably need to be checked here also:

/org/talend/sdi/repository/ui/actions/metadata/CreateGeoMetadata.java


/**
     * Open dialog for GIS file selection
     *
     * @return
     */

lucvanlinden
2011-10-19 12:00:30

Hi

Just wondered if it was possible to have "generic schema from ogr" option for the metadata creation?

This way the schema could be fetched and generated using OGR, rather then have it to build manualy (in case of formats other then those already provided by the GIS formats).

tx

Luc

Board footer

Powered by FluxBB