On Wed, Oct 26, 2011 at 7:12 PM, Gabriel Roldan <[email protected]> wrote:

> Having an issue with the JSON output format and date/time formatting.
>
> What I've gathered from the internet (?) is that JSON doesn't
> prescribe a formatting for date/time objects up until May 26 2011 [1],
> and now recommends date/times to be formatted as ISO 8601 dates
> <http://www.w3.org/TR/NOTE-datetime>
>
> Customer is requiring date/times to be formatted as per as ISO 8601
>
> Fix would be easy:
> --- a/wfs/src/main/java/org/geoserver/wfs/response/GeoJSONBuilder.java
> +++ b/wfs/src/main/java/org/geoserver/wfs/response/GeoJSONBuilder.java
> @@ -250,4 +251,14 @@ public class GeoJSONBuilder extends JSONBuilder {
>                 "Unable to determine geometry type " +
> geometry.getClass());
>         }
>     }
> +
> +
> +    @Override
> +    public GeoJSONBuilder value(Object value){
> +        if(value instanceof java.util.Date){
> +          value = Converters.convert(value, String.class);
> +        }
> +        super.value(value);
> +        return this;
> +    }
>
>
> Any objection?
>

Nothing in particular here, just an observation. In the past we had
complaints that OGR was not able to parse GeoJSON generated by
GeoServer [1], it would be interesting to know what happens with this
change

Cheers
Andrea

[1]: http://trac.osgeo.org/gdal/ticket/4082

-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to