It looks like it is assuming all your feature types are going to be the same; 
that is pretty normal for a FeatureCollection.

-- 
Jody Garnett

On Wednesday, 27 April 2011 at 7:55 AM, Rico Lelina wrote: 
> I have the following GeoJSON file:
> {"type":"FeatureCollection",
>  "features":
>  [
>  {"type":"Feature",
>  "geometry":{"type":"Point","coordinates":[0.0, 0.0]},
>  "properties":{"NAME":"Point-0001"}
>  },
>  {"type":"Feature",
>  "geometry":{"type":"Point","coordinates":[1.0, 1.0]},
>  "properties":{"NAME":"Point-0002","ALIAS":"Point2"}
>  }
>  ]
> }
> 
> My code:
> BufferedReader reader = new BufferedReader(new FileReader(srcFile));
>  FeatureJSON fjson = new FeatureJSON();
> FeatureIterator<SimpleFeature> features =
>  fjson.streamFeatureCollection(reader);
> while (features.hasNext()) {
> ...
> }
> 
> The first feature is read just fine. But when I get to the next feature, I 
> get the following exception on the call to hasNext():
> java.lang.RuntimeException: java.lang.IllegalArgumentException: No such 
> attribute:ALIAS
>  at 
> org.geotools.geojson.feature.FeatureJSON$FeatureCollectionIterator.readNext(FeatureJSON.java:533)
>  at 
> org.geotools.geojson.feature.FeatureJSON$FeatureCollectionIterator.hasNext(FeatureJSON.java:517)
> 
> Can't I use SimpleFeature in this case? What is causing the exception?
> 
> Thanks,
> Rico
> 
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network 
> management toolset available today. Delivers lowest initial 
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to