Issue Type: Bug Bug
Affects Versions: 10-RC2
Assignee: Unassigned
Components: geojson
Created: 10/Sep/13 8:21 PM
Description:

FeatureJSON currently only considers the first feature's properties in order to build a FeatureType. This causes problems in scenarios where subsequent features have different number of attributes than the first. One error that occurs when parsing is the "No such attribute" error, as described here:
http://www.mail-archive.com/[email protected]/msg13741.html

I have a patch that solves this problem.

I have added a new method to FeatureJSON to obtain the a feature collection schema by reading all features in search of the data types of all properties; as opposed to only considering the first feature.

FeatureJSON#readFeatureCollectionSchema reads the SimpleFeatureType of a GeoJSON using FeatureTypeHandler, which is a simpler handler when compared to FeatureHandler. In the worst case, it will parse all features searching for attributes not present in previous features. This method only obtains the feature type, which means that a second parse would have to be done in order to obtain the actual feature collection.

I will submit the fix as a Pull Request.

Fix Versions: 10.0
Project: GeoTools
Priority: Minor Minor
Reporter: William Voorsluys
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to