Commit 99103b53 authored by Eric Duminil's avatar Eric Duminil
Browse files

Notes and warnings.

parent 174696f3
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
static StringBuilder selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Path... citygmlPaths) static StringBuilder selectRegionDirectlyFromCityGML(String wktPolygon, String srsName, Path... citygmlPaths)
throws ParseException, XPathParseException, NavException, IOException { throws ParseException, XPathParseException, NavException, IOException {
//TODO: Should actually write directly to a bufferedwriter
//TODO: Should return the number of found buildings.
int buildingsCount = 0; int buildingsCount = 0;
int foundBuildingsCount = 0; int foundBuildingsCount = 0;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -75,13 +78,16 @@ static StringBuilder selectRegionDirectlyFromCityGML(String wktPolygon, String s ...@@ -75,13 +78,16 @@ static StringBuilder selectRegionDirectlyFromCityGML(String wktPolygon, String s
LOGGER.info("1000 buildings parsed"); LOGGER.info("1000 buildings parsed");
} }
} }
} }
if (citygml == null) { if (citygml == null) {
throw new IllegalArgumentException("There should be at least one citygml"); throw new IllegalArgumentException("There should be at least one citygml");
} }
if (foundBuildingsCount == 0) {
LOGGER.warning("No building found in the selected region.");
}
LOGGER.info("Buildings found in selected region " + foundBuildingsCount); LOGGER.info("Buildings found in selected region " + foundBuildingsCount);
sb.append(citygml.getFooter()); sb.append(citygml.getFooter());
return sb; return sb;
......
...@@ -69,7 +69,7 @@ var regionChooser = (function(){ ...@@ -69,7 +69,7 @@ var regionChooser = (function(){
dataPanel.append('.'); dataPanel.append('.');
srsName = feature.get("srsName"); srsName = feature.get("srsName");
if (proj4.defs(srsName) === undefined){ if (proj4.defs(srsName) === undefined){
console.warning(srsName + " isn't defined by Proj4js!") console.warn(srsName + " isn't defined by Proj4js!")
} }
}; };
...@@ -246,7 +246,7 @@ var regionChooser = (function(){ ...@@ -246,7 +246,7 @@ var regionChooser = (function(){
fxapp.downloadRegionFromCityGMLs(sketchAsWKT(srsName), project, citygmlNames.join(";"), srsName); fxapp.downloadRegionFromCityGMLs(sketchAsWKT(srsName), project, citygmlNames.join(";"), srsName);
dataPanel.prepend("<h2 class='ok'>Done!</h2><br/>\n"); dataPanel.prepend("<h2 class='ok'>Done!</h2><br/>\n");
} catch (e) { } catch (e) {
console.warning("ERROR : " + e); console.warn("ERROR : " + e);
dataPanel.prepend("<h2 class='error'>Some problem occured!</h2><br/>\n"); dataPanel.prepend("<h2 class='error'>Some problem occured!</h2><br/>\n");
} }
var end = new Date().getTime(); var end = new Date().getTime();
...@@ -327,7 +327,7 @@ var regionChooser = (function(){ ...@@ -327,7 +327,7 @@ var regionChooser = (function(){
fxapp.log(message); fxapp.log(message);
} }
console.warning = function(message){ console.warn = function(message){
fxapp.warning(message); fxapp.warning(message);
} }
} }
...@@ -411,7 +411,7 @@ var regionChooser = (function(){ ...@@ -411,7 +411,7 @@ var regionChooser = (function(){
return; return;
} }
catch (ex) { catch (ex) {
console.warning("Copy to clipboard failed.", ex); console.warn("Copy to clipboard failed.", ex);
return prompt("Copy to clipboard: Ctrl+C, Enter", text); return prompt("Copy to clipboard: Ctrl+C, Enter", text);
} }
finally { finally {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment