Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
8087b4bb
Commit
8087b4bb
authored
Dec 02, 2025
by
Luna Riegel
Browse files
Fix: Clear ImplicitGeometry Object maps before parsing
parent
8129283a
Changes
4
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/ImplicitGeometryHolder.java
View file @
8087b4bb
...
@@ -24,6 +24,9 @@ public class ImplicitGeometryHolder extends Geometry {
...
@@ -24,6 +24,9 @@ public class ImplicitGeometryHolder extends Geometry {
private
static
final
long
serialVersionUID
=
-
8938931081577196349L
;
private
static
final
long
serialVersionUID
=
-
8938931081577196349L
;
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ImplicitGeometryHolder
.
class
);
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
ImplicitGeometryHolder
.
class
);
public
enum
PrototypeGeometryType
{
LIBRARY_OBJECT
,
RELATIVE_GEOMETRY
}
private
ImplicitGeometry
cgmlImplicitGeometry
=
null
;
private
ImplicitGeometry
cgmlImplicitGeometry
=
null
;
private
static
ConcurrentHashMap
<
ImplicitGeometryHolder
,
ImplicitGeometry
>
deferredRelGeomObjects
=
new
ConcurrentHashMap
<>();
private
static
ConcurrentHashMap
<
ImplicitGeometryHolder
,
ImplicitGeometry
>
deferredRelGeomObjects
=
new
ConcurrentHashMap
<>();
...
@@ -101,9 +104,12 @@ public class ImplicitGeometryHolder extends Geometry {
...
@@ -101,9 +104,12 @@ public class ImplicitGeometryHolder extends Geometry {
return
type
;
return
type
;
}
}
@Override
/**
public
void
accept
(
CheckableVisitor
c
)
{
* Resets the Object maps of {@link RelativeGeometry} and {@link LibraryObject} to prevent memory and data leaks
prototypeGeometry
.
accept
(
c
);
*/
public
static
void
resetObjectMaps
()
{
RelativeGeometry
.
resetObjectMap
();
LibraryObject
.
resetObjectMap
();
}
}
@Override
@Override
...
@@ -111,8 +117,5 @@ public class ImplicitGeometryHolder extends Geometry {
...
@@ -111,8 +117,5 @@ public class ImplicitGeometryHolder extends Geometry {
return
prototypeGeometry
.
isValidated
();
return
prototypeGeometry
.
isValidated
();
}
}
public
enum
PrototypeGeometryType
{
LIBRARY_OBJECT
,
RELATIVE_GEOMETRY
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java
View file @
8087b4bb
...
@@ -80,4 +80,7 @@ public class LibraryObject extends Geometry {
...
@@ -80,4 +80,7 @@ public class LibraryObject extends Geometry {
}
}
public
static
void
resetObjectMap
()
{
libraryObjects
.
clear
();
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/RelativeGeometry.java
View file @
8087b4bb
...
@@ -34,4 +34,8 @@ public class RelativeGeometry extends Geometry {
...
@@ -34,4 +34,8 @@ public class RelativeGeometry extends Geometry {
private
RelativeGeometry
(
GeometryType
type
,
Lod
lod
,
Orientation
orientation
)
{
private
RelativeGeometry
(
GeometryType
type
,
Lod
lod
,
Orientation
orientation
)
{
super
(
type
,
lod
,
orientation
);
super
(
type
,
lod
,
orientation
);
}
}
public
static
void
resetObjectMap
()
{
relativeGeometries
.
clear
();
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/mapper/citygml3/Citygml3FeatureMapper.java
View file @
8087b4bb
...
@@ -182,6 +182,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
...
@@ -182,6 +182,7 @@ public class Citygml3FeatureMapper extends ObjectWalker {
model
=
new
CityDoctorModel
(
config
,
path
.
toFile
(),
new
UnconnectedCache
());
model
=
new
CityDoctorModel
(
config
,
path
.
toFile
(),
new
UnconnectedCache
());
}
else
{
}
else
{
featureCache
.
resetCache
();
featureCache
.
resetCache
();
ImplicitGeometryHolder
.
resetObjectMaps
();
model
=
new
CityDoctorModel
(
config
,
path
.
toFile
(),
featureCache
);
model
=
new
CityDoctorModel
(
config
,
path
.
toFile
(),
featureCache
);
}
}
neighborDistance
=
1.8d
/
Math
.
pow
(
10
,
config
.
getNumberOfRoundingPlaces
());
neighborDistance
=
1.8d
/
Math
.
pow
(
10
,
config
.
getNumberOfRoundingPlaces
());
...
...
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