Hi All,

I've been happily using the GeoJSON library but have run into a
problem.  Basically it doesn't seem to handle the case where features
have differing properties, for example;

Reading this feature collection

{"type":"FeatureCollection",
        "features":[
                
{"type":"Feature","geometry":{"type":"Point","coordinates":[144.5719,-37.6786]},"properties":{"A":"1"},"id":"points.1"},
                
{"type":"Feature","geometry":{"type":"Point","coordinates":[144.5976,-37.678]},"properties":{"B":"3"},"id":"points.3"}
        ]
}

With something like this

FeatureJSON fj = new FeatureJSON();
FeatureIterator<SimpleFeature> features =
fj.streamFeatureCollection(url.openConnection().getInputStream());

while (features.hasNext()) {
            SimpleFeature feature = (SimpleFeature) features.next()
}

Results in an exception
 java.lang.IllegalArgumentException: No such attribute:B

Any thoughts? Is there a workaround?

Regards
Gus MacAulay

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to