Hello udig developers
Moeninf. I'm just reading the tutorials and samples about IGeoResource, IService, Feature, and so on. (uDIG 1.2 M6)
Sounds good. I'm trying to import and display data from an in-memory data source. What is the best way to accomplish that?
There is a catalog method to make a temporary datastore for you to work from; right now it produces a memory datastore - I am hoping the H2 DataStore shapes up and we can make use of a temporary database on disk - when that switch occurs it should be seamless to your application.
The local catalog method needed is a bit non intuitive IMHO - you need to give it a magic object describing what you want. A featuretype to produce a datastore, and something else to produce a grid coverage.
createTemporaryResource( Object ) - used to create a temporary resources, usually by using a FeatureType
Including...
SimpleTypeBuilder builder = new SimpleTypeBuilder();
builder.setName( "Flag" );
builder.setNamespaceURI( "http: );
builder.setCRS( DefaultGeographicCRS.WSG84 );
builder.add( "Location", Point.class );
builder.add( "ID", Integer.class );
builder.add( "Name", String.class );
final SimpleFeatureType FLAG = builder.buildFeatureType();
If you pass the above FLAG SImpleFeatureType to createTemporaryResource you should be good to go. Are there UML diagrams which can enhance the appreciation of the internal data structures such as IGeoResource, IService, ...?
There are in the commercial training materials; I update the online documentation based on questions here on the developer list. This week I am busy getting ready for the FOSS4G conference.
At the bottom of the catalog page mentioned above is a class diagram showing the central idea of IGeoResource and IService (they are a like a file handle - they represent some content - but no content is fetched until you ask for it). Similar to how the java class File works - no content is fetched until you open an input stream. Methods on the handle will be able to answer some questions without hitting disk (what is the name of the resource); and some questions will require checking (what is the title of the resource).
Jody |