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
d2fd154a
Commit
d2fd154a
authored
May 11, 2024
by
Eric Duminil
Browse files
Allow floats too
parent
7a083c59
Changes
1
Hide whitespace changes
Inline
Side-by-side
enrich-citygml-with-greenarea/src/main/java/de/hft/stuttgart/citygml/green/osm/TreeKatasterData.java
View file @
d2fd154a
...
...
@@ -7,7 +7,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.geotools.data.DataStore
;
import
org.geotools.data.DataStoreFinder
;
import
org.geotools.data.FeatureSource
;
...
...
@@ -17,13 +16,15 @@ import org.locationtech.jts.geom.Point;
import
org.opengis.feature.simple.SimpleFeature
;
import
org.opengis.feature.simple.SimpleFeatureType
;
public
class
TreeKatasterData
{
public
class
TreeKatasterData
{
public
static
final
double
TRUNK_PERCENTAGE
=
0.2
;
public
static
final
double
CROWN_PERCENTAGE
=
1
-
TRUNK_PERCENTAGE
;
private
List
<
Tree
>
trees
;
public
static
TreeKatasterData
parseTreeKatasterData
(
Path
path
)
throws
IOException
{
TreeKatasterData
result
=
new
TreeKatasterData
();
Map
<
String
,
Object
>
readParameters
=
new
HashMap
<>();
...
...
@@ -50,7 +51,7 @@ public class TreeKatasterData {
if
(
treeHeightObject
==
null
)
{
continue
;
}
in
t
treeHeight
=
Integer
.
parse
In
t
(
treeHeightObject
.
toString
());
floa
t
treeHeight
=
Float
.
parse
Floa
t
(
treeHeightObject
.
toString
());
double
crownHeight
=
CROWN_PERCENTAGE
*
treeHeight
;
double
trunkHeight
=
TRUNK_PERCENTAGE
*
treeHeight
;
tree
.
setCrownHeight
(
crownHeight
);
...
...
@@ -65,7 +66,7 @@ public class TreeKatasterData {
if
(
trunkCirc
==
null
)
{
continue
;
}
in
t
circInCm
=
Integer
.
parse
In
t
(
trunkCirc
.
toString
());
floa
t
circInCm
=
Float
.
parse
Floa
t
(
trunkCirc
.
toString
());
if
(
circInCm
==
0
)
{
circInCm
=
89
;
}
...
...
@@ -75,7 +76,7 @@ public class TreeKatasterData {
}
return
result
;
}
public
List
<
Tree
>
getTrees
()
{
if
(
trees
==
null
)
{
trees
=
new
ArrayList
<>();
...
...
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