[udig-devel] Re: [Geoserver-devel] We're generating invalid dates in GML....

Chris Holmes cholmes at openplans.org
Tue Mar 6 10:25:40 PST 2007


Hmmm...  I thought we had at least modified toString to at least give 
consistent output, but it looks like that is not the case.

There's this DateUtil class in the codebase: 
http://svn.geotools.org/geotools/branches/2.3.x/module/main/src/org/geotools/feature/type/DateUtil.java

That handles W3C dates and times, but it appears we're not using it in 
the code at all.

It sounds like we should fix either the encoder or the toString to do a 
bit better than it does now.

Chris

Andrea Aime wrote:
> Justin Deoliveira ha scritto:
>> Hmmm, I am surprised the wfs 1.0 cite tests pass as they do a lot of
>> testing against dates... But i guess that is just date and not datetime
>> so that makes sense.
> 
> Hmm... that's suprising nonetheless... attributes encoding in Geotools
> FeatureTranslator is handled in FeatureTranslator.handleAttribute:
> 
> if (Geometry.class.isAssignableFrom(value.getClass())) {
>      geometryTranslator.encode((Geometry) value, srsName);
> } else {
>      String text = value.toString();
>      contentHandler.characters(text.toCharArray(), 0,
>          text.length());
> }
> 
> Sooo.... it seems to me it was working only because of sheer luck? :-)
> 
> Looking at the FeatureTypeEncoder, every subclass of java.util.Date
> will be turned into a xs:datetime, so I guess wfs 1.0 passed only
> because we use Postgis as the backing store, which was configured
> to use a date type, and returned as a result a java.sql.Date that
> toStrings to something which is in the format CCYY-MM-dd, apparently
> another format supported by xs:datetime.
> 
> Cheers
> Andrea
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
> 
> !DSPAM:1003,45eda27413931365099012!
> 

-- 
Chris Holmes
The Open Planning Project
http://topp.openplans.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cholmes.vcf
Type: text/x-vcard
Size: 282 bytes
Desc: not available
Url : http://lists.refractions.net/pipermail/udig-devel/attachments/20070306/9fc264b0/cholmes.vcf


More information about the udig-devel mailing list