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