Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: [Geoserver-devel] We're generating invalid dates in GML....

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@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,45eda27413931365099012!


--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
begin:vcard
fn:Chris Holmes
n:Holmes;Chris
org:The Open Planning Project
adr:;;349 W. 12th Street, #3;New York;NY;10014;USA
email;internet:cholmes@xxxxxxxxxxxxx
title:Managing Director, Strategic Development
x-mozilla-html:FALSE
url:http://topp.openplans.org
version:2.1
end:vcard


Back to the top