3
3
import java .io .File ;
4
4
import java .util .Arrays ;
5
5
import java .util .Date ;
6
- import java .util .HashMap ;
7
6
import java .util .HashSet ;
8
7
import java .util .List ;
9
- import java .util .Map ;
10
8
import java .util .Set ;
11
9
12
- import org .geotools .data .DataStore ;
13
- import org .geotools .data .DataStoreFinder ;
10
+ import org .geotools .data .shapefile .ShapefileDataStore ;
14
11
import org .geotools .data .simple .SimpleFeatureIterator ;
15
12
import org .geotools .data .simple .SimpleFeatureSource ;
16
13
import org .junit .Assert ;
@@ -32,9 +29,7 @@ public class ShapefileIndexerTest {
32
29
public void testBasicIndexing () throws Exception {
33
30
34
31
File shapefile = new File ("data/build/flickr-shapes/neighbourhoods.shp" );
35
- Map <String , Object > map = new HashMap <String , Object >();
36
- map .put ("url" , shapefile .toURI ().toURL ());
37
- DataStore store = DataStoreFinder .getDataStore (map );
32
+ ShapefileDataStore store = new ShapefileDataStore (shapefile .toURI ().toURL ());
38
33
39
34
String name = store .getTypeNames ()[0 ];
40
35
SimpleFeatureSource source = store .getFeatureSource (name );
@@ -75,10 +70,7 @@ public void testBasicIndexing() throws Exception {
75
70
public void testPrintShapefile () throws Exception {
76
71
77
72
File shapefile = new File ("data/build/flickr-shapes/counties.shp" );
78
-
79
- Map <String , Object > map = new HashMap <String , Object >();
80
- map .put ("url" , shapefile .toURI ().toURL ());
81
- DataStore store = DataStoreFinder .getDataStore (map );
73
+ ShapefileDataStore store = new ShapefileDataStore (shapefile .toURI ().toURL ());
82
74
83
75
String name = store .getTypeNames ()[0 ];
84
76
System .out .println ("TypeNames: " + Arrays .toString (store .getTypeNames ()));
0 commit comments