Skip to content

Commit 58d2f08

Browse files
author
Josh Devins
committed
Simplified store loading
1 parent 17a0ebc commit 58d2f08

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/test/java/net/joshdevins/gis/geocoder/ShapefileIndexerTest.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
import java.io.File;
44
import java.util.Arrays;
55
import java.util.Date;
6-
import java.util.HashMap;
76
import java.util.HashSet;
87
import java.util.List;
9-
import java.util.Map;
108
import java.util.Set;
119

12-
import org.geotools.data.DataStore;
13-
import org.geotools.data.DataStoreFinder;
10+
import org.geotools.data.shapefile.ShapefileDataStore;
1411
import org.geotools.data.simple.SimpleFeatureIterator;
1512
import org.geotools.data.simple.SimpleFeatureSource;
1613
import org.junit.Assert;
@@ -32,9 +29,7 @@ public class ShapefileIndexerTest {
3229
public void testBasicIndexing() throws Exception {
3330

3431
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());
3833

3934
String name = store.getTypeNames()[0];
4035
SimpleFeatureSource source = store.getFeatureSource(name);
@@ -75,10 +70,7 @@ public void testBasicIndexing() throws Exception {
7570
public void testPrintShapefile() throws Exception {
7671

7772
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());
8274

8375
String name = store.getTypeNames()[0];
8476
System.out.println("TypeNames: " + Arrays.toString(store.getTypeNames()));

0 commit comments

Comments
 (0)