Changeset 33925
- Timestamp:
- 2020-02-14T20:41:20+13:00 (4 years ago)
- Location:
- other-projects/maori-lang-detection/src/org/greenstone/atea
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java
r33919 r33925 629 629 // Want to return encodeURIComponent(JSON.stringify(featuresGeojsonString)); 630 630 // https://stackoverflow.com/questions/607176/java-equivalent-to-javascripts-encodeuricomponent-that-produces-identical-outpu 631 URLEncoder.encode(featuresGeojsonString); 631 featuresGeojsonString = URLEncoder.encode(featuresGeojsonString); 632 632 633 } 633 634 return featuresGeojsonString; … … 649 650 650 651 String mapURL = this.getAsMapURL(); 651 652 String mapURLescapedForBash = mapURL.replace("\"", "\\\"");//.replace("[", "\\[").replace("]", "\\]"); 652 ///String mapURLescapedForBash = .replace("\"", "\\\"");//.replace("[", "\\[").replace("]", "\\]"); 653 654 // Testing the geojson.io URL with a simpler polygon. Also doesn't work. 655 //String mapURL = GEOJSON_MAP_TOOL_URL + DATA_STR + URLEncoder.encode("{\"type\":\"Polygon\",\"coordinates\":[[[-77,37],[-77,38],[-76,38],[-76,37],[-77,37]]]}"); 656 653 657 654 658 File outputFile = new File(outputFolder + File.separator + fileNamePrefix+".png"); 655 659 String outputFilePath = Utility.getFilePath(outputFile); 656 660 657 658 661 String[] cmdArgs = { 659 662 "firefox", 660 663 "--screenshot", 661 664 outputFilePath, 662 mapURL escapedForBash //"'" + mapURL + "'"665 mapURL //mapURLescapedForBash //"'" + mapURL + "'" 663 666 }; 664 667 668 669 System.err.println(); 665 670 System.err.print("Running:"); 666 671 for(String arg : cmdArgs) { … … 673 678 //String cmdArgs = "firefox --screenshot " + outputFilePath + " " + "'" + mapURL + "'"; 674 679 //System.err.println("Running: " + cmdArgs); 680 681 System.err.println(); 675 682 676 683 SafeProcess proc = new SafeProcess(cmdArgs); -
other-projects/maori-lang-detection/src/org/greenstone/atea/SummaryTool.java
r33924 r33925 439 439 SafeProcess p = new SafeProcess(cmdArgs); 440 440 int retVal = p.runProcess(); 441 logger.info("Json Validation tool returned with value: " + retVal); 442 logger.info(" std out: " + p.getStdOutput()); 443 logger.info(" std err: " + p.getStdError()); 441 logger.info("\nJson validation tool returned with value: " + retVal); 442 if(retVal == 0) { 443 logger.info("Valid geo json."); 444 } else { 445 logger.error(" std out: " + p.getStdOutput()); 446 logger.error(" std err: " + p.getStdError()); 447 logger.error("INVALID geo json generated. Not attempting screenshot of map."); 448 continue; 449 } 444 450 445 451
Note:
See TracChangeset
for help on using the changeset viewer.