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
Show 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;
...
@@ -7,7 +7,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.geotools.data.DataStore
;
import
org.geotools.data.DataStore
;
import
org.geotools.data.DataStoreFinder
;
import
org.geotools.data.DataStoreFinder
;
import
org.geotools.data.FeatureSource
;
import
org.geotools.data.FeatureSource
;
...
@@ -17,7 +16,9 @@ import org.locationtech.jts.geom.Point;
...
@@ -17,7 +16,9 @@ import org.locationtech.jts.geom.Point;
import
org.opengis.feature.simple.SimpleFeature
;
import
org.opengis.feature.simple.SimpleFeature
;
import
org.opengis.feature.simple.SimpleFeatureType
;
import
org.opengis.feature.simple.SimpleFeatureType
;
public
class
TreeKatasterData
{
public
class
TreeKatasterData
{
public
static
final
double
TRUNK_PERCENTAGE
=
0.2
;
public
static
final
double
TRUNK_PERCENTAGE
=
0.2
;
public
static
final
double
CROWN_PERCENTAGE
=
1
-
TRUNK_PERCENTAGE
;
public
static
final
double
CROWN_PERCENTAGE
=
1
-
TRUNK_PERCENTAGE
;
...
@@ -50,7 +51,7 @@ public class TreeKatasterData {
...
@@ -50,7 +51,7 @@ public class TreeKatasterData {
if
(
treeHeightObject
==
null
)
{
if
(
treeHeightObject
==
null
)
{
continue
;
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
crownHeight
=
CROWN_PERCENTAGE
*
treeHeight
;
double
trunkHeight
=
TRUNK_PERCENTAGE
*
treeHeight
;
double
trunkHeight
=
TRUNK_PERCENTAGE
*
treeHeight
;
tree
.
setCrownHeight
(
crownHeight
);
tree
.
setCrownHeight
(
crownHeight
);
...
@@ -65,7 +66,7 @@ public class TreeKatasterData {
...
@@ -65,7 +66,7 @@ public class TreeKatasterData {
if
(
trunkCirc
==
null
)
{
if
(
trunkCirc
==
null
)
{
continue
;
continue
;
}
}
in
t
circInCm
=
Integer
.
parse
In
t
(
trunkCirc
.
toString
());
floa
t
circInCm
=
Float
.
parse
Floa
t
(
trunkCirc
.
toString
());
if
(
circInCm
==
0
)
{
if
(
circInCm
==
0
)
{
circInCm
=
89
;
circInCm
=
89
;
}
}
...
...
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