<div dir="ltr">I have tried to read GeoJSON from Geotk 5.0 snapshot and I get the following error<div><br></div><div>java.lang.IllegalStateException: Can not handle this instance of ‘Geometry’ because arbitrary implementations are not yet supported.</div><div><br></div><div>I had a similar issue trying to read from a shapefile.</div><div><br></div><div>Here the code</div><div><br></div><div><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.data.FeatureCollection;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.data.FeatureStore;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.data.geojson.GeoJSONFeatureStoreFactory;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.data.query.QueryBuilder;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.data.session.Session;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.geotoolkit.storage.DataStores;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.opengis.feature.FeatureType;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.opengis.parameter.ParameterDescriptor;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.opengis.parameter.ParameterDescriptorGroup;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.opengis.parameter.ParameterValueGroup;<br><span style="color:rgb(0,0,128);font-weight:bold">import </span>org.opengis.util.GenericName;<br><br><span style="color:rgb(0,0,128);font-weight:bold">import </span>java.io.File;<br><br><span style="color:rgb(0,0,128);font-weight:bold">public class </span>GeoJSONReader {<br><br>    <span style="color:rgb(0,0,128);font-weight:bold">public static final </span>ParameterDescriptorGroup <span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">PARAMETERS_DESCRIPTOR </span>= GeoJSONFeatureStoreFactory.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">PARAMETERS_DESCRIPTOR</span>;<br>    <span style="color:rgb(0,0,128);font-weight:bold">public static final </span>ParameterDescriptor <span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">PATH </span>= GeoJSONFeatureStoreFactory.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">PATH</span>;<br><br>    <span style="color:rgb(0,0,128);font-weight:bold">public static </span>FeatureCollection getFeatureCollection(File file) <span style="color:rgb(0,0,128);font-weight:bold">throws </span>DataStoreException {<br>        ParameterValueGroup param = <span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">PARAMETERS_DESCRIPTOR</span>.createValue();<br>        param.parameter(<span style="color:rgb(0,128,0);font-weight:bold">"path"</span>).setValue(file.toURI());<br>        FeatureStore store = (FeatureStore) DataStores.<span style="font-style:italic">open</span>(param);<br><br>        GenericName name = store.getNames().iterator().next();<br>        FeatureType ft = store.getFeatureType(name.toString());<br>        Session session = store.createSession(<span style="color:rgb(0,0,128);font-weight:bold">false</span>);<br>        <span style="color:rgb(0,0,128);font-weight:bold">return </span>session.getFeatureCollection(QueryBuilder.<span style="font-style:italic">all</span>(name));<br>    }<br><br>    <span style="color:rgb(0,0,128);font-weight:bold">public static void </span>main(String[] args) <span style="color:rgb(0,0,128);font-weight:bold">throws </span>DataStoreException {<br><br>        File file = <span style="color:rgb(0,0,128);font-weight:bold">new </span>File(args[<span style="color:rgb(0,0,255)">0</span>]);<br>        FeatureCollection fc = <span style="font-style:italic">getFeatureCollection</span>(file);<br>        System.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">out</span>.println(fc);<br><br>    }<br>}<br></pre><br></div><div>Gradle configuration is:</div><div><br></div><div><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">group <span style="color:rgb(0,128,0);font-weight:bold">'com.imagemattersllc'<br></span>version <span style="color:rgb(0,128,0);font-weight:bold">'1.0-SNAPSHOT'<br></span><span style="color:rgb(0,128,0);font-weight:bold"><br></span>apply <span style="color:rgb(0,128,0);font-weight:bold">plugin</span>: <span style="color:rgb(0,128,0);font-weight:bold">'java'<br></span><span style="color:rgb(0,128,0);font-weight:bold"><br></span>sourceCompatibility = <span style="color:rgb(0,0,255)">1.8<br></span><span style="color:rgb(0,0,255)"><br></span>repositories {<br>    maven { url <span style="color:rgb(0,128,0);font-weight:bold">"<a href="http://maven.geotoolkit.org/">http://maven.geotoolkit.org/</a>"</span>}<br>    mavenCentral()<br>}<br><br>dependencies {<br>    compile (<span style="color:rgb(0,128,0);font-weight:bold">group</span>: <span style="color:rgb(0,128,0);font-weight:bold">'org.geotoolkit'</span>, <span style="color:rgb(0,128,0);font-weight:bold">name</span>: <span style="color:rgb(0,128,0);font-weight:bold">'geotk-feature-geojson'</span>, <span style="color:rgb(0,128,0);font-weight:bold">version</span>: <span style="color:rgb(0,128,0);font-weight:bold">'5.0-SNAPSHOT'</span>)<br>    testCompile <span style="color:rgb(0,128,0);font-weight:bold">group</span>: <span style="color:rgb(0,128,0);font-weight:bold">'junit'</span>, <span style="color:rgb(0,128,0);font-weight:bold">name</span>: <span style="color:rgb(0,128,0);font-weight:bold">'junit'</span>, <span style="color:rgb(0,128,0);font-weight:bold">version</span>: <span style="color:rgb(0,128,0);font-weight:bold">'4.12'<br></span>}<br></pre><br></div><div>I attached the geojson file I used. Right now I am unable to use GeoToolkit FeatureStore with Apache 1.0-SNAPSHOT.  Any solutions?</div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small">Stephane Fellah<br></div><div style="font-family:arial;font-size:small">Chief  Knowledge Scientist</div><div style="font-family:arial;font-size:small">Image Matters LLC</div><div style="font-family:arial;font-size:small">Office: +(703) 669 5510</div><div style="font-family:arial;font-size:small">Cell: 703 431 9420</div></div></div></div></div>
</div></div>