Gertjan van Oosten ha scritto:
> Hi Geotools developers,
> 
> I'm having some problems with a feature type that has a dateTime element
> in its schema like this:
> 
>   [...]
>   <xs:element type = "xs:dateTime" minOccurs = "0" name = "timestamp" 
> nillable = "true" maxOccurs = "1" />
>   [...]
> 
> When I try to insert a feature of this type (from my Java code, using
> FeatureType, FeatureStore, FeatureCollection etc.), the data that gets
> sent to the WFS-T (Geoserver) contains this on the wire:
> 
>   [...]
>   <west:timestamp>Wed Feb 22 20:15:00 CET 1995</west:timestamp>
>   [...]
> 
> Geoserver then (rightly) complains that it can't parse that into a
> java.util.Date.  (I say rightly, because that string does not conform to
> the XML Schema spec. for the dateTime datatype.)
> 
> This is with the gt2-2.4-M4 jars.  What can I do to get it to format the
> dateTime correctly?

Debug and provide a fix? :)
I guess you're using the WFS datastore right? I thought it was using
the same GML encoder Geoserver uses for creating new features to be 
inserted, but apparently it's not.
Locate where the feature is produced, and then use DateUtils to encode
the date with the appropriate type, and you should get exactly the
same behaviour as GeoServer.
As you can see, I'm wasn't kidding, the WFS datastore is basically
unmantained at the moment :(

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to