Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CircularGreenSimCity
CircularGreenSimCity
Commits
fa2435d1
Commit
fa2435d1
authored
Mar 10, 2025
by
Eric Duminil
Browse files
Allow to specify where cache is written, or gml files are written
parent
4e7e3e72
Changes
1
Hide whitespace changes
Inline
Side-by-side
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/GreenEnricher.java
View file @
fa2435d1
...
...
@@ -90,6 +90,12 @@ public class GreenEnricher implements Runnable
@Option
(
names
=
{
"-w"
,
"--wkt"
},
description
=
"Optional WKT polygon to cut the region after processing."
)
private
String
wkt
;
@Option
(
names
=
{
"--output"
},
description
=
"Optional location for output folder"
,
defaultValue
=
"data/"
)
private
Path
outputFolder
;
@Option
(
names
=
{
"--cache"
},
description
=
"Optional location for cache folder"
,
defaultValue
=
"data/cache"
)
private
Path
cacheFolder
;
public
static
void
main
(
String
[]
args
)
{
new
CommandLine
(
new
GreenEnricher
()).
execute
(
args
);
...
...
@@ -167,7 +173,7 @@ public class GreenEnricher implements Runnable
OsmData
osmData
=
new
OsmData
();
String
boundingBoxString
=
GreenEnricher
.
extractAndConvertBoundingBox
(
cityModel
,
osmData
);
String
boundingBoxBasename
=
boundingBoxString
.
replace
(
","
,
"__"
).
replace
(
'.'
,
'_'
);
Path
osmCache
=
Paths
.
get
(
"data"
,
"cache"
,
"osm_response_"
+
boundingBoxBasename
+
".xml"
);
Path
osmCache
=
cacheFolder
.
resolve
(
"osm_response_"
+
boundingBoxBasename
+
".xml"
);
if
(!
Files
.
exists
(
osmCache
))
{
System
.
out
.
println
(
"Downloading OSM data for "
+
boundingBoxString
);
HttpResponse
<
String
>
response
=
GreenEnricher
.
getOsmData
(
boundingBoxString
);
...
...
@@ -200,7 +206,7 @@ public class GreenEnricher implements Runnable
String
inputString
=
citygmlInput
.
getFileName
().
toString
();
String
inputPathWithoutFileEnding
=
inputString
.
substring
(
0
,
inputString
.
lastIndexOf
(
'.'
));
Path
outputPath
=
Paths
.
get
(
"data"
,
inputPathWithoutFileEnding
+
"_"
+
outputSuffix
+
".gml"
);
Path
outputPath
=
outputFolder
.
resolve
(
inputPathWithoutFileEnding
+
"_"
+
outputSuffix
+
".gml"
);
System
.
out
.
println
(
"Writing output file to "
+
outputPath
);
writeCityGML
(
cityModel
,
outputPath
);
System
.
out
.
println
(
"Done"
);
...
...
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