Changes according to remarks (#2624)
This commit is contained in:
parent
231500bbf6
commit
02c5135867
|
@ -41,9 +41,7 @@ public class ShapeFile {
|
|||
|
||||
SimpleFeatureType CITY = createFeatureType();
|
||||
|
||||
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(CITY);
|
||||
|
||||
addLocations(featureBuilder, collection);
|
||||
addLocations(CITY, collection);
|
||||
|
||||
File shapeFile = getNewShapeFile();
|
||||
|
||||
|
@ -72,7 +70,7 @@ public class ShapeFile {
|
|||
return CITY;
|
||||
}
|
||||
|
||||
public static void addLocations(SimpleFeatureBuilder featureBuilder, DefaultFeatureCollection collection) {
|
||||
public static void addLocations(SimpleFeatureType CITY, DefaultFeatureCollection collection) {
|
||||
|
||||
Map<String, List<Double>> locations = new HashMap<>();
|
||||
|
||||
|
@ -113,8 +111,10 @@ public class ShapeFile {
|
|||
.get(0),
|
||||
location.getValue()
|
||||
.get(1)));
|
||||
|
||||
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(CITY);
|
||||
featureBuilder.add(point);
|
||||
featureBuilder.add(name);
|
||||
featureBuilder.add(location.getKey());
|
||||
SimpleFeature feature = featureBuilder.buildFeature(null);
|
||||
collection.add(feature);
|
||||
}
|
||||
|
|
|
@ -16,9 +16,7 @@ public class GeoToolsUnitTest {
|
|||
|
||||
SimpleFeatureType CITY = ShapeFile.createFeatureType();
|
||||
|
||||
SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(CITY);
|
||||
|
||||
ShapeFile.addLocations(featureBuilder, collection);
|
||||
ShapeFile.addLocations(CITY, collection);
|
||||
|
||||
assertNotNull(collection);
|
||||
|
||||
|
|
Loading…
Reference in New Issue