I am stuck into this from very long please help me in this. Please let me know how we can add a Mapinfo file Layer on geotools map please help in this
OGRDataStoreFactory factory = new JniOGRDataStoreFactory();
Map<String, String> connectionParams = new HashMap<String, String>();
connectionParams.put("DriverName", "MapInfo File");
connectionParams.put("DatasourceName",
"C:\\Users\\Varun\\Desktop\\Test\\export\\MS1_Longcall0608143822_001.tab");
DataStore store = factory.createDataStore(connectionParams);
SimpleFeatureSource featureSource = store.getFeatureSource("MS1_Longcall0608143822_001");
MapContent map = new MapContent();
map.setTitle("Quickstart");
Style style = SLD.createSimpleStyle(featureSource.getSchema());
Layer layer = new FeatureLayer(featureSource, style);
map.addLayer(layer); // Now display the map
JMapFrame.showMap(map);
Stack Trace
2016-09-27T18:36:44.839+0530 SEVERE org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(JLorg/gdal/ogr/Layer;JLorg/gdal/ogr/Geometry;)V
java.lang.UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(JLorg/gdal/ogr/Layer;JLorg/gdal/ogr/Geometry;)V
at org.gdal.ogr.ogrJNI.Layer_SetSpatialFilter(Native Method)
at org.gdal.ogr.Layer.SetSpatialFilter(Layer.java:89)
at org.geotools.data.ogr.jni.JniOGR.LayerSetSpatialFilter(JniOGR.java:257)
at org.geotools.data.ogr.OGRFeatureSource.setLayerFilters(OGRFeatureSource.java:124)
at org.geotools.data.ogr.OGRFeatureSource.getReaderInternal(OGRFeatureSource.java:230)
at org.geotools.data.ogr.OGRFeatureSource.getReaderInternal(OGRFeatureSource.java:167)
at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:647)
at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:173)
at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:58)
at org.geotools.renderer.lite.StreamingRenderer.drawPlain(StreamingRenderer.java:2285)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1920)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:833)
at org.geotools.swing.RenderingTask.call(RenderingTask.java:106)
at org.geotools.swing.RenderingTask.call(RenderingTask.java:41)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)