Revision: 5149
http://sourceforge.net/p/jump-pilot/code/5149
Author: edso
Date: 2016-11-04 14:14:33 +0000 (Fri, 04 Nov 2016)
Log Message:
-----------
treat Dates as String to conform JSON specs
do NOT save NULL values anymore to minimize file size
Modified Paths:
--------------
core/trunk/src/com/vividsolutions/jump/io/geojson/GeoJSONFeatureCollectionWrapper.java
Modified:
core/trunk/src/com/vividsolutions/jump/io/geojson/GeoJSONFeatureCollectionWrapper.java
===================================================================
---
core/trunk/src/com/vividsolutions/jump/io/geojson/GeoJSONFeatureCollectionWrapper.java
2016-11-04 12:50:10 UTC (rev 5148)
+++
core/trunk/src/com/vividsolutions/jump/io/geojson/GeoJSONFeatureCollectionWrapper.java
2016-11-04 14:14:33 UTC (rev 5149)
@@ -282,7 +282,15 @@
String name = schema.getAttributeName(i);
AttributeType type = schema.getAttributeType(i);
Object value = feature.getAttribute(i);
+
+ // we do NOT save null values to minimize the file size
+ if (value == null)
+ continue;
+ // Date objects should be saved quoted in String representation
+ if (type.equals(AttributeType.DATE))
+ value = String.valueOf(value);
+
if (i == schema.getGeometryIndex()) {
Geometry geometry = (Geometry) value;
if (geometry != null)
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel