[fdo-dev] Classes and properties in SHP providers
Mateusz Loskot
mateusz at loskot.net
Mon Oct 30 16:53:36 EST 2006
Pierre Dalcourt wrote:
> My comments:
>
> 1. SHP doesn't support create/destroy datastore. Part of the challenge
> is that a datastore can mean either a single shapefile or a directory of
> shapefiles, so the intended meaning would have to be made clear.
Yes, exactly.
Would it be much different from how OGR works?
> Secondly, the scope of ListDatastores command would have to be made
> clear as well; if the user connects to a single shapefile (as opposed to
> a directory), what does ListDatastores list?
First, I'd ask if support of CreateDataStore implies support of
ListDataStores support. Does it?
Second, there are two concepts/terms bounded to FDO:
- data source
- data store
The FDO Dev Guide says:
"A provider, such as Autodesk FDO Provider for Oracle, is an
implementation of the interface for a specific type of data source (for
example, for an Oracle relational database)."
What is data source for OSGeo.SHP?
As I understand, ListdataStores lists data stores available in
particular data source.
Next, according to picture on page 6 of the dev guide, chapter "FDO
Architecture and Providers", for SHP provider, as well as for raster,
ODBC and WFS, there is only single instance of data store
presented - ds<1>.
In comparison to MySQL or Oracle, there is no ds<n>.
So, I'm inclined to understand that for OSGeo.SHP works with
single-data-store data sources and if there is always one data store,
then I don't think ListDataStores command support is required,
because there is nothing dynamic it list, but always one known data store.
I've explained it in quite long way, but I'd be thankful for correction,
if I'm wrong.
> If a user connects to a single directory, does ListDatastores recurse
> over the current directory?
According to my understanding, the situation looks as follows:
1. Connected to single shapefile
- the shapefile is considered as a data store
2. Connected to directory of shapefiles
- it's still single data store - the directory
So, for OSGeo.SHP the data store there is a kind of duality.
> 2. I don't think so. You can use SHP Provider to create new
> shapefiles, by using the ApplySchema command to create a new schema (or
> get an existing one) and then creating a class that corresponds to the
> SHP file characteristic you want. See the SchemaTests unit tests in the
> SHP source code for reference.
Yes, I understand it now. Also thanks to Greg who explained me it in
details on the #fdo channel.
The reason of my misunderstanding is that from FDO docs it's fairly easy
to understand that:
CreateDataStore/DestroyDataStore commands operate on physical parts od
data store/source, ie. create/delete files/directories/databases.
But ApplySchema command modifies existing elements of data store,
works on higher level, like editing existing files/tables, etc.
So, if there is said a provider does not support CreateDataStore, then
it's fairly easy to understand that no physical elements
(files/databases) can be created using such provider.
Thanks!
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the Fdo-internals
mailing list