Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
5d40c7b6
Commit
5d40c7b6
authored
Sep 30, 2020
by
Matthias Betz
Browse files
CityDoctor2 validation open source release
parents
Changes
413
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/ParentReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
ParentReport
{
@XmlAttribute
(
name
=
"gml_id"
,
required
=
true
)
private
String
gmlId
;
@XmlAttribute
(
name
=
"type"
,
required
=
true
)
private
String
type
;
public
void
setGmlId
(
String
gmlId
)
{
this
.
gmlId
=
gmlId
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getGmlId
()
{
return
gmlId
;
}
public
String
getType
()
{
return
type
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/PlanCheck.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
PlanCheck
{
@XmlAttribute
(
required
=
true
)
private
String
name
;
@XmlAttribute
(
required
=
true
)
private
boolean
activated
;
@XmlElement
(
name
=
"parameter"
)
private
List
<
PlanParameter
>
parameters
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
boolean
isActivated
()
{
return
activated
;
}
public
void
setActivated
(
boolean
activated
)
{
this
.
activated
=
activated
;
}
public
List
<
PlanParameter
>
getParameters
()
{
if
(
parameters
==
null
)
{
parameters
=
new
ArrayList
<>();
}
return
parameters
;
}
public
void
setParameters
(
List
<
PlanParameter
>
parameters
)
{
this
.
parameters
=
parameters
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/PlanParameter.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlValue
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
PlanParameter
{
@XmlAttribute
(
required
=
true
)
private
String
name
;
@XmlValue
private
String
value
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/PolygonReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
PolygonReport
{
@XmlAttribute
(
name
=
"gml_id"
,
required
=
false
)
private
String
gmlId
;
@XmlElement
(
name
=
"exterior_ring"
,
required
=
false
)
private
RingReport
exteriorRing
;
@XmlElementWrapper
(
name
=
"interior_rings"
,
required
=
false
)
@XmlElement
(
name
=
"ring"
)
private
List
<
RingReport
>
interiorRing
;
public
void
setGmlId
(
String
gmlId
)
{
this
.
gmlId
=
gmlId
;
}
public
void
setExteriorRing
(
RingReport
exteriorRing
)
{
this
.
exteriorRing
=
exteriorRing
;
}
public
void
setInteriorRing
(
List
<
RingReport
>
interiorRing
)
{
this
.
interiorRing
=
interiorRing
;
}
public
RingReport
getExteriorRing
()
{
return
exteriorRing
;
}
public
String
getGmlId
()
{
return
gmlId
;
}
public
List
<
RingReport
>
getInteriorRing
()
{
if
(
interiorRing
==
null
)
{
interiorRing
=
new
ArrayList
<>();
}
return
interiorRing
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/PolygonsReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
PolygonsReport
{
@XmlAttribute
(
name
=
"name"
,
required
=
false
)
private
String
name
;
@XmlElement
(
name
=
"polygon"
,
required
=
true
)
private
List
<
PolygonReport
>
polygons
;
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
void
setPolygons
(
List
<
PolygonReport
>
polygons
)
{
this
.
polygons
=
polygons
;
}
public
String
getName
()
{
return
name
;
}
public
List
<
PolygonReport
>
getPolygons
()
{
if
(
polygons
==
null
)
{
polygons
=
new
ArrayList
<>();
}
return
polygons
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/RingReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
RingReport
{
@XmlAttribute
(
name
=
"gml_id"
,
required
=
false
)
private
String
gmlId
;
@XmlAttribute
(
name
=
"type"
,
required
=
true
)
private
RingType
type
;
@XmlElement
(
name
=
"vertex"
,
required
=
true
)
private
List
<
VertexReport
>
vertices
;
public
void
setGmlId
(
String
gmlId
)
{
this
.
gmlId
=
gmlId
;
}
public
void
setType
(
RingType
type
)
{
this
.
type
=
type
;
}
public
void
setVertices
(
List
<
VertexReport
>
vertices
)
{
this
.
vertices
=
vertices
;
}
public
String
getGmlId
()
{
return
gmlId
;
}
public
RingType
getType
()
{
return
type
;
}
public
List
<
VertexReport
>
getVertices
()
{
if
(
vertices
==
null
)
{
vertices
=
new
ArrayList
<>();
}
return
vertices
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/RingType.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
public
enum
RingType
{
EXTERIOR
,
INTERIOR
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/Statistics.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
Statistics
{
@XmlElementWrapper
(
name
=
"error_statistics"
)
@XmlElement
(
name
=
"error"
)
private
List
<
ErrorStatistic
>
errors
;
public
List
<
ErrorStatistic
>
getErrorStats
()
{
if
(
errors
==
null
)
{
errors
=
new
ArrayList
<>();
}
return
errors
;
}
public
void
setErrorStats
(
List
<
ErrorStatistic
>
errors
)
{
this
.
errors
=
errors
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/SurfaceReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
SurfaceReport
{
@XmlAttribute
(
name
=
"name"
,
required
=
false
)
private
String
name
;
@XmlAttribute
(
name
=
"gml_id"
,
required
=
true
)
private
String
gmlId
;
public
void
setGmlId
(
String
gmlId
)
{
this
.
gmlId
=
gmlId
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getGmlId
()
{
return
gmlId
;
}
public
String
getName
()
{
return
name
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/ValidationPlan.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
ValidationPlan
{
private
int
numberOfRoundingPlaces
;
@XmlElement
(
name
=
"schematron_file"
,
required
=
false
)
private
String
schematronFile
;
@XmlElement
(
name
=
"check"
,
required
=
true
)
private
List
<
PlanCheck
>
checks
;
public
void
setSchematronFile
(
String
schematronFile
)
{
this
.
schematronFile
=
schematronFile
;
}
public
String
getSchematronFile
()
{
return
schematronFile
;
}
public
int
getNumberOfRoundingPlaces
()
{
return
numberOfRoundingPlaces
;
}
public
void
setNumberOfRoundingPlaces
(
int
numberOfRoundingPlaces
)
{
this
.
numberOfRoundingPlaces
=
numberOfRoundingPlaces
;
}
public
List
<
PlanCheck
>
getChecks
()
{
if
(
checks
==
null
)
{
checks
=
new
ArrayList
<>();
}
return
checks
;
}
public
void
setChecks
(
List
<
PlanCheck
>
checks
)
{
this
.
checks
=
checks
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/ValidationResults.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
ValidationResults
{
@XmlElementWrapper
(
name
=
"global_errors"
)
@XmlElement
(
name
=
"error"
)
private
List
<
ErrorReport
>
globalErrors
;
@XmlElement
(
name
=
"building_report"
)
private
List
<
FeatureReport
>
buildingReports
;
@XmlElement
(
name
=
"vegetation_report"
)
private
List
<
FeatureReport
>
vegetationReports
;
@XmlElement
(
name
=
"transportation_object_report"
)
private
List
<
FeatureReport
>
transportationReports
;
@XmlElement
(
name
=
"land_object_report"
)
private
List
<
FeatureReport
>
landReports
;
@XmlElement
(
name
=
"bridge_object_report"
)
private
List
<
FeatureReport
>
bridgeReports
;
@XmlElement
(
name
=
"water_object_report"
)
private
List
<
FeatureReport
>
waterReports
;
public
List
<
FeatureReport
>
getBuildingReports
()
{
if
(
buildingReports
==
null
)
{
buildingReports
=
new
ArrayList
<>();
}
return
buildingReports
;
}
public
void
setBuildingReports
(
List
<
FeatureReport
>
buildingReports
)
{
this
.
buildingReports
=
buildingReports
;
}
public
List
<
ErrorReport
>
getGlobalErrors
()
{
if
(
globalErrors
==
null
)
{
globalErrors
=
new
ArrayList
<>();
}
return
globalErrors
;
}
public
void
setGlobalErrors
(
List
<
ErrorReport
>
globalErrors
)
{
this
.
globalErrors
=
globalErrors
;
}
public
List
<
FeatureReport
>
getVegetationReports
()
{
if
(
vegetationReports
==
null
)
{
vegetationReports
=
new
ArrayList
<>();
}
return
vegetationReports
;
}
public
void
setVegetationReports
(
List
<
FeatureReport
>
vegetationReports
)
{
this
.
vegetationReports
=
vegetationReports
;
}
public
List
<
FeatureReport
>
getTransportationReports
()
{
if
(
transportationReports
==
null
)
{
transportationReports
=
new
ArrayList
<>();
}
return
transportationReports
;
}
public
void
setTransportationReports
(
List
<
FeatureReport
>
transportationReports
)
{
this
.
transportationReports
=
transportationReports
;
}
public
List
<
FeatureReport
>
getLandReports
()
{
if
(
landReports
==
null
)
{
landReports
=
new
ArrayList
<>();
}
return
landReports
;
}
public
void
setLandReports
(
List
<
FeatureReport
>
landReports
)
{
this
.
landReports
=
landReports
;
}
public
List
<
FeatureReport
>
getBridgeReports
()
{
if
(
bridgeReports
==
null
)
{
bridgeReports
=
new
ArrayList
<>();
}
return
bridgeReports
;
}
public
void
setBridgeReports
(
List
<
FeatureReport
>
bridgeReports
)
{
this
.
bridgeReports
=
bridgeReports
;
}
public
List
<
FeatureReport
>
getWaterReports
()
{
if
(
waterReports
==
null
)
{
waterReports
=
new
ArrayList
<>();
}
return
waterReports
;
}
public
void
setWaterReports
(
List
<
FeatureReport
>
waterReports
)
{
this
.
waterReports
=
waterReports
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/VertexReport.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAttribute
;
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
VertexReport
{
@XmlAttribute
(
name
=
"name"
,
required
=
false
)
private
String
name
;
@XmlAttribute
(
name
=
"x"
,
required
=
true
)
private
double
x
;
@XmlAttribute
(
name
=
"y"
,
required
=
true
)
private
double
y
;
@XmlAttribute
(
name
=
"z"
,
required
=
true
)
private
double
z
;
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
void
setX
(
double
x
)
{
this
.
x
=
x
;
}
public
void
setY
(
double
y
)
{
this
.
y
=
y
;
}
public
void
setZ
(
double
z
)
{
this
.
z
=
z
;
}
public
String
getName
()
{
return
name
;
}
public
double
getX
()
{
return
x
;
}
public
double
getY
()
{
return
y
;
}
public
double
getZ
()
{
return
z
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/package-info.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
@XmlSchema
(
namespace
=
"http://www.citydoctor.eu"
,
elementFormDefault
=
XmlNsForm
.
QUALIFIED
,
xmlns
=
{
@XmlNs
(
prefix
=
"cd"
,
namespaceURI
=
"http://www.citydoctor.eu"
)
})
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
javax.xml.bind.annotation.XmlSchema
;
import
javax.xml.bind.annotation.XmlNs
;
import
javax.xml.bind.annotation.XmlNsForm
;
\ No newline at end of file
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/utility/CheckReportParseException.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult.utility
;
public
class
CheckReportParseException
extends
Exception
{
private
static
final
long
serialVersionUID
=
6043371305010386110L
;
public
CheckReportParseException
()
{
super
();
}
public
CheckReportParseException
(
String
message
,
Throwable
cause
,
boolean
enableSuppression
,
boolean
writableStackTrace
)
{
super
(
message
,
cause
,
enableSuppression
,
writableStackTrace
);
}
public
CheckReportParseException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
CheckReportParseException
(
String
message
)
{
super
(
message
);
}
public
CheckReportParseException
(
Throwable
cause
)
{
super
(
cause
);
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/utility/CheckReportWriteException.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult.utility
;
public
class
CheckReportWriteException
extends
Exception
{
private
static
final
long
serialVersionUID
=
1769358555887675233L
;
public
CheckReportWriteException
()
{
super
();
}
public
CheckReportWriteException
(
String
message
,
Throwable
cause
,
boolean
enableSuppression
,
boolean
writableStackTrace
)
{
super
(
message
,
cause
,
enableSuppression
,
writableStackTrace
);
}
public
CheckReportWriteException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
CheckReportWriteException
(
String
message
)
{
super
(
message
);
}
public
CheckReportWriteException
(
Throwable
cause
)
{
super
(
cause
);
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/checkresult/utility/IndentationXmlStreamWriter.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult.utility
;
import
javax.xml.namespace.NamespaceContext
;
import
javax.xml.stream.XMLStreamException
;
import
javax.xml.stream.XMLStreamWriter
;
/**
* Writer for writing indentation as the standard jaxb indentation wraps around
* at depth 8, which is unwanted in the report. Indentation is 4 blanks
* currently.
*
* @author Matthias Betz
*
*/
public
class
IndentationXmlStreamWriter
implements
XMLStreamWriter
{
private
static
final
String
INDENTATION
=
" "
;
private
XMLStreamWriter
writer
;
private
int
depth
=
-
1
;
boolean
sameElement
=
true
;
public
IndentationXmlStreamWriter
(
XMLStreamWriter
writer
)
{
this
.
writer
=
writer
;
}
private
void
writeIdentation
()
throws
XMLStreamException
{
for
(
int
i
=
0
;
i
<
depth
;
i
++)
{
writer
.
writeCharacters
(
INDENTATION
);
}
}
@Override
public
void
writeStartElement
(
String
localName
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
writer
.
writeStartElement
(
localName
);
sameElement
=
true
;
}
@Override
public
void
writeStartElement
(
String
namespaceURI
,
String
localName
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
writer
.
writeStartElement
(
namespaceURI
,
localName
);
sameElement
=
true
;
}
@Override
public
void
writeStartElement
(
String
prefix
,
String
localName
,
String
namespaceURI
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
writer
.
writeStartElement
(
prefix
,
localName
,
namespaceURI
);
sameElement
=
true
;
}
@Override
public
void
writeEmptyElement
(
String
namespaceURI
,
String
localName
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
depth
--;
writer
.
writeEmptyElement
(
namespaceURI
,
localName
);
sameElement
=
false
;
}
@Override
public
void
writeEmptyElement
(
String
prefix
,
String
localName
,
String
namespaceURI
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
depth
--;
writer
.
writeEmptyElement
(
prefix
,
localName
,
namespaceURI
);
sameElement
=
false
;
}
@Override
public
void
writeEmptyElement
(
String
localName
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
"\n"
);
depth
++;
writeIdentation
();
depth
--;
writer
.
writeEmptyElement
(
localName
);
sameElement
=
false
;
}
@Override
public
void
writeEndElement
()
throws
XMLStreamException
{
if
(!
sameElement
)
{
writer
.
writeCharacters
(
"\n"
);
writeIdentation
();
}
depth
--;
writer
.
writeEndElement
();
sameElement
=
false
;
}
@Override
public
void
writeEndDocument
()
throws
XMLStreamException
{
writer
.
writeEndDocument
();
}
@Override
public
void
close
()
throws
XMLStreamException
{
writer
.
close
();
}
@Override
public
void
flush
()
throws
XMLStreamException
{
writer
.
flush
();
}
@Override
public
void
writeAttribute
(
String
localName
,
String
value
)
throws
XMLStreamException
{
writer
.
writeAttribute
(
localName
,
value
);
}
@Override
public
void
writeAttribute
(
String
prefix
,
String
namespaceURI
,
String
localName
,
String
value
)
throws
XMLStreamException
{
writer
.
writeAttribute
(
prefix
,
namespaceURI
,
localName
,
value
);
}
@Override
public
void
writeAttribute
(
String
namespaceURI
,
String
localName
,
String
value
)
throws
XMLStreamException
{
writer
.
writeAttribute
(
namespaceURI
,
localName
,
value
);
}
@Override
public
void
writeNamespace
(
String
prefix
,
String
namespaceURI
)
throws
XMLStreamException
{
writer
.
writeNamespace
(
prefix
,
namespaceURI
);
}
@Override
public
void
writeDefaultNamespace
(
String
namespaceURI
)
throws
XMLStreamException
{
writer
.
writeDefaultNamespace
(
namespaceURI
);
}
@Override
public
void
writeComment
(
String
data
)
throws
XMLStreamException
{
writeIdentation
();
writer
.
writeComment
(
data
);
}
@Override
public
void
writeProcessingInstruction
(
String
target
)
throws
XMLStreamException
{
writer
.
writeProcessingInstruction
(
target
);
}
@Override
public
void
writeProcessingInstruction
(
String
target
,
String
data
)
throws
XMLStreamException
{
writer
.
writeProcessingInstruction
(
target
,
data
);
}
@Override
public
void
writeCData
(
String
data
)
throws
XMLStreamException
{
writer
.
writeCData
(
data
);
}
@Override
public
void
writeDTD
(
String
dtd
)
throws
XMLStreamException
{
writer
.
writeDTD
(
dtd
);
}
@Override
public
void
writeEntityRef
(
String
name
)
throws
XMLStreamException
{
writer
.
writeEntityRef
(
name
);
}
@Override
public
void
writeStartDocument
()
throws
XMLStreamException
{
writer
.
writeStartDocument
();
}
@Override
public
void
writeStartDocument
(
String
version
)
throws
XMLStreamException
{
writer
.
writeStartDocument
(
version
);
}
@Override
public
void
writeStartDocument
(
String
encoding
,
String
version
)
throws
XMLStreamException
{
writer
.
writeStartDocument
(
encoding
,
version
);
}
@Override
public
void
writeCharacters
(
String
text
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
text
);
}
@Override
public
void
writeCharacters
(
char
[]
text
,
int
start
,
int
len
)
throws
XMLStreamException
{
writer
.
writeCharacters
(
text
,
start
,
len
);
}
@Override
public
String
getPrefix
(
String
uri
)
throws
XMLStreamException
{
return
writer
.
getPrefix
(
uri
);
}
@Override
public
void
setPrefix
(
String
prefix
,
String
uri
)
throws
XMLStreamException
{
writer
.
setPrefix
(
prefix
,
uri
);
}
@Override
public
void
setDefaultNamespace
(
String
uri
)
throws
XMLStreamException
{
writer
.
setDefaultNamespace
(
uri
);
}
@Override
public
void
setNamespaceContext
(
NamespaceContext
context
)
throws
XMLStreamException
{
writer
.
setNamespaceContext
(
context
);
}
@Override
public
NamespaceContext
getNamespaceContext
()
{
return
writer
.
getNamespaceContext
();
}
@Override
public
Object
getProperty
(
String
name
)
{
return
writer
.
getProperty
(
name
);
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/marshaller/DoubleAdapter.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.marshaller
;
import
javax.xml.bind.annotation.adapters.XmlAdapter
;
public
class
DoubleAdapter
extends
XmlAdapter
<
String
,
Double
>
{
@Override
public
String
marshal
(
Double
v
)
throws
Exception
{
return
v
.
toString
();
}
@Override
public
Double
unmarshal
(
String
v
)
throws
Exception
{
return
Double
.
parseDouble
(
v
);
}
}
CityDoctorParent/CityDoctorCheckResult/src/main/java/de/hft/stuttgart/citydoctor2/marshaller/ZonedDateTimeAdapter.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.marshaller
;
import
java.time.ZonedDateTime
;
import
java.time.format.DateTimeFormatter
;
import
javax.xml.bind.annotation.adapters.XmlAdapter
;
public
class
ZonedDateTimeAdapter
extends
XmlAdapter
<
String
,
ZonedDateTime
>
{
private
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ISO_OFFSET_DATE_TIME
;
@Override
public
String
marshal
(
ZonedDateTime
v
)
throws
Exception
{
return
formatter
.
format
(
v
);
}
@Override
public
ZonedDateTime
unmarshal
(
String
v
)
throws
Exception
{
return
ZonedDateTime
.
parse
(
v
,
formatter
);
}
}
CityDoctorParent/CityDoctorCheckResult/src/test/java/CheckReportTest.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
import
java.util.List
;
import
de.hft.stuttgart.citydoctor2.checkresult.CheckReport
;
import
de.hft.stuttgart.citydoctor2.checkresult.EdgeReport
;
import
de.hft.stuttgart.citydoctor2.checkresult.Environment
;
import
de.hft.stuttgart.citydoctor2.checkresult.ErrorDetails
;
import
de.hft.stuttgart.citydoctor2.checkresult.ErrorReport
;
import
de.hft.stuttgart.citydoctor2.checkresult.ErrorStatistic
;
import
de.hft.stuttgart.citydoctor2.checkresult.FeatureReport
;
import
de.hft.stuttgart.citydoctor2.checkresult.GlobalErrorStatistics
;
import
de.hft.stuttgart.citydoctor2.checkresult.GlobalStatistics
;
import
de.hft.stuttgart.citydoctor2.checkresult.Header
;
import
de.hft.stuttgart.citydoctor2.checkresult.ModelStatistics
;
import
de.hft.stuttgart.citydoctor2.checkresult.PlanCheck
;
import
de.hft.stuttgart.citydoctor2.checkresult.PlanParameter
;
import
de.hft.stuttgart.citydoctor2.checkresult.Statistics
;
import
de.hft.stuttgart.citydoctor2.checkresult.ValidationPlan
;
import
de.hft.stuttgart.citydoctor2.checkresult.ValidationResults
;
import
de.hft.stuttgart.citydoctor2.checkresult.VertexReport
;
import
de.hft.stuttgart.citydoctor2.checkresult.utility.CheckReportParseException
;
public
class
CheckReportTest
{
public
static
void
main
(
String
[]
args
)
throws
CheckReportParseException
{
// String file = args[0];
String
file
=
"output.xml"
;
CheckReport
report
=
CheckReport
.
load
(
file
);
Header
header
=
report
.
getHeader
();
System
.
out
.
println
(
"File: "
+
header
.
getFile
());
System
.
out
.
println
(
"Time: "
+
header
.
getDate
());
Environment
environment
=
header
.
getEnvironment
();
System
.
out
.
println
(
"Java version: "
+
environment
.
getJavaVersion
());
System
.
out
.
println
(
"Java VM Vendor: "
+
environment
.
getJavaVmVendor
());
System
.
out
.
println
(
"Java VM Version: "
+
environment
.
getJavaVmVersion
());
System
.
out
.
println
(
"OS Architecture: "
+
environment
.
getOsArch
());
System
.
out
.
println
(
"OS Name: "
+
environment
.
getOsName
());
System
.
out
.
println
(
"Validation Version: "
+
environment
.
getValidationVersion
());
ValidationPlan
validationPlan
=
report
.
getValidationPlan
();
System
.
out
.
println
();
System
.
out
.
println
(
"ValidationPlan:"
);
System
.
out
.
println
(
"minVertexDistance: "
+
validationPlan
.
getNumberOfRoundingPlaces
());
for
(
PlanCheck
pCheck
:
validationPlan
.
getChecks
())
{
System
.
out
.
println
(
"Check: "
+
pCheck
.
getName
());
System
.
out
.
println
(
"\tEnabled: "
+
pCheck
.
isActivated
());
if
(!
pCheck
.
getParameters
().
isEmpty
())
{
for
(
PlanParameter
para
:
pCheck
.
getParameters
())
{
System
.
out
.
println
(
"\tParameter: "
+
para
.
getName
()
+
"="
+
para
.
getValue
());
}
}
}
GlobalStatistics
globalStatistics
=
report
.
getGlobalStatistics
();
List
<
ErrorStatistic
>
errorStats
=
globalStatistics
.
getErrorStats
();
System
.
out
.
println
();
System
.
out
.
println
(
"ErrorStatistics:"
);
for
(
ErrorStatistic
eStat
:
errorStats
)
{
System
.
out
.
println
(
"Error "
+
eStat
.
getName
()
+
" occured "
+
eStat
.
getCount
()
+
" times"
);
}
ModelStatistics
modelStats
=
globalStatistics
.
getModelStats
();
System
.
out
.
println
();
System
.
out
.
println
(
"ModelStatistics:"
);
System
.
out
.
println
(
"Number of Buildings: "
+
modelStats
.
getNumBuildings
());
System
.
out
.
println
(
"Number of Bridges: "
+
modelStats
.
getNumBridgeObjects
());
System
.
out
.
println
(
"Number of Vegetation: "
+
modelStats
.
getNumVegetation
());
System
.
out
.
println
(
"Number of WaterObjects: "
+
modelStats
.
getNumWaterObjects
());
System
.
out
.
println
(
"Number of Transportation: "
+
modelStats
.
getNumTransportation
());
System
.
out
.
println
(
"Number of LandObjects: "
+
modelStats
.
getNumLandObjects
());
GlobalErrorStatistics
globalErrorStats
=
globalStatistics
.
getGlobalErrorStats
();
System
.
out
.
println
(
"Errornous Feature Statistics"
);
System
.
out
.
println
(
"Number of Buildings: "
+
globalErrorStats
.
getNumErrorBuildings
());
System
.
out
.
println
(
"Number of Bridges: "
+
globalErrorStats
.
getNumErrorBridgeObjects
());
System
.
out
.
println
(
"Number of Vegetation: "
+
globalErrorStats
.
getNumErrorVegetation
());
System
.
out
.
println
(
"Number of WaterObjects: "
+
globalErrorStats
.
getNumErrorWaterObjects
());
System
.
out
.
println
(
"Number of Transportation: "
+
globalErrorStats
.
getNumErrorTransportation
());
System
.
out
.
println
(
"Number of LandObjects: "
+
globalErrorStats
.
getNumErrorLandObjects
());
ValidationResults
validationResults
=
report
.
getValidationResults
();
System
.
out
.
println
();
System
.
out
.
println
(
"ValidationResults:"
);
/*
* Alternative way to access the validation results by using the gmlID of a feature:
*
* FeatureReport featureReportForId = report.getFeatureReportForId("GML-ID");
*/
System
.
out
.
println
(
"Buildings:"
);
printReports
(
validationResults
.
getBuildingReports
());
System
.
out
.
println
(
"Vegetation:"
);
printReports
(
validationResults
.
getVegetationReports
());
System
.
out
.
println
(
"Bridges:"
);
printReports
(
validationResults
.
getBridgeReports
());
System
.
out
.
println
(
"WaterObjects:"
);
printReports
(
validationResults
.
getWaterReports
());
System
.
out
.
println
(
"LandObjects:"
);
printReports
(
validationResults
.
getLandReports
());
System
.
out
.
println
(
"Transportation:"
);
printReports
(
validationResults
.
getTransportationReports
());
}
private
static
void
printReports
(
List
<
FeatureReport
>
reports
)
{
for
(
FeatureReport
fReport
:
reports
)
{
System
.
out
.
println
(
"GML-ID: "
+
fReport
.
getGmlId
());
Statistics
statistics
=
fReport
.
getStatistics
();
if
(
statistics
!=
null
&&
statistics
.
getErrorStats
()
!=
null
&&
!
statistics
.
getErrorStats
().
isEmpty
())
{
System
.
out
.
println
(
"\tStatistics:"
);
for
(
ErrorStatistic
eStat
:
statistics
.
getErrorStats
())
{
System
.
out
.
println
(
"\tError "
+
eStat
.
getName
()
+
" occured "
+
eStat
.
getCount
()
+
" times"
);
}
}
List
<
ErrorReport
>
errors
=
fReport
.
getErrors
();
if
(!
errors
.
isEmpty
())
{
System
.
out
.
println
(
"\tErrors:"
);
}
for
(
ErrorReport
errReport
:
errors
)
{
System
.
out
.
println
(
"\tError ID: "
+
errReport
.
getId
()
+
" with status: "
+
errReport
.
getStatus
());
ErrorDetails
errorDetails
=
errReport
.
getErrorDetails
();
if
(
errorDetails
!=
null
)
{
System
.
out
.
println
(
"\tError Details:"
);
for
(
EdgeReport
edgeReport
:
errorDetails
.
getEdge
())
{
if
(
edgeReport
.
getName
()
!=
null
)
{
System
.
out
.
println
(
"\t\t"
+
edgeReport
.
getName
());
}
System
.
out
.
println
(
"\t\t"
+
toString
(
edgeReport
));
}
// more details
}
}
System
.
out
.
println
();
}
}
private
static
String
toString
(
EdgeReport
edgeReport
)
{
return
"Edge from: "
+
toString
(
edgeReport
.
getFrom
())
+
" to "
+
toString
(
edgeReport
.
getTo
());
}
private
static
String
toString
(
VertexReport
from
)
{
return
"Vertex["
+
from
.
getX
()
+
", "
+
from
.
getY
()
+
", "
+
from
.
getZ
()
+
"]"
;
}
}
CityDoctorParent/CityDoctorCheckResult/src/test/java/de/hft/stuttgart/citydoctor2/checkresult/CheckReportTest.java
0 → 100644
View file @
5d40c7b6
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package
de.hft.stuttgart.citydoctor2.checkresult
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
java.time.ZoneId
;
import
java.time.ZoneOffset
;
import
java.time.ZonedDateTime
;
import
java.util.List
;
import
org.junit.Test
;
import
de.hft.stuttgart.citydoctor2.checkresult.utility.CheckReportParseException
;
public
class
CheckReportTest
{
@Test
public
void
testCheckReportReader
()
throws
CheckReportParseException
{
CheckReport
report
=
CheckReport
.
load
(
"src/test/resources/errorReportSchema.xml"
);
assertNotNull
(
report
);
Header
header
=
report
.
getHeader
();
assertNotNull
(
header
);
ZonedDateTime
zdt
=
header
.
getDate
();
assertNotNull
(
zdt
);
ZonedDateTime
expZdt
=
ZonedDateTime
.
of
(
2001
,
12
,
31
,
12
,
00
,
00
,
00
,
ZoneId
.
ofOffset
(
""
,
ZoneOffset
.
ofHours
(
1
)));
assertEquals
(
expZdt
,
zdt
);
Environment
environment
=
header
.
getEnvironment
();
assertNotNull
(
environment
);
String
javaVersion
=
environment
.
getJavaVersion
();
String
expJavaVersion
=
"cd:java_version"
;
assertEquals
(
expJavaVersion
,
javaVersion
);
assertEquals
(
"cd:java_vm_version"
,
environment
.
getJavaVmVersion
());
assertEquals
(
"cd:java_vm_vendor"
,
environment
.
getJavaVmVendor
());
assertEquals
(
"cd:os_name"
,
environment
.
getOsName
());
assertEquals
(
"cd:os_arch"
,
environment
.
getOsArch
());
assertEquals
(
"cd:city_doctor_validation_version"
,
environment
.
getValidationVersion
());
assertEquals
(
"cd:file"
,
header
.
getFile
());
ValidationPlan
validationPlan
=
report
.
getValidationPlan
();
assertNotNull
(
validationPlan
);
assertEquals
(
8
,
validationPlan
.
getNumberOfRoundingPlaces
());
List
<
PlanCheck
>
checks
=
validationPlan
.
getChecks
();
assertEquals
(
1
,
checks
.
size
());
PlanCheck
check
=
checks
.
get
(
0
);
assertTrue
(
check
.
isActivated
());
assertEquals
(
""
,
check
.
getName
());
List
<
PlanParameter
>
parameters
=
check
.
getParameters
();
assertNotNull
(
parameters
);
assertEquals
(
1
,
parameters
.
size
());
PlanParameter
parameter
=
parameters
.
get
(
0
);
assertEquals
(
""
,
parameter
.
getName
());
assertEquals
(
"cd:parameter"
,
parameter
.
getValue
());
GlobalStatistics
globalStatistics
=
report
.
getGlobalStatistics
();
assertNotNull
(
globalStatistics
);
ModelStatistics
modelStats
=
globalStatistics
.
getModelStats
();
assertEquals
(
0
,
modelStats
.
getNumWaterObjects
());
assertEquals
(
0
,
modelStats
.
getNumBridgeObjects
());
assertEquals
(
0
,
modelStats
.
getNumBuildings
());
assertEquals
(
0
,
modelStats
.
getNumLandObjects
());
assertEquals
(
0
,
modelStats
.
getNumTransportation
());
assertEquals
(
0
,
modelStats
.
getNumVegetation
());
GlobalErrorStatistics
globalErrorStats
=
globalStatistics
.
getGlobalErrorStats
();
assertEquals
(
0
,
globalErrorStats
.
getNumErrorBridgeObjects
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorBuildings
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorLandObjects
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorVegetation
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorWaterObjects
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorTransportation
());
List
<
ErrorStatistic
>
errorStats
=
globalStatistics
.
getErrorStats
();
assertEquals
(
1
,
errorStats
.
size
());
ErrorStatistic
errorStat
=
errorStats
.
get
(
0
);
assertEquals
(
""
,
errorStat
.
getName
());
assertEquals
(
0
,
errorStat
.
getCount
());
ValidationResults
validationResults
=
report
.
getValidationResults
();
assertNotNull
(
validationResults
);
List
<
FeatureReport
>
bridgeReports
=
validationResults
.
getBridgeReports
();
assertEquals
(
1
,
bridgeReports
.
size
());
FeatureReport
bridgeReport
=
bridgeReports
.
get
(
0
);
Statistics
statistics
=
bridgeReport
.
getStatistics
();
List
<
ErrorStatistic
>
errors
=
statistics
.
getErrorStats
();
assertEquals
(
1
,
errors
.
size
());
errorStat
=
errors
.
get
(
0
);
assertEquals
(
""
,
errorStat
.
getName
());
assertEquals
(
0
,
errorStat
.
getCount
());
List
<
ErrorReport
>
errorReports
=
bridgeReport
.
getErrors
();
assertEquals
(
1
,
errorReports
.
size
());
ErrorReport
errorReport
=
errorReports
.
get
(
0
);
assertEquals
(
""
,
errorReport
.
getId
());
assertEquals
(
ErrorStatus
.
ERROR
,
errorReport
.
getStatus
());
Feature
feature
=
errorReport
.
getFeature
();
assertEquals
(
""
,
feature
.
getType
());
assertEquals
(
""
,
feature
.
getGmlId
());
}
@Test
public
void
testDlmReportLoading
()
throws
CheckReportParseException
{
CheckReport
report
=
CheckReport
.
load
(
"src/test/resources/dlm-report.xml"
);
assertNotNull
(
report
);
Header
header
=
report
.
getHeader
();
assertNotNull
(
header
);
ZonedDateTime
zdt
=
header
.
getDate
();
assertNotNull
(
zdt
);
ZonedDateTime
expZdt
=
ZonedDateTime
.
of
(
2019
,
6
,
6
,
15
,
47
,
45
,
221000000
,
ZoneId
.
ofOffset
(
""
,
ZoneOffset
.
ofHours
(
2
)));
assertEquals
(
expZdt
,
zdt
);
Environment
environment
=
header
.
getEnvironment
();
assertNotNull
(
environment
);
String
javaVersion
=
environment
.
getJavaVersion
();
String
expJavaVersion
=
"1.8.0_201"
;
assertEquals
(
expJavaVersion
,
javaVersion
);
assertEquals
(
"25.201-b09"
,
environment
.
getJavaVmVersion
());
assertEquals
(
"Oracle Corporation"
,
environment
.
getJavaVmVendor
());
assertEquals
(
"Windows 10"
,
environment
.
getOsName
());
assertEquals
(
"amd64"
,
environment
.
getOsArch
());
assertEquals
(
"3.2.0"
,
environment
.
getValidationVersion
());
assertEquals
(
"Delft_Part.gml"
,
header
.
getFile
());
ValidationPlan
validationPlan
=
report
.
getValidationPlan
();
assertNotNull
(
validationPlan
);
assertEquals
(
8
,
validationPlan
.
getNumberOfRoundingPlaces
());
List
<
PlanCheck
>
checks
=
validationPlan
.
getChecks
();
assertEquals
(
18
,
checks
.
size
());
PlanCheck
check
=
checks
.
get
(
0
);
assertTrue
(
check
.
isActivated
());
assertEquals
(
"C_GE_R_TOO_FEW_POINTS"
,
check
.
getName
());
check
=
checks
.
get
(
7
);
assertEquals
(
"C_GE_P_NON_PLANAR"
,
check
.
getName
());
List
<
PlanParameter
>
parameters
=
check
.
getParameters
();
assertEquals
(
3
,
parameters
.
size
());
PlanParameter
parameter
=
parameters
.
get
(
0
);
assertEquals
(
"angleTolerance"
,
parameter
.
getName
());
assertEquals
(
"0.1"
,
parameter
.
getValue
());
GlobalStatistics
globalStatistics
=
report
.
getGlobalStatistics
();
assertNotNull
(
globalStatistics
);
ModelStatistics
modelStats
=
globalStatistics
.
getModelStats
();
assertEquals
(
3
,
modelStats
.
getNumWaterObjects
());
assertEquals
(
3
,
modelStats
.
getNumBridgeObjects
());
assertEquals
(
160
,
modelStats
.
getNumBuildings
());
assertEquals
(
81
,
modelStats
.
getNumLandObjects
());
assertEquals
(
143
,
modelStats
.
getNumTransportation
());
assertEquals
(
126
,
modelStats
.
getNumVegetation
());
GlobalErrorStatistics
globalErrorStats
=
globalStatistics
.
getGlobalErrorStats
();
assertEquals
(
3
,
globalErrorStats
.
getNumErrorBridgeObjects
());
assertEquals
(
0
,
globalErrorStats
.
getNumErrorBuildings
());
assertEquals
(
3
,
globalErrorStats
.
getNumErrorLandObjects
());
assertEquals
(
2
,
globalErrorStats
.
getNumErrorVegetation
());
assertEquals
(
1
,
globalErrorStats
.
getNumErrorWaterObjects
());
assertEquals
(
11
,
globalErrorStats
.
getNumErrorTransportation
());
List
<
ErrorStatistic
>
errorStats
=
globalStatistics
.
getErrorStats
();
assertEquals
(
2
,
errorStats
.
size
());
ErrorStatistic
errorStat
=
errorStats
.
get
(
0
);
assertEquals
(
"GE_R_SELF_INTERSECTION"
,
errorStat
.
getName
());
assertEquals
(
4
,
errorStat
.
getCount
());
ValidationResults
validationResults
=
report
.
getValidationResults
();
assertNotNull
(
validationResults
);
List
<
FeatureReport
>
bridgeReports
=
validationResults
.
getBridgeReports
();
assertEquals
(
3
,
bridgeReports
.
size
());
FeatureReport
bridgeReport
=
bridgeReports
.
get
(
0
);
assertEquals
(
"bea632f90-00b8-11e6-b420-2bdcc4ab5d7f"
,
bridgeReport
.
getGmlId
());
Statistics
statistics
=
bridgeReport
.
getStatistics
();
List
<
ErrorStatistic
>
errors
=
statistics
.
getErrorStats
();
assertEquals
(
1
,
errors
.
size
());
errorStat
=
errors
.
get
(
0
);
assertEquals
(
"GE_R_TOO_FEW_POINTS"
,
errorStat
.
getName
());
assertEquals
(
70
,
errorStat
.
getCount
());
List
<
ErrorReport
>
errorReports
=
bridgeReport
.
getErrors
();
assertEquals
(
70
,
errorReports
.
size
());
ErrorReport
errorReport
=
errorReports
.
get
(
0
);
assertEquals
(
"GE_R_TOO_FEW_POINTS"
,
errorReport
.
getId
());
assertEquals
(
ErrorStatus
.
ERROR
,
errorReport
.
getStatus
());
List
<
FeatureReport
>
buildingReports
=
validationResults
.
getBuildingReports
();
assertEquals
(
160
,
buildingReports
.
size
());
List
<
FeatureReport
>
landReports
=
validationResults
.
getLandReports
();
assertEquals
(
81
,
landReports
.
size
());
List
<
FeatureReport
>
transportationReports
=
validationResults
.
getTransportationReports
();
assertEquals
(
143
,
transportationReports
.
size
());
List
<
FeatureReport
>
vegetationReports
=
validationResults
.
getVegetationReports
();
assertEquals
(
126
,
vegetationReports
.
size
());
List
<
FeatureReport
>
waterReports
=
validationResults
.
getWaterReports
();
assertEquals
(
3
,
waterReports
.
size
());
}
}
Prev
1
2
3
4
5
6
…
21
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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