Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mayer
CircularGreenSimCity
Commits
bbf99ee0
Commit
bbf99ee0
authored
Apr 15, 2024
by
Eric Duminil
Browse files
More input params
parent
5afd8f90
Changes
3
Hide whitespace changes
Inline
Side-by-side
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/alkis/AlkisGreenEnricher.java
View file @
bbf99ee0
...
...
@@ -58,6 +58,9 @@ public class AlkisGreenEnricher
CityGMLWriteException
{
System
.
out
.
println
(
"Reading CityGML file"
);
Path
inFile
=
Paths
.
get
(
args
[
0
]);
Path
alkisDataPath
=
Paths
.
get
(
args
[
1
]);
Path
baumKatasterPath
=
Paths
.
get
(
args
[
2
]);
String
outputSuffix
=
args
[
3
];
CityModel
cityModel
=
GreenEnricher
.
readCityGml
(
inFile
);
GreenEnricher
.
createTransformers
(
cityModel
);
...
...
@@ -79,7 +82,7 @@ public class AlkisGreenEnricher
// ignore green areas from osm
osmData
.
getGreenAreas
().
clear
();
parseAlkisData
(
osmData
);
parseAlkisData
(
osmData
,
alkisDataPath
);
System
.
out
.
println
(
"Fit data in bounding box"
);
...
...
@@ -90,14 +93,14 @@ public class AlkisGreenEnricher
GreenEnricher
.
convertRoadAreasToCityGML
(
cityModel
,
osmData
);
GreenEnricher
.
converLandUseAreasToCityGML
(
cityModel
,
osmData
);
TreeUtils
.
insertTrees
(
cityModel
,
osmData
);
TreeUtils
.
insertTrees
(
cityModel
,
osmData
,
baumKatasterPath
);
GreenEnricher
.
clampToGround
(
cityModel
);
String
inputString
=
inFile
.
getFileName
().
toString
();
String
inputPathWithoutFileEnding
=
inputString
.
substring
(
0
,
inputString
.
lastIndexOf
(
'.'
));
Path
outputPath
=
Paths
.
get
(
"data"
,
inputPathWithoutFileEnding
+
"_
with_alkis_greens_realistic
.gml"
);
Path
outputPath
=
Paths
.
get
(
"data"
,
inputPathWithoutFileEnding
+
"_
"
+
outputSuffix
+
"
.gml"
);
System
.
out
.
println
(
"Writing output file."
);
GreenEnricher
.
writeCityGML
(
cityModel
,
outputPath
);
System
.
out
.
println
(
"Done"
);
...
...
@@ -105,8 +108,7 @@ public class AlkisGreenEnricher
}
private
static
void
parseAlkisData
(
OsmData
osmData
)
throws
MalformedURLException
,
IOException
{
Path
alkisDataPath
=
Paths
.
get
(
"data"
,
"tn_09663"
,
"Nutzung.shp"
);
private
static
void
parseAlkisData
(
OsmData
osmData
,
Path
alkisDataPath
)
throws
MalformedURLException
,
IOException
{
Map
<
String
,
Object
>
readParameters
=
new
HashMap
<>();
readParameters
.
put
(
"url"
,
alkisDataPath
.
toUri
().
toURL
());
...
...
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeUtils.java
View file @
bbf99ee0
package
de.hft.stuttgart.citygml.green.osm
;
import
java.io.IOException
;
import
java.nio.file.Path
s
;
import
java.nio.file.Path
;
import
java.util.Iterator
;
import
java.util.UUID
;
import
org.citygml4j.core.model.core.AbstractCityObjectProperty
;
...
...
@@ -16,9 +16,8 @@ import org.xmlobjects.gml.model.geometry.aggregates.MultiSurfaceProperty;
public
class
TreeUtils
{
public
static
void
insertTrees
(
CityModel
cityModel
,
OsmData
osmData
)
throws
IOException
{
TreeKatasterData
katasterData
=
TreeKatasterData
.
parseTreeKatasterData
(
Paths
.
get
(
"data"
,
"Trees"
,
"Trees_realisticScenario_20240201.shp"
));
public
static
void
insertTrees
(
CityModel
cityModel
,
OsmData
osmData
,
Path
baumKatasterPath
)
throws
IOException
{
TreeKatasterData
katasterData
=
TreeKatasterData
.
parseTreeKatasterData
(
baumKatasterPath
);
generateTreesFromKataster
(
cityModel
,
katasterData
);
// TreeKatasterData katasterData2 = TreeKatasterData.parseTreeKatasterData(Paths.get("data", "Trees_realistic_20240201.shp"));
...
...
enrich-citygml-with-greenarea/src/test/java/de/hft/stuttgart/citygml/green/alkis/AlkisGreenEnricherTest.java
View file @
bbf99ee0
...
...
@@ -5,12 +5,13 @@ import org.junit.jupiter.api.Test;
class
AlkisGreenEnricherTest
{
@Test
void
testAlkisGreen
()
throws
Exception
{
String
[]
args
=
new
String
[]
{
"data/Grombühl_v4_case_study.gml"
};
String
[]
args
=
new
String
[]
{
"data/Grombühl_v4_case_study.gml"
,
// Input GML
"data/tn_09663/Nutzung.shp"
,
// ALKIS Data
"data/Trees/Trees_realisticScenario_20240201.shp"
,
// Added trees, in Baumkatasterformat,
"with_alkis_greens_realistic"
// Output GML suffix
};
AlkisGreenEnricher
.
main
(
args
);
}
}
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