Changes according to remarks (#2624)

This commit is contained in:
dimitarsazdovski 2017-09-15 21:14:44 +02:00 committed by Grzegorz Piwowarek
parent 231500bbf6
commit 02c5135867
2 changed files with 6 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);