[udig-devel] Datastores & co

Andrea Antonello andrea.antonello at gmail.com
Tue Jan 15 15:05:49 PST 2008


> Andrea Antonello wrote:
>> I have a problem with the thousand levels of abstraction for feature
>> data.
>>
> Fair enough.
>> After running up and down the line, I decided that DataStore could  
>> be a
>> good interface to use to get a whole pile of data types from which to
>> get features.
>>
> Okay; we should be able to get to that from an IService.
>> But right after that thought, I noticed that:
>> DataStore tmpStore = tmpLayer.getResource(DataStore.class, null);
>>
> Option 1)
> FeatureSource source = tmpLayer.getResource( FeatureSource.class,  
> null );
> DataStore source.getDataStore();
>
> Option 2)
> IGeoResource resource = tmlLayer.getGeoResource(...); // not sure of  
> the details here
> IService service = resource.getParent();
> DataStore dataStore = service.resolve( DataStore.class, null );

Yes, but I found a UDIGFeatureStore that didn't resolve to DataStore.
I mean, I can get a DataStore out of it, but I always have to do the  
check.
Is that right?
Am I forced to see if what I got is a UDIGFeatureStore or a DataStore?
I have not my example by hand right now, but if I wasn't clear, I will  
post a better example :)

Andrea



>
>
> Cheers,
> Jody
>> does return null for the first thing I tried, i.e. the
>> ShapefileDataStore. This happens because it doesn't resolve to it.
>>
>> So I don't understand if I got the thing wrong and if yes, what  
>> should
>> I take to be able to define an item that deals with most possible
>> features types? This should apply from the layers but also from the
>> catalog resources.
>>
> A layer is bound to a single kind of features (ie the contents) ; as  
> represented by the FeatureSource read only api; or the FeatureStore  
> subclass for a read/write api. Those features are provided by a  
> service; the service is represented a DataStore (like a Databse, WFS  
> or a Shapefile).
>
> Cheers,
> Jody
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel



More information about the udig-devel mailing list