Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eric Duminil
RegionChooser
Commits
90070463
Commit
90070463
authored
Apr 21, 2017
by
duminil
Browse files
Buildings and trees.
parent
01bb185d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/eu/simstadt/regionchooser/test/CitygmlParserTests.java
0 → 100644
View file @
90070463
package
eu.simstadt.regionchooser.test
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
org.junit.Test
;
import
eu.simstadt.regionchooser.citygml_parser.BuildingXmlNode
;
import
eu.simstadt.regionchooser.citygml_parser.CityGmlIterator
;
public
class
CitygmlParserTests
{
@Test
public
void
testExtractCoordsFromStuttgart
()
throws
Throwable
{
Path
repo
=
Paths
.
get
(
"../TestRepository"
);
Path
citygmlPath
=
repo
.
resolve
(
"Stuttgart.proj/Stuttgart_buildings_and_trees.gml"
);
CityGmlIterator
buildingXmlNodes
=
new
CityGmlIterator
(
citygmlPath
);
for
(
BuildingXmlNode
buildingXmlNode
:
buildingXmlNodes
)
{
double
x
=
buildingXmlNode
.
getCenterOfMass
().
getX
();
double
y
=
buildingXmlNode
.
getCenterOfMass
().
getY
();
assertFalse
(
"Coordinate should be a double"
,
Double
.
isNaN
(
x
));
assertFalse
(
"Coordinate should be a double"
,
Double
.
isNaN
(
y
));
}
}
}
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