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
eb6b5464
Commit
eb6b5464
authored
Mar 27, 2024
by
Matthias Betz
Browse files
update green enricher
parent
9ae6dab1
Changes
4
Hide whitespace changes
Inline
Side-by-side
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/alkis/AlkisGreenEnricher.java
View file @
eb6b5464
...
...
@@ -91,7 +91,7 @@ public class AlkisGreenEnricher {
String
inputString
=
inFile
.
getFileName
().
toString
();
String
inputPathWithoutFileEnding
=
inputString
.
substring
(
0
,
inputString
.
lastIndexOf
(
'.'
));
Path
outputPath
=
Paths
.
get
(
"data"
,
inputPathWithoutFileEnding
+
"_with_alkis_greens.gml"
);
Path
outputPath
=
Paths
.
get
(
"data"
,
inputPathWithoutFileEnding
+
"_with_alkis_greens
_realistic
.gml"
);
System
.
out
.
println
(
"Writing output file."
);
GreenEnricher
.
writeCityGML
(
cityModel
,
outputPath
);
System
.
out
.
println
(
"Done"
);
...
...
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java
View file @
eb6b5464
...
...
@@ -65,8 +65,11 @@ public class TreeKatasterData {
if
(
trunkCirc
==
null
)
{
continue
;
}
tree
.
setTrunkRadius
(
Integer
.
parseInt
(
trunkCirc
.
toString
())
/
(
2
*
Math
.
PI
)
/
100
);
int
circInCm
=
Integer
.
parseInt
(
trunkCirc
.
toString
());
if
(
circInCm
==
0
)
{
circInCm
=
89
;
}
tree
.
setTrunkRadius
(
circInCm
/
(
2
*
Math
.
PI
)
/
100
);
result
.
getTrees
().
add
(
tree
);
}
}
...
...
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeUtils.java
View file @
eb6b5464
...
...
@@ -16,11 +16,15 @@ 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"
,
"
Baum
.shp"
));
TreeKatasterData
katasterData
=
TreeKatasterData
.
parseTreeKatasterData
(
Paths
.
get
(
"data"
,
"
Trees_realisticScenario_20240201
.shp"
));
generateTreesFromKataster
(
cityModel
,
katasterData
);
// TreeKatasterData katasterData2 = TreeKatasterData.parseTreeKatasterData(Paths.get("data", "Trees_realistic_20240201.shp"));
// generateTreesFromKataster(cityModel, katasterData2);
// All kataster trees are taken, osm trees are removed
filterDuplicateTreesFromOSM
(
osmData
,
katasterData
);
// filterDuplicateTreesFromOSM(osmData, katasterData2);
generateTreesFromOSM
(
cityModel
,
osmData
);
...
...
@@ -52,7 +56,7 @@ public class TreeUtils {
MultiSurface
generatedTree
=
TreeGenerator
.
generateTree
(
coordinate
,
trunkRadius
,
trunkHeight
,
crownRadius
,
crownRadius
,
crownHeight
);
SolitaryVegetationObject
cover
=
new
SolitaryVegetationObject
();
cover
.
setSpecies
(
new
Code
(
"Acer
campestre
"
));
cover
.
setSpecies
(
new
Code
(
"Acer
platanoides
"
));
cover
.
setId
(
UUID
.
randomUUID
().
toString
());
cover
.
setLod2MultiSurface
(
new
MultiSurfaceProperty
(
generatedTree
));
cityModel
.
getCityObjectMembers
().
add
(
new
AbstractCityObjectProperty
(
cover
));
...
...
enrich-citygml-with-greenarea/src/test/java/de/hft/stuttgart/citygml/green/alkis/AlkisGreenEnricherTest.java
View file @
eb6b5464
...
...
@@ -13,7 +13,7 @@ class AlkisGreenEnricherTest {
@Test
void
testAlkisGreen
()
throws
IOException
,
CityGMLContextException
,
CityGMLReadException
,
JAXBException
,
CityGMLWriteException
{
String
[]
args
=
new
String
[]
{
"data/Grombühl_v
3
.gml"
};
String
[]
args
=
new
String
[]
{
"data/Grombühl_v
4_case_study
.gml"
};
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