Changeset 33800 for other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java
- Timestamp:
- 2019-12-12T18:04:10+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java
r33799 r33800 248 248 } 249 249 250 251 250 // create rectangular "histogram" for each country code 252 251 private Geometry toPolygon(JsonObject json, int count, int HISTOGRAM_WIDTH) { … … 337 336 Writer writer = new BufferedWriter(new FileWriter(outFile)); 338 337 ) { 339 340 341 //multiPointGeojsonString = multiPointGeojsonString.replace("[[", "\n[\n\t[");342 //multiPointGeojsonString = multiPointGeojsonString.replace("],[", "],\n\t[");343 //multiPointGeojsonString = multiPointGeojsonString.replace("]]", "]\n]");344 338 345 339 writer.write(featuresGeojsonString + "\n"); … … 356 350 357 351 352 public int getTotalCount() { 353 int total = 0; 354 for(JsonElement obj : this.countryCountsJsonArray) { 355 JsonObject json = obj.getAsJsonObject(); 356 int count = json.get("count").getAsInt(); 357 total += count; 358 } 359 return total; 360 } 361 362 358 363 // Unfinished and unused 359 364 public void parseCSVFile(String filename) throws Exception { … … 381 386 CountryCodeCountsMapData mapData = new CountryCodeCountsMapData(args[0], args[1]); 382 387 383 //Geometry geometry = mapData.toMultiPointGeoJSON();384 //String multiPointGeojsonString = FeatureConverter.toStringValue(geometry);385 //System.err.println("geometry: " + multiPointGeojsonString);386 387 388 String multipointOutFileName = mapData.writeMultiPointGeoJsonToFile(parentFolder); 388 389 String featuresOutFileName = mapData.writeFeaturesGeoJsonToFile(parentFolder); 390 389 391 System.err.println("***********\nWrote mapdata to files " + multipointOutFileName 390 392 + " and " + featuresOutFileName); … … 392 394 + "editor at http://geojson.tools/ to see the data arranged on a world map"); 393 395 396 System.err.println("Total count for query: " + mapData.getTotalCount()); 397 394 398 } catch(Exception e) { 395 399 logger.error(e.getMessage(), e);
Note:
See TracChangeset
for help on using the changeset viewer.