Commit 0e2b56e4 authored by duminil's avatar duminil
Browse files

RegionChooser: Adding "EPSG:31467" to Citygml from NovaFactory if needed

parent 2eb7a48c
......@@ -40,8 +40,6 @@ public void processJob(Geometry poly, String productName, JSObject novaFactoryOp
description.setProduct(productName);
description.setJobnumber(userName);
//FIXME: Zipped GMLs coming from nF don't have any defined srsName
ArrayList<Coord> regionPolygon = new ArrayList<>();
for (Coordinate point : poly.getCoordinates()) {
......
......@@ -3,9 +3,9 @@
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
......@@ -106,15 +106,15 @@ public void extractZIPtoGML(String zipFilename) throws IOException {
zeName.replace("_GML.", ".").replace(userName, "novaFACTORY"), "");
if (extractedCityGML != null) {
InputStream cityGMLInputStream = zipFile.getInputStream(ze);
// System.out.println("Extract zipFile " + zipFilename + " to " + extractedCityGML);
FileOutputStream fos = new FileOutputStream(extractedCityGML);
byte[] bytes = new byte[1024];
int length;
while ((length = cityGMLInputStream.read(bytes)) >= 0) {
fos.write(bytes, 0, length);
BufferedReader cityGMLZipReader = new BufferedReader(new InputStreamReader(cityGMLInputStream));
BufferedWriter cityGMLOutput = Files.newBufferedWriter(extractedCityGML.toPath());
String buf = null;
while ((buf = cityGMLZipReader.readLine()) != null) {
cityGMLOutput.write(buf.replace("srsName=\"\"", "srsName=\"EPSG:31467\""));
}
cityGMLZipReader.close();
cityGMLInputStream.close();
fos.close();
cityGMLOutput.close();
System.out.println("Extracted");
}
}
......
Supports Markdown
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