Commit bd4ca534 authored by duminil's avatar duminil
Browse files

Citygml project and name from kml.

parent f99a7d28
......@@ -50,19 +50,12 @@ public void downloadRegion(String wktPolygon) {
System.out.println("FROM JAVA : DO SOMETHING with " + wktPolygon);
}
public void downloadRegionFromCityGML(String wktPolygon, String citygmlDescription) {
System.out.println("FROM JAVA : DO SOMETHING with " + wktPolygon + " from \n" + citygmlDescription);
public void downloadRegionFromCityGML(String wktPolygon, String project, String citygml) {
System.out.println("FROM JAVA : DO SOMETHING with " + wktPolygon + " from \n" + project + ">" + citygml);
}
public boolean checkIfCityGMLSAreAvailable(String citygmlDescription) {
boolean available = false;
String[] projectAndCityGML = citygmlDescription.split(">");
if (projectAndCityGML.length == 2) {
String project = projectAndCityGML[0];
String citygml = projectAndCityGML[1];
available = Files.isReadable(repo.resolve(project + ".simstadt").resolve(citygml));
}
return available;
public boolean checkIfCityGMLSAreAvailable(String project, String citygml) {
return Files.isReadable(repo.resolve(project + ".simstadt").resolve(citygml));
}
}
......
This diff is collapsed.
......@@ -62,9 +62,12 @@ kml_layer.addEventListener("change", function(event) {
kml_source.forEachFeature(function(feature) {
feature["geoJSON"] = geoJSONformat.writeFeatureObject(feature);
feature["area"] = feature.getGeometry().getArea();
var project = feature.get("project");
var name = feature.get("name");
feature["description"] = project + ">" + name;
var citygmlHere;
if (fromJavaFX) {
citygmlHere = fxapp.checkIfCityGMLSAreAvailable(feature.get("description"));
citygmlHere = fxapp.checkIfCityGMLSAreAvailable(project,name);
}
feature["available"] = citygmlHere;
});
......@@ -147,10 +150,10 @@ function findIntersections() {
var description;
if (feature["available"]) {
description = "<a href=\"#\" onclick=\"downloadRegionFromCityGML(" + i
+ ");return false;\">"+feature.get('description')+"</a>";
description = "<a href=\"#\" onclick=\"downloadRegionFromCityGML(" + i + ");return false;\">"
+ feature["description"] + "</a>";
} else {
description = feature.get('description');
description = feature['description'];
}
$('#dataPanel').append(description + " (" + citygml_percentage + "%");
......@@ -171,7 +174,8 @@ function findIntersections() {
}
function downloadRegionFromCityGML(i) {
fxapp.downloadRegionFromCityGML(sketchAsWKT(), kml_source.getFeatures()[i].get("description"));
var feature = kml_source.getFeatures()[i];
fxapp.downloadRegionFromCityGML(sketchAsWKT(), feature.get("project"), feature.get("name"));
}
function displayInfo() {
......
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