Revision: 5165
          http://sourceforge.net/p/jump-pilot/code/5165
Author:   edso
Date:     2016-11-06 12:49:20 +0000 (Sun, 06 Nov 2016)
Log Message:
-----------
allow NULL values in otherwise typed columns (Long, Boolean etc.) while reading 
GeoJSON

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-06 12:01:19 UTC (rev 5164)
+++ 
core/trunk/src/com/vividsolutions/jump/io/geojson/GeoJSONFeatureCollectionWrapper.java
      2016-11-06 12:49:20 UTC (rev 5165)
@@ -127,7 +127,7 @@
     // parse geometry
     if (featureMap.containsKey(GeoJSONConstants.GEOMETRY)
         && (featureMap.get(GeoJSONConstants.GEOMETRY) instanceof Map)) {
-      // add geom attribute if none so far
+      // add geom attribute to schema if none so far
       if (featureSchema.getGeometryIndex() < 0) {
         featureSchema.addAttribute("Geometry", AttributeType.GEOMETRY);
       }
@@ -166,12 +166,13 @@
           if (featureSchema.getAttributeType(key) == ATTRIBUTETYPE_NULL) {
             featureSchema.setAttributeType(key, type);
           }
-          // this column hosts mixed attrib types
-          else {
+          // this column hosts mixed attrib types eg. String/Long, NULL values 
are allowed though
+          else if (type != ATTRIBUTETYPE_NULL){
             columnsWithMixedValues.add(key);
           }
         }
 
+        // add the attribute value to the feature
         feature.setAttribute(key, value);
       }
     }
@@ -267,7 +268,7 @@
         milliSeconds = now;
         TaskMonitorUtil.report(monitor, count, size(), "");
       }
-      
+
       // unset first marker
       if (first)
         first = false;


------------------------------------------------------------------------------
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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to