Yes, I have expanded a bit from the original topic.  I already have made
some improvements to the way temporary files are handled in the data upload
process that don't change existing APIs so perhaps we can put off these
other topics for a later release - I have a fair bit of work cut out for me
translating my external test scripts into unit tests, and reviewing the
file handling in the coverage upload stuff as well.  My main focus here is
GeoNode, where stores other than Shapefile and PostGIS are vanishingly rare
so I guess schema mismatching issues won't come up much.

With respect to how we could better handle schema adaptation, I agree with
you that stores should be responsible for knowing what they can encode.  I
was suggesting FeatureAdjuster as an alternative to a Map for representing
an adjusted schema, not as a static repository of all schema-adjusting
knowledge.  I think if we want to improve the error handling on appending
through the REST API it will be important to decouple schema adjustment
from table creation, but it will probably be useful to have a convenience
method like the createSchema(FeatureCollection col, Hints hints) you
suggest.

Anyway, I'll step out of the deep end for now and get to work on bringing
my existing patch for http://jira.codehaus.org/browse/GEOS-5056 up to a
better level of testing/documentation.

--
David Winslow
OpenGeo - http://opengeo.org/

On Tue, May 1, 2012 at 3:21 PM, Andrea Aime <[email protected]>wrote:

> On Tue, May 1, 2012 at 3:36 PM, David Winslow <[email protected]>wrote:
>
>> Creating a schema is actually not that big a problem: assuming that all
>> datastores create tables (or whatever) that can *accept* features
>> conforming to the passed-in schema, the REST API importer can handle the
>> importing without worrying too much about the munging that's going on
>> "behind the scenes."  That's how things work today, and it seems to
>> generally work fine.
>
>
> Err.. which is exactly the problem. Try importing a shapefile with
> lowercase attributes in Oracle, if you don't uppercase them
> manually during the copy you'll get a table with all NULL values, the same
> will happen with shapefiles afaik (try pushing random
> GML into a shapefile and you should see that).
> You need some information about how the attribute names have been
> transformed to do something sensible.
>
> I've attached to this mail two import scripts I use to load shapefiles
> into Oracle and SDE, you can see that both
> are using some soft knowledge of how that particular store adds data in
> order to actually do a successfull import.
> Both are actually lacking and not really dealing with the whole set of
> issues (they are just throw-aways anyways).
>
> Imho it would be much better if it was the store itself to handle the
> problem to start with, instead of trying with
> some external heuristic set that only handles some of the issues we know
> we have today.
>
> I mean.. using createSchema(...) you don't even know if the name of the
> feature type has been preserved, or not
> (in general, at least). In Oracle it hasn't for example, it has been
> turned uppercase, in SDE you get a prefix
> in front of it.
>
> A way to get these feature inside the stores in this release is to have
> selected stores implement the
> createSchema(FeatureCollection, Hints) method, and access is reflectively
> if available, whilst on the
> new trunk it could be called directly.
>
> Or you can go on with the FeatureAdjuster idea... but imho it's only going
> to be a limited hack
>
> That said... maybe I'm talking about a different problem? The thread
> started talking about conflicts
> with existing feature types, which is not the same thing as creating a new
> one and having to deal
> with how the feature type has been altered by the store.
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
> mob:    +39 339 8844549
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to