Skip to content
GitLab
Menu
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
Oct 10, 2022
by
Eric Duminil
Browse files
Notes.
parent
30b3cb26
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/eu/simstadt/regionchooser/RegionChooserCommandLineInterface.java
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
);
...
...
src/main/java/eu/simstadt/regionchooser/fast_xml_parser/BuildingXmlNode.java
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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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