[Gdal-dev] Shapefile feature deletion and feature count
aaime at openplans.org
Sat Mar 10 15:48:18 EST 2007
Frank Warmerdam ha scritto:
> Perhaps the GeoTools API should try being more fine grained with regard
> to writing features.
Geotools is basically there to serve Geoserver and uDig. In both
applications, you either are a good read only data source, or a fully
transactional one that allows to support WFS-T and interactive editing.
There's no useful middle ground...
> Assuming that is impractical, I would suggest a
> generic approach to read access, and then using some "working" format
> for all update access, and on close copying back to the original format.
> This approach would minimize the amount of driver specific work.
> Overall, as long as geotools takes such a strict view of datastore
> responsibilities for writing, you are pretty much stuck implementing
> update in place via a working format. For the time being you could
> likely use MEM format as the working format though of course this
> makes working with large datasets impractical.
Hum, that approach I suggested (rewrite on a separate data set, then
copy back) is the approach we're using for shapefiles in order
to provide transactional support. It's not fast, but works.
To copy back data I guess I need the original format to support
layer deletion, otherwise I'm stuck
going right to the filesystem with a detailed knowledge of how
the files are organized. Can I assume all file based formats do
> Shapefile is not a good working format since it imposes so many
> extra restrictions (short field names, no mixing geometry types,
> no variable length fields).
Yup, understand that.
> Ultimately the question arises about how important it is to provide
> write access through OGR for GeoTools.
Yeah, good question. Well, my initial interest was provide read access,
that has been a success, so far (I still have to try out
geometry and attribute filters).
I then went to write side because that would have made the datastore
more useful for both WFS-T and interactive editing in uDig.
A partial write support, that provides only appending, would be
good enough to make OGR be used for WFS basic too, so that we can
return features not only in GML2/3 and shapefile, but also in a slew
of other formats as well. I was hesitant to limit myself to it, because
there is basically no way to specify this "middle ground" capability
Well, thank you for you insights. I think with some more work I'll
be able to release an OGR based data store that can be used
for WFS basic/WMS serving :-)
More information about the Gdal-dev