Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
af8031da
Commit
af8031da
authored
2 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Notes.
parent
30b3cb26
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+6
-3
...tadt/regionchooser/RegionChooserCommandLineInterface.java
src/main/java/eu/simstadt/regionchooser/fast_xml_parser/BuildingXmlNode.java
+2
-1
...mstadt/regionchooser/fast_xml_parser/BuildingXmlNode.java
with
8 additions
and
4 deletions
+8
-4
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
+
6
-
3
View file @
af8031da
...
...
@@ -6,6 +6,7 @@
import
java.nio.file.Paths
;
import
java.util.Scanner
;
import
java.util.concurrent.Callable
;
import
java.util.logging.Logger
;
import
org.locationtech.jts.geom.Polygon
;
import
org.locationtech.jts.io.WKTReader
;
import
org.locationtech.jts.io.WKTWriter
;
...
...
@@ -23,6 +24,9 @@
@Command
(
name
=
"region_chooser"
,
mixinStandardHelpOptions
=
true
,
version
=
"regionChooser x.x"
,
description
=
"Extracts a region from one or more citygmls."
,
sortOptions
=
false
)
class
RegionChooserCommandLineInterface
implements
Callable
<
Integer
>
{
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
RegionChooserCommandLineInterface
.
class
.
getName
());
@Option
(
names
=
{
"-i"
,
"--input"
},
required
=
true
,
split
=
","
,
description
=
"Citygml files to extract from"
,
paramLabel
=
"input.gml"
)
//TODO: Allow folders too?
...
...
@@ -47,7 +51,6 @@ class RegionChooserCommandLineInterface implements Callable<Integer>
public
Integer
call
()
throws
Exception
{
//TODO: Move as much logic to utils as possible
//TODO: Test
//TODO: Use logger
CoordinateReferenceSystem
localCRS
;
if
(
espgId
==
null
)
{
...
...
@@ -55,7 +58,7 @@ public Integer call() throws Exception {
}
else
{
localCRS
=
RegionChooserUtils
.
crsFromSrsName
(
"EPSG:"
+
espgId
);
}
System
.
out
.
println
(
"Coordinate system
is
"
+
localCRS
);
LOGGER
.
info
(
"Coordinate system
:
"
+
localCRS
);
String
wktPolygon
;
...
...
@@ -81,7 +84,7 @@ public Integer call() throws Exception {
.
write
(
RegionChooserUtils
.
changePolygonCRS
(
wgs84Polygon
,
RegionChooserUtils
.
WGS84
,
localCRS
));
}
System
.
out
.
println
(
"WKT Polygon
: "
+
wktPolygon
);
LOGGER
.
info
(
"WKT Polygon expressed in local coordinates
: "
+
wktPolygon
);
StringBuilder
sb
=
RegionExtractor
.
selectRegionDirectlyFromCityGML
(
wktPolygon
,
localCRS
.
toString
(),
citygmls
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/eu/simstadt/regionchooser/fast_xml_parser/BuildingXmlNode.java
+
2
-
1
View file @
af8031da
...
...
@@ -28,7 +28,8 @@ public BuildingXmlNode(VTDNav navigator, int buildingOffset, int buildingLength)
this
.
coordinatesFinder
=
new
AutoPilot
(
navigator
);
this
.
buildingLength
=
buildingLength
;
this
.
buildingOffset
=
buildingOffset
;
extractCoordinates
();
//NOTE: Should it be done lazily? Is there any reason to extract a BuildingXmlNode without coordinates?
extractCoordinates
();
//TODO: Get Building ID too, in order to avoid duplicates?
}
public
boolean
hasCoordinates
()
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets