Hello,
I am using geotools 10.3
I am converting featurecollection to JSON fjson.writeFeatureCollection().
After words when I convert it back to featurecollection using
fjson.readFeatureCollection() sometimes I am getting error.
java.lang.IllegalArgumentException: No such attribute:REMARKS
The problem appears if the REMARKS attribute is null for some records in
the original featurecollection. This error happens if the attribute is null
in the first record. The null attributes are not getting added to JSON
Feature. So while rebuilding featurecollection it is creating FeatureType
based on attributes of first feature. Subsequently when the attribute
appears in later feature it throws exception.
I could find this piece of code in toJSONString of FeatureEncoder in
FeatureJSON
if (!encodeNullValues && value == null) {
//skip
continue;
}
Is it a bug?
Regards,
Sunish.
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users