[Geoserver-users] Date field in shape dbf file

Hello everyone,

I have a shapefile in geoserver that has a Date field. Unfortunately, I
think there is an issue with the date format supported in geoserver since
when I am looking at the Openlayers preview of my shapefile layer the Date
field is empty (when you click on your layer in the OpenLayers preview a
table is displayed containing all information of the .dbf file).

I was reading some stuff about Geoserver supported Date format and it is
said that the format "yyyy-mm-ddTHH-MM-SSZ" is supported, but it doesn't
work.
I was wondering if any people have trying to add a shapefile layer to
geoserver with a Date field and if they had the same kind of issue... and if
they came up with a solution.

Thank you in advance.

Claire.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Date-field-in-shape-dbf-file-tp5130608.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Mon, Mar 24, 2014 at 10:33 AM, cetienne <claire.etiennen7@anonymised.com>wrote:

Hello everyone,

I have a shapefile in geoserver that has a Date field. Unfortunately, I
think there is an issue with the date format supported in geoserver since
when I am looking at the Openlayers preview of my shapefile layer the Date
field is empty (when you click on your layer in the OpenLayers preview a
table is displayed containing all information of the .dbf file).

Date fields should be supported, but only if they are part of the standard
DBF format.
Some programs generate extended formats for them, in that case we might
not be able to read that field, or recognize it as a valid date

I was reading some stuff about Geoserver supported Date format and it is
said that the format "yyyy-mm-ddTHH-MM-SSZ" is supported, but it doesn't
work.

Hum no, this would not be a valid DBF date format, the format you cite is
the ISO one used by the GML encoders.
The valid DBF date format, from the spec, is
"8 bytes - date stored as a string in the format YYYYMMDD."

Could you share the shapefile for further analysis?

Cheers
Andrea

--

Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Thanks a lot actually I didn’t know that geoserver needed the valid DBF date format. It works now.

Thanks again.

Claire

···

2014-03-26 10:53 GMT+00:00 Andrea Aime <andrea.aime@anonymised.com>:

Claire ETIENNE
Ingénieur ENSEEIHT spécialisation Informatique et Mathématiques appliquées

On Mon, Mar 24, 2014 at 10:33 AM, cetienne <claire.etiennen7@anonymised.com> wrote:

Hello everyone,

I have a shapefile in geoserver that has a Date field. Unfortunately, I
think there is an issue with the date format supported in geoserver since
when I am looking at the Openlayers preview of my shapefile layer the Date
field is empty (when you click on your layer in the OpenLayers preview a
table is displayed containing all information of the .dbf file).

Date fields should be supported, but only if they are part of the standard DBF format.
Some programs generate extended formats for them, in that case we might
not be able to read that field, or recognize it as a valid date

I was reading some stuff about Geoserver supported Date format and it is
said that the format “yyyy-mm-ddTHH-MM-SSZ” is supported, but it doesn’t
work.

Hum no, this would not be a valid DBF date format, the format you cite is
the ISO one used by the GML encoders.
The valid DBF date format, from the spec, is
“8 bytes - date stored as a string in the format YYYYMMDD.”

Could you share the shapefile for further analysis?

Cheers
Andrea

==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it