[Geoserver-users] kml and TimeStamp

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Hi Sébastien,

What version are you using? I recently fixed a bug with kml timestamps.
Any chance you can grab a recent nightly build and try it there:

http://traffic.openplans.org/geoserver/trunk/

-Justin

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Sébastien,

What type of database are you using?

You may need to specify a date format string in your template file.
See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when trying to
determine the exact date format string to use, because the log shows you how
your time or date data is interpreted before the template is applied.

- Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/kml-and-TimeStamp-tf4648184.html#a13290684
Sent from the GeoServer - User mailing list archive at Nabble.com.

Tyler Erickson a écrit :

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
       <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when trying to
determine the exact date format string to use, because the log shows you how
your time or date data is interpreted before the template is applied.
  
- Tyler

Sébastien Geindre wrote:
  

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

For the postgres data type ‘timestamp without time stone’ I have found the following time format string to work:

${analysis_time.value?datetime(“MM/dd/yy hh:mm a”)}

If that doesn’t work, post the postgres data type that you are using, and any log messages that you get for the WMS request.

Sébastien Geindre wrote:

···


Tyler A. Erickson, Ph.D.
Research Scientist
Michigan Tech Research Institute (MTRI)
3600 Green Court, Suite 100
Ann Arbor, MI 48105
Phone: 734-913-6846
Fax: 734-913-6880
tyler.erickson@anonymised.com
http://www.mtri.org


Tyler Erickson a écrit :

For the postgres data type 'timestamp without time stone' I have found the following time format string to work:

    ${analysis_time.value?datetime("MM/dd/yy hh:mm a")}

If that doesn't work, post the postgres data type that you are using, and any log messages that you get for the WMS request.

My log error :

19 oct. 15:27:47 ERROR [freemarker.runtime] -
Error: on line 1, column 3 in time.ftl
Expecting a date here, found: 16/10/07 13:00
The problematic instruction:
----------
==> ${analysis_time.value?date("yyyy-MMM-dd hh:mm:ss")} [on line 1, column 1 in time.ftl]
----------

so i set the format to "dd/MM/yy hh:mm" and it is better !!!
"dd/MM/yy hh:mm a" does not work.

i have a time schedule on google earth but the range is not valid....
always the same data :
<TimeStamp>
               <when>2007-10-19T00:00:00+00:00</when>
            </TimeStamp>

for 19/10/07 08:13 data...

still a bug ?

Sébastien Geindre wrote:

Tyler Erickson a écrit :

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
      <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when trying to
determine the exact date format string to use, because the log shows you how
your time or date data is interpreted before the template is applied.
  
- Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
------------------------------------------------------------------------
*Tyler A. Erickson, Ph.D.*
Research Scientist
*Michigan Tech Research Institute (MTRI)*
3600 Green Court, Suite 100
Ann Arbor, MI 48105
*Phone:* 734-913-6846
*Fax:* 734-913-6880
tyler.erickson@anonymised.com <mailto:tyler.erickson@anonymised.com>
http://www.mtri.org
------------------------------------------------------------------------

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Based on your log, my guess would be:

    ${analysis_time.value?datetime("dd/MM/yy HH:mm")}

If that doesn't work, the following links may help you out find the correct
date format:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html
http://www.freemarker.org/docs/ref_builtins_date.html#ref_builtin_date_datetype

Sébastien Geindre wrote:

Tyler Erickson a écrit :

For the postgres data type 'timestamp without time stone' I have found
the following time format string to work:

    ${analysis_time.value?datetime("MM/dd/yy hh:mm a")}

If that doesn't work, post the postgres data type that you are using,
and any log messages that you get for the WMS request.

My log error :

19 oct. 15:27:47 ERROR [freemarker.runtime] -
Error: on line 1, column 3 in time.ftl
Expecting a date here, found: 16/10/07 13:00
The problematic instruction:
----------
==> ${analysis_time.value?date("yyyy-MMM-dd hh:mm:ss")} [on line 1,
column 1 in time.ftl]
----------

so i set the format to "dd/MM/yy hh:mm" and it is better !!!
"dd/MM/yy hh:mm a" does not work.

i have a time schedule on google earth but the range is not valid....
always the same data :
<TimeStamp>
               <when>2007-10-19T00:00:00+00:00</when>
            </TimeStamp>

for 19/10/07 08:13 data...

still a bug ?

Sébastien Geindre wrote:

Tyler Erickson a écrit :

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
      <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when
trying to
determine the exact date format string to use, because the log shows
you how
your time or date data is interpreted before the template is applied.
  
- Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in
database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a
browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
------------------------------------------------------------------------
*Tyler A. Erickson, Ph.D.*
Research Scientist
*Michigan Tech Research Institute (MTRI)*
3600 Green Court, Suite 100
Ann Arbor, MI 48105
*Phone:* 734-913-6846
*Fax:* 734-913-6880
tyler.erickson@anonymised.com <mailto:tyler.erickson@anonymised.com>
http://www.mtri.org
------------------------------------------------------------------------

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/kml-and-TimeStamp-tf4648184.html#a13298058
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Sébastien,

Did you try the nightly build?

Sébastien Geindre wrote:

Tyler Erickson a écrit :

For the postgres data type 'timestamp without time stone' I have found
the following time format string to work:

    ${analysis_time.value?datetime("MM/dd/yy hh:mm a")}

If that doesn't work, post the postgres data type that you are using,
and any log messages that you get for the WMS request.

My log error :

19 oct. 15:27:47 ERROR [freemarker.runtime] -
Error: on line 1, column 3 in time.ftl
Expecting a date here, found: 16/10/07 13:00
The problematic instruction:
----------
==> ${analysis_time.value?date("yyyy-MMM-dd hh:mm:ss")} [on line 1,
column 1 in time.ftl]
----------

so i set the format to "dd/MM/yy hh:mm" and it is better !!!
"dd/MM/yy hh:mm a" does not work.

i have a time schedule on google earth but the range is not valid....
always the same data :
<TimeStamp>
               <when>2007-10-19T00:00:00+00:00</when>
            </TimeStamp>

for 19/10/07 08:13 data...

still a bug ?

Sébastien Geindre wrote:

Tyler Erickson a écrit :

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
      <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when
trying to
determine the exact date format string to use, because the log shows
you how
your time or date data is interpreted before the template is applied.
  
- Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in
database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a
browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
------------------------------------------------------------------------
*Tyler A. Erickson, Ph.D.*
Research Scientist
*Michigan Tech Research Institute (MTRI)*
3600 Green Court, Suite 100
Ann Arbor, MI 48105
*Phone:* 734-913-6846
*Fax:* 734-913-6880
tyler.erickson@anonymised.com <mailto:tyler.erickson@anonymised.com>
http://www.mtri.org
------------------------------------------------------------------------

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira a écrit :

Hi Sébastien,

Did you try the nightly build?
  

i am on the trunk. i did a svn update on geoserver and geotools.
i still have

<TimeStamp><when>2007-10-19T00:00:00+00:00</when></TimeStamp>

for 19/10/07 08:13 data...

with MM/dd/yy hh:mm format.

what could i check ???
how could i help ?
on Monday....
have a nice weekend...
thanks for all.

Sébastien Geindre wrote:
  

Tyler Erickson a écrit :
    

For the postgres data type 'timestamp without time stone' I have found the following time format string to work:

    ${analysis_time.value?datetime("MM/dd/yy hh:mm a")}

If that doesn't work, post the postgres data type that you are using, and any log messages that you get for the WMS request.
      

My log error :

19 oct. 15:27:47 ERROR [freemarker.runtime] -
Error: on line 1, column 3 in time.ftl
Expecting a date here, found: 16/10/07 13:00
The problematic instruction:
----------
==> ${analysis_time.value?date("yyyy-MMM-dd hh:mm:ss")} [on line 1, column 1 in time.ftl]
----------

so i set the format to "dd/MM/yy hh:mm" and it is better !!!
"dd/MM/yy hh:mm a" does not work.

i have a time schedule on google earth but the range is not valid....
always the same data :
<TimeStamp>
               <when>2007-10-19T00:00:00+00:00</when>
            </TimeStamp>

for 19/10/07 08:13 data...

still a bug ?

Sébastien Geindre wrote:
      

Tyler Erickson a écrit :
        

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
      <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when trying to
determine the exact date format string to use, because the log shows you how
your time or date data is interpreted before the template is applied.
  - Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
------------------------------------------------------------------------
*Tyler A. Erickson, Ph.D.*
Research Scientist
*Michigan Tech Research Institute (MTRI)*
3600 Green Court, Suite 100
Ann Arbor, MI 48105
*Phone:* 734-913-6846
*Fax:* 734-913-6880
tyler.erickson@anonymised.com <mailto:tyler.erickson@anonymised.com>
http://www.mtri.org
------------------------------------------------------------------------
      
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Justin Deoliveira ha scritto:

Hi Sébastien,

Did you try the nightly build?

I looked at this quickly, it's the feature wrapper that
turns the date into a string using:
DateFormat.getInstance().format( (Date)o )

Once http://jira.codehaus.org/browse/GEOS-1393 is fixed
you'll have access to the native java.util.Date object
and you'll be able to format it as you like.

Cheers
Andrea

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.

-Justin

Sébastien Geindre wrote:

Justin Deoliveira a écrit :

Hi Sébastien,

Did you try the nightly build?
  

i am on the trunk. i did a svn update on geoserver and geotools.
i still have

<TimeStamp><when>2007-10-19T00:00:00+00:00</when></TimeStamp>

for 19/10/07 08:13 data...

with MM/dd/yy hh:mm format.

what could i check ???
how could i help ?
on Monday....
have a nice weekend...
thanks for all.

Sébastien Geindre wrote:
  

Tyler Erickson a écrit :
    

For the postgres data type 'timestamp without time stone' I have found
the following time format string to work:

    ${analysis_time.value?datetime("MM/dd/yy hh:mm a")}

If that doesn't work, post the postgres data type that you are using,
and any log messages that you get for the WMS request.
      

My log error :

19 oct. 15:27:47 ERROR [freemarker.runtime] -
Error: on line 1, column 3 in time.ftl
Expecting a date here, found: 16/10/07 13:00
The problematic instruction:
----------
==> ${analysis_time.value?date("yyyy-MMM-dd hh:mm:ss")} [on line 1,
column 1 in time.ftl]
----------

so i set the format to "dd/MM/yy hh:mm" and it is better !!!
"dd/MM/yy hh:mm a" does not work.

i have a time schedule on google earth but the range is not valid....
always the same data :
<TimeStamp>
               <when>2007-10-19T00:00:00+00:00</when>
            </TimeStamp>

for 19/10/07 08:13 data...

still a bug ?

Sébastien Geindre wrote:
      

Tyler Erickson a écrit :
        

Sébastien,

What type of database are you using?
  

i am using postgis, my analysis_time field is a timestamp.

data example :
<gml:TimeInstant>
      <gml:timePosition>2005-06-25T17:11:00.000Z</gml:timePosition>
</gml:TimeInstant>

You may need to specify a date format string in your template file. See
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

When trying to determine the correct format string for a particular
date/time field, I found it useful to look at the log file when
trying to
determine the exact date format string to use, because the log shows
you how
your time or date data is interpreted before the template is applied.
  
- Tyler

Sébastien Geindre wrote:

hi all,

i try to see my feature with google earth.
i add a time template :
${analysis_time.value?date}

My time field is mapped as :
analysis_time: dateTime

In kml data, i have timeStamp :
            <TimeStamp>
               <when>0008-04-10T00:00:00+01:00</when>
            </TimeStamp>

This strange date has nothing to do with my analysis_time in
database...

any idea ?

thank again and again.

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

-------------------------------------------------------------------------

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a
browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
------------------------------------------------------------------------
*Tyler A. Erickson, Ph.D.*
Research Scientist
*Michigan Tech Research Institute (MTRI)*
3600 Green Court, Suite 100
Ann Arbor, MI 48105
*Phone:* 734-913-6846
*Fax:* 734-913-6880
tyler.erickson@anonymised.com <mailto:tyler.erickson@anonymised.com>
http://www.mtri.org
------------------------------------------------------------------------
      
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.

It may be that the french default DateFormat is different.
Locale matters when you use DateFormat.getInstance().

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

What I meant is that if you have the raw date then you
can apply whatever formatting you want using Freemarker
date format functions like:
http://freemarker.org/docs/ref_builtins_date.html

and then turn the raw date in whatever is the expected form.
Then again, I'm not too familiar with what happens in that
part of the code so I'm probably completely off...
Cheers
Andrea

Hi Tyler,
http://jira.codehaus.org/browse/GEOS-1393 is fixed, could you try an
updated version of trunk or the latest nightly?
attribute.value returns a default string representation of the value,
you can access the actual value object through attribute.rawValue

Cheers,

Gabriel

On 10/19/07, Andrea Aime <aaime@anonymised.com> wrote:

Justin Deoliveira ha scritto:
> Hmmm... I am unable to replicate this behaviour with postgis and
> timestamp fields. Simple using ${<timstampField>.value} works for me.

It may be that the french default DateFormat is different.
Locale matters when you use DateFormat.getInstance().

> Andrea is correct in that having direct access to the raw date may be an
> easier way to go. Although i dont think this will work with the kml
> encoder out of the box.. i could be wrong.

What I meant is that if you have the raw date then you
can apply whatever formatting you want using Freemarker
date format functions like:
http://freemarker.org/docs/ref_builtins_date.html

and then turn the raw date in whatever is the expected form.
Then again, I'm not too familiar with what happens in that
part of the code so I'm probably completely off...
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Gabriel Roldán

You will need to make sure that you use one of the supported formats
listed on this page:

http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates

Gabriel Roldan wrote:

Hi Tyler,
http://jira.codehaus.org/browse/GEOS-1393 is fixed, could you try an
updated version of trunk or the latest nightly?
attribute.value returns a default string representation of the value,
you can access the actual value object through attribute.rawValue

Cheers,

Gabriel

On 10/19/07, Andrea Aime <aaime@anonymised.com> wrote:

Justin Deoliveira ha scritto:

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.

It may be that the french default DateFormat is different.
Locale matters when you use DateFormat.getInstance().

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

What I meant is that if you have the raw date then you
can apply whatever formatting you want using Freemarker
date format functions like:
http://freemarker.org/docs/ref_builtins_date.html

and then turn the raw date in whatever is the expected form.
Then again, I'm not too familiar with what happens in that
part of the code so I'm probably completely off...
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Sébastien will have to try out the fix, because he had encountered the
problem with the time templates. The time templates have been working fine
for me...

Cheers,
Tyler

Gabriel Roldán-4 wrote:

Hi Tyler,
http://jira.codehaus.org/browse/GEOS-1393 is fixed, could you try an
updated version of trunk or the latest nightly?
attribute.value returns a default string representation of the value,
you can access the actual value object through attribute.rawValue

Cheers,

Gabriel

On 10/19/07, Andrea Aime <aaime@anonymised.com> wrote:

Justin Deoliveira ha scritto:
> Hmmm... I am unable to replicate this behaviour with postgis and
> timestamp fields. Simple using ${<timstampField>.value} works for me.

It may be that the french default DateFormat is different.
Locale matters when you use DateFormat.getInstance().

> Andrea is correct in that having direct access to the raw date may be
an
> easier way to go. Although i dont think this will work with the kml
> encoder out of the box.. i could be wrong.

What I meant is that if you have the raw date then you
can apply whatever formatting you want using Freemarker
date format functions like:
http://freemarker.org/docs/ref_builtins_date.html

and then turn the raw date in whatever is the expected form.
Then again, I'm not too familiar with what happens in that
part of the code so I'm probably completely off...
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Gabriel Roldán

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/kml-and-TimeStamp-tf4648184.html#a13328371
Sent from the GeoServer - User mailing list archive at Nabble.com.

Justin Deoliveira a écrit :

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.
  

Good morning guys, and thanks for helping...

first i update my subversion repository.
and rebuild geoserver.

then, i try this ${<timstampField>.value}, it's better BUT, i lose the seconds...
for data : 2007-10-19 08:13:26 in postgis (timestamp)
anf template ${validity_start_time.value}
<TimeStamp><when>2007-10-19T08:13:00+00:00</when></TimeStamp>

i try the rawValue attribute...
22 oct. 08:32:35 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.
  

In fact, i have a time span (begin-end)

so my template conatains 2 references to datetim :
${validity_start_time.value}
${validity_end_time.value}

I should have :

*<TimeSpan>*
    <begin>2007-10-19T08:13:00+00:00</begin>
    <end>2007-10-19T08:33:00+00:00</end>
*</TimeSpan>*

according to javacode : time.length == 2 ...???

wms/src/main/java/org/vfny/geoserver/wms/responses/map/kml/KMLVectorTransformer.java
       /**
         * Encodes a KML TimePrimitive geometry from a feature.
         */
        protected void encodePlacemarkTime(Feature feature) throws IOException {
            try {
                String time = new FeatureTimeTemplate(template).execute(feature);
                if ( time.length == 0 ) {
                    return;
                }

                if ( time.length == 1 ) {
                    String datetime = encodeDateTime(time[0]);
                    if ( datetime != null ) {
                        //timestamp case
                        start("TimeStamp");
                        element("when", datetime );
                        end("TimeStamp");
                    }

                }
                else {
                    //timespan case
                    String begin = encodeDateTime(time[0]);
                    String end = encodeDateTime(time[1]);

                    if (!(begin == null && end == null)) {
                        start("TimeSpan");
                        if ( begin != null ) {
                            element("begin", begin);
                        }
                        if ( end != null ) {
                            element("end", end);
                        }
                        end("TimeSpan");
                    }
                }
            } catch (Exception e) {
                throw (IOException) new IOException().initCause(e);
            }
        }

Sébastien Geindre a écrit :

Justin Deoliveira a écrit :
  

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.
  

Good morning guys, and thanks for helping...

first i update my subversion repository.
and rebuild geoserver.

then, i try this ${<timstampField>.value}, it's better BUT, i lose the seconds...
for data : 2007-10-19 08:13:26 in postgis (timestamp)
anf template ${validity_start_time.value}
<TimeStamp><when>2007-10-19T08:13:00+00:00</when></TimeStamp>

i try the rawValue attribute...
22 oct. 08:32:35 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.
  
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre a écrit :

In fact, i have a time span (begin-end)

so my template conatains 2 references to datetim :
${validity_start_time.value}
${validity_end_time.value}
  

OK for timespan, i should have written template as foloow :

${validity_start_time.value}||${validity_end_time.value}

i should have read the doc more carefully !!
http://docs.codehaus.org/display/GEOSDOC/02-Time+Templates#02-TimeTemplates-reference

But i still need the seconds...

I should have :

*<TimeSpan>*
    <begin>2007-10-19T08:13:00+00:00</begin>
    <end>2007-10-19T08:33:00+00:00</end>
*</TimeSpan>*

according to javacode : time.length == 2 ...???

wms/src/main/java/org/vfny/geoserver/wms/responses/map/kml/KMLVectorTransformer.java
       /**
         * Encodes a KML TimePrimitive geometry from a feature.
         */
        protected void encodePlacemarkTime(Feature feature) throws IOException {
            try {
                String time = new FeatureTimeTemplate(template).execute(feature);
                if ( time.length == 0 ) {
                    return;
                }

                if ( time.length == 1 ) {
                    String datetime = encodeDateTime(time[0]);
                    if ( datetime != null ) {
                        //timestamp case
                        start("TimeStamp");
                        element("when", datetime );
                        end("TimeStamp");
                    }

                }
                else {
                    //timespan case
                    String begin = encodeDateTime(time[0]);
                    String end = encodeDateTime(time[1]);

                    if (!(begin == null && end == null)) {
                        start("TimeSpan");
                        if ( begin != null ) {
                            element("begin", begin);
                        }
                        if ( end != null ) {
                            element("end", end);
                        }
                        end("TimeSpan");
                    }
                }
            } catch (Exception e) {
                throw (IOException) new IOException().initCause(e);
            }
        }

Sébastien Geindre a écrit :
  

Justin Deoliveira a écrit :
  

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.
  

Good morning guys, and thanks for helping...

first i update my subversion repository.
and rebuild geoserver.

then, i try this ${<timstampField>.value}, it's better BUT, i lose the seconds...
for data : 2007-10-19 08:13:26 in postgis (timestamp)
anf template ${validity_start_time.value}
<TimeStamp><when>2007-10-19T08:13:00+00:00</when></TimeStamp>

i try the rawValue attribute...
22 oct. 08:32:35 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.
  
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Hi Sébastien,

I think you will have to use a string format function against the date
to get this to work with the raw value.

${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}

Try that and let us know how it goes.

Side note: Andrea was right when he stated that the issue here is coming
up because Sébastien is probably using a different locale which is
causing a different default java date format when converting the date to
a string. Which in turn is causing the kml encoder to improperly parse
the date. A better solution may be to force a specific date format when
converting the date to a string, something that is not locale dependent.

Sébastien Geindre wrote:

Justin Deoliveira a écrit :

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.
  

Good morning guys, and thanks for helping...

first i update my subversion repository.
and rebuild geoserver.

then, i try this ${<timstampField>.value}, it's better BUT, i lose the
seconds...
for data : 2007-10-19 08:13:26 in postgis (timestamp)
anf template ${validity_start_time.value}
<TimeStamp><when>2007-10-19T08:13:00+00:00</when></TimeStamp>

i try the rawValue attribute...
22 oct. 08:32:35 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3
in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression
validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.
  
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,471c63a5189781137850744!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira a écrit :

Hi Sébastien,

I think you will have to use a string format function against the date
to get this to work with the raw value.

${<timstampField>?string("yyyy-MM-ddTHH:mm:ss")}
  

with ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} ,
i have the following error :
22 oct. 15:24:57 ERROR [freemarker.runtime] -
Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected number, date, or string. validity_start_time evaluated instead to freemarker.template.SimpleHash on line 1, column 3 in time.ftl.

with ${validity_start_time.value?string("yyyy-MM-ddTHH:mm:ss")}
22 oct. 15:28:59 ERROR [freemarker.runtime] -
Expected method. validity_start_time.value?string evaluated instead to freemarker.template.SimpleScalar on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.value?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected method. validity_start_time.value?string evaluated instead to freemarker.template.SimpleScalar on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)

with ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")}
the following one :
22 oct. 15:30:26 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue?string("yyyy-MM-ddTHH:mm:ss")} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)

Try that and let us know how it goes.

Side note: Andrea was right when he stated that the issue here is coming
up because Sébastien is probably using a different locale which is
causing a different default java date format when converting the date to
a string. Which in turn is causing the kml encoder to improperly parse
the date. A better solution may be to force a specific date format when
converting the date to a string, something that is not locale dependent.
  

maybe that's why seconds disappear...
i 'd like to do some unit test, where should i start ?

Sébastien Geindre wrote:
  

Justin Deoliveira a écrit :
    

Hmmm... I am unable to replicate this behaviour with postgis and
timestamp fields. Simple using ${<timstampField>.value} works for me.
  

Good morning guys, and thanks for helping...

first i update my subversion repository.
and rebuild geoserver.

then, i try this ${<timstampField>.value}, it's better BUT, i lose the seconds...
for data : 2007-10-19 08:13:26 in postgis (timestamp)
anf template ${validity_start_time.value}
<TimeStamp><when>2007-10-19T08:13:00+00:00</when></TimeStamp>

i try the rawValue attribute...
22 oct. 08:32:35 ERROR [freemarker.runtime] -
Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
The problematic instruction:
----------
==> ${validity_start_time.rawValue} [on line 1, column 1 in time.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression validity_start_time.rawValue is undefined on line 1, column 3 in time.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)

Andrea is correct in that having direct access to the raw date may be an
easier way to go. Although i dont think this will work with the kml
encoder out of the box.. i could be wrong.

Sébastien: Can you send me your table structure. And perhaps a subset of
the data in the table in which you are having problems with. I can try
replicating with your data.
  
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,471c63a5189781137850744!

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr