Commit 4fa81329 authored by Eric Duminil's avatar Eric Duminil
Browse files

Replacing eu.simstadt.geo with eu.simstadt.regionchooser to avoid conflict with SimStadt packages

parent c8bf6133
Pipeline #668 failed with stage
......@@ -4,7 +4,7 @@
<groupId>eu.simstadt</groupId>
<artifactId>region-chooser</artifactId>
<version>0.2.0-SNAPSHOT</version>
<version>0.2.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
......@@ -12,7 +12,7 @@
import com.ximpleware.NavException;
import com.ximpleware.XPathEvalException;
import com.ximpleware.XPathParseException;
import eu.simstadt.geo.fast_xml_parser.ConvexHullCalculator;
import eu.simstadt.regionchooser.fast_xml_parser.ConvexHullCalculator;
import javafx.application.Platform;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Task;
......
package eu.simstadt.geo;
package eu.simstadt.regionchooser;
import java.io.IOException;
import java.nio.file.Files;
......
......@@ -15,8 +15,8 @@
import com.ximpleware.NavException;
import com.ximpleware.XPathEvalException;
import com.ximpleware.XPathParseException;
import eu.simstadt.geo.fast_xml_parser.BuildingXmlNode;
import eu.simstadt.geo.fast_xml_parser.CityGmlIterator;
import eu.simstadt.regionchooser.fast_xml_parser.BuildingXmlNode;
import eu.simstadt.regionchooser.fast_xml_parser.CityGmlIterator;
public class RegionExtractor
......
package eu.simstadt.geo.fast_xml_parser;
package eu.simstadt.regionchooser.fast_xml_parser;
import com.ximpleware.AutoPilot;
import com.ximpleware.NavException;
......
package eu.simstadt.geo.fast_xml_parser;
package eu.simstadt.regionchooser.fast_xml_parser;
import java.io.IOException;
import java.nio.file.Files;
......@@ -29,11 +29,12 @@ public class CityGmlIterator implements Iterable<BuildingXmlNode>
* is extracted. Not suitable for building simulation, perfect for quick and dirty extract of coordinates (e.g. for
* RegionChooser or HullExtractor). It should be fast and not use much memory. A SaxParser would use even less memory
* but might be harder to code and possibly slower to run.
*
* For a more complete and more robust (but slower) implementation, use eu.simstadt.geo.GeoCoordinatesAccessor
*
*
* For a more complete and more robust (but slower) implementation, use eu.simstadt.geo.GeoCoordinatesAccessor in
* SimStadt geo-libs.
*
* Based on VTD XML, it provides a Building iterator.
*
*
*/
public CityGmlIterator(Path citygmlPath) throws XPathParseException {
this.citygmlPath = citygmlPath;
......@@ -81,7 +82,7 @@ public void remove() {
/**
* Returns Header of the Citygml, from the start of the file to the current building. This method needs to be called
* directly after the first building has been found.
*
*
* @return Citygml header
* @throws NavException
*/
......@@ -92,7 +93,7 @@ public String getHeader() throws NavException {
/**
* Returns footer of the Citygml, from the end of the last building to the end of file. This method needs to be
* called after the last building has been found.
*
*
* @return Citygml footer
* @throws NavException
*/
......
package eu.simstadt.geo.fast_xml_parser;
package eu.simstadt.regionchooser.fast_xml_parser;
import java.io.BufferedWriter;
import java.io.IOException;
......@@ -18,7 +18,7 @@
import org.locationtech.jts.geom.Polygon;
import org.osgeo.proj4j.CoordinateReferenceSystem;
import com.ximpleware.XPathParseException;
import eu.simstadt.geo.RegionChooserUtils;
import eu.simstadt.regionchooser.RegionChooserUtils;
public class ConvexHullCalculator
......@@ -30,19 +30,19 @@
* size is less than 2GB (VTD XML limitation). It iterates over every building, gets the bounding box as 4
* coordinates and calculates a convex hull of all those coordinates at the end of the iteration. It finally converts
* this convex hull to WGS84 coordinates.
*
*
* The convex hull is needed for RegionChooser. No SimstadtModel or CityDoctor model is needed, thanks to
* eu.simstadt.geo.fast_xml_parser.CityGmlIterator.
*
* eu.simstadt.regionchooser.fast_xml_parser.CityGmlIterator.
*
* E.g. : POLYGON ((9.219282617376651 48.876828283254675, 9.2175568365387 48.87695546490524, 9.213228008654541
* 48.87741235218009, 9.21293830332426 48.8774437308139, 9.212628150503749 48.87995232037036, 9.21263222062228
* 48.880912500705406, 9.213601288895058 48.88138432918416, 9.213701498914048 48.8813841435154, 9.217160380858063
* 48.88092123714512, 9.217396359933812 48.88085245173012, 9.217558989421159 48.880784074008496, 9.219328059150042
* 48.879894270949485, 9.219367632516049 48.876847095121995, 9.219367549551574 48.87682812171015, 9.219282617376651
* 48.876828283254675))
*
*
* for "20140218_Gruenbuehl_LOD2.gml"
*
*
* @param citygmlPath
* @return convex Hull as jts.geom.Geometry, with the originalCRS written in userData.
*/
......@@ -68,7 +68,8 @@ public static Geometry calculateFromCityGML(Path citygmlPath) throws XPathParseE
Polygon originalConvexHull = (Polygon) ch.getConvexHull();
CoordinateReferenceSystem originalCRS = RegionChooserUtils.crsFromCityGMLHeader(citygmlPath);
Polygon convexHull = RegionChooserUtils.changePolygonCRS(originalConvexHull, originalCRS, RegionChooserUtils.WGS84);
Polygon convexHull = RegionChooserUtils.changePolygonCRS(originalConvexHull, originalCRS,
RegionChooserUtils.WGS84);
convexHull.setUserData(originalCRS.toString());
return convexHull;
}
......@@ -76,9 +77,9 @@ public static Geometry calculateFromCityGML(Path citygmlPath) throws XPathParseE
/**
* Finds every CityGML in a folder recursively, extract their convex hull and send them to callback. Used by
* RegionChooser Javascript to display the CityGMLs.
*
*
* If hull has been extracted, get it from cache, calculate it otherwise.
*
*
* @param repository
* @param callback
* @throws IOException
......@@ -116,7 +117,7 @@ public static void extractHullsForEveryCityGML(Path repository, Consumer<String>
* Writes a KML cache file for the convex hull of a CityGML file and returns the KML content as string. Depending on
* throwIfError, the method will either ignore any problem (and write the message inside the KML file (preventing the
* process from happening again next time) or stop the process, without returning or caching anything.
*
*
* @param gmlPath
* @param kmlPath
* @param throwIfError
......@@ -187,10 +188,10 @@ public static String calculateConvexHullPlacemark(Path gmlPath, Path kmlPath, bo
* For a given CityGML Path, returns the Path at which KML hull should be cached. If needed it creates the '.cache'
* folder and hides it. The '.cache' folder isn't specific to the project: every kml cache file is written inside the
* same repository '.cache' folder.
*
*
* @param repository
* @param citygmlPath
*
*
* @return KML Path
* @throws IOException
*/
......
......@@ -6,7 +6,6 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.jupiter.api.Test;
import eu.simstadt.geo.RegionChooserUtils;
public class CRSfromCityGMLHeaderTests
......
......@@ -15,7 +15,6 @@
import com.ximpleware.NavException;
import com.ximpleware.XPathEvalException;
import com.ximpleware.XPathParseException;
import eu.simstadt.geo.RegionChooserUtils;
public class RegionExtractorWithDifferentInputTests
......
package eu.simstadt.geo.fast_xml_parser;
package eu.simstadt.regionchooser.fast_xml_parser;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
......@@ -7,6 +7,8 @@
import java.nio.file.Paths;
import org.junit.jupiter.api.Test;
import com.ximpleware.XPathParseException;
import eu.simstadt.regionchooser.fast_xml_parser.BuildingXmlNode;
import eu.simstadt.regionchooser.fast_xml_parser.CityGmlIterator;
public class CitygmlParserTests
......
package eu.simstadt.geo.fast_xml_parser;
package eu.simstadt.regionchooser.fast_xml_parser;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
......@@ -15,7 +15,8 @@
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import com.ximpleware.XPathParseException;
import eu.simstadt.geo.RegionChooserUtils;
import eu.simstadt.regionchooser.RegionChooserUtils;
import eu.simstadt.regionchooser.fast_xml_parser.ConvexHullCalculator;
public class ConvexHullCalculatorTests
......
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