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