GeometryMapper.java 19.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*-
 *  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.mapper;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.citygml4j.model.gml.geometry.AbstractGeometry;
import org.citygml4j.model.gml.geometry.GeometryProperty;
import org.citygml4j.model.gml.geometry.aggregates.MultiSurface;
import org.citygml4j.model.gml.geometry.aggregates.MultiSurfaceProperty;
import org.citygml4j.model.gml.geometry.complexes.CompositeSurface;
import org.citygml4j.model.gml.geometry.primitives.AbstractRing;
import org.citygml4j.model.gml.geometry.primitives.AbstractRingProperty;
import org.citygml4j.model.gml.geometry.primitives.Coord;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
import org.citygml4j.model.gml.geometry.primitives.DirectPositionList;
import org.citygml4j.model.gml.geometry.primitives.PosOrPointPropertyOrPointRep;
import org.citygml4j.model.gml.geometry.primitives.SolidProperty;
import org.citygml4j.model.gml.geometry.primitives.SurfaceProperty;
41
42
43
import org.citygml4j.model.gml.geometry.primitives.Triangle;
import org.citygml4j.model.gml.geometry.primitives.TrianglePatchArrayProperty;
import org.citygml4j.model.gml.geometry.primitives.TriangulatedSurface;
44
import org.citygml4j.util.walker.GeometryWalker;
45
46
import org.locationtech.proj4j.BasicCoordinateTransform;
import org.locationtech.proj4j.ProjCoordinate;
47
48
49
50
51
52
53
54
55
56
57
58
59

import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingInstallation;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.ConcretePolygon;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.GeometryType;
import de.hft.stuttgart.citydoctor2.datastructure.GmlId;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing;
import de.hft.stuttgart.citydoctor2.datastructure.LinearRing.LinearRingType;
import de.hft.stuttgart.citydoctor2.datastructure.Lod;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
Matthias Betz's avatar
Matthias Betz committed
60
import de.hft.stuttgart.citydoctor2.utils.Localization;
61
62
63
64
65
66
67
68
69
import de.hft.stuttgart.citydoctor2.utils.Pair;

/**
 * 
 * @author Matthias Betz
 *
 */
public class GeometryMapper extends GeometryWalker {

Matthias Betz's avatar
Matthias Betz committed
70
	private static final Logger logger = LogManager.getLogger(GeometryMapper.class);
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

	private Geometry geom;
	private ParserConfiguration config;

	private Map<Vertex, Vertex> vertexMap;
	private Map<String, ConcretePolygon> polygons;
	private List<Pair<String, Geometry>> linkedPolygons;

	private LinearRing currentRing;

	private BoundarySurface bs;
	private BuildingInstallation bi;

	private ProjCoordinate p1 = new ProjCoordinate();
	private ProjCoordinate p2 = new ProjCoordinate();

	public GeometryMapper(Geometry geom, ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertices) {
		this.geom = geom;
		this.config = config;
		vertexMap = vertices;
		this.polygons = polygons;
		this.linkedPolygons = linkedPolygons;
	}

	public void setBoundarySurface(BoundarySurface bs) {
		this.bs = bs;
	}

	public void setBuildingInstallation(BuildingInstallation bi) {
		this.bi = bi;
	}
103

104
105
106
107
108
109
110
111
112
113
114
115
116
	@Override
	public void visit(MultiSurface multiSurface) {
		super.visit(multiSurface);
		for (SurfaceProperty sp : multiSurface.getSurfaceMember()) {
			if (sp.isSetHref()) {
				String linkedPoly = sp.getHref();
				if (linkedPoly.charAt(0) == '#') {
					linkedPoly = linkedPoly.substring(1);
				}
				linkedPolygons.add(new Pair<>(linkedPoly, geom));
			}
		}
	}
117

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	@Override
	public void visit(CompositeSurface compositeSurface) {
		super.visit(compositeSurface);
		for (SurfaceProperty sp : compositeSurface.getSurfaceMember()) {
			if (sp.isSetHref()) {
				String linkedPoly = sp.getHref();
				if (linkedPoly.charAt(0) == '#') {
					linkedPoly = linkedPoly.substring(1);
				}
				linkedPolygons.add(new Pair<>(linkedPoly, geom));
			}
		}
	}

	@Override
	public void visit(org.citygml4j.model.gml.geometry.primitives.Polygon gmlPoly) {
		if (!gmlPoly.isSetExterior()) {
Matthias Betz's avatar
Matthias Betz committed
135
136
137
			if (logger.isWarnEnabled()) {
				logger.warn(Localization.getText("GeometryMapper.emptyPolygon"));
			}
138
139
140
			return;
		}
		ConcretePolygon cdPoly = new ConcretePolygon();
Matthias Betz's avatar
Matthias Betz committed
141
		addPolygonToAvailablePolygons(gmlPoly, cdPoly);
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
		geom.addPolygon(cdPoly);
		if (bs != null) {
			// polygon is part of a boundary surface
			cdPoly.setPartOfSurface(bs);
			if (bi != null) {
				// polygon is part of a boundary surface in a building installation
				cdPoly.setPartOfInstallation(bi);
			}
		} else {
			if (bi != null) {
				// polygon is only part of a building installation
				cdPoly.setPartOfInstallation(bi);
			}
		}

		// parse rings
		LinearRing extRing = new LinearRing(LinearRingType.EXTERIOR);
		cdPoly.setExteriorRing(extRing);
		mapRing(gmlPoly.getExterior(), extRing);

		if (gmlPoly.isSetInterior()) {
			for (AbstractRingProperty arp : gmlPoly.getInterior()) {
				if (arp.isSetRing()) {
					LinearRing innerRing = new LinearRing(LinearRingType.INTERIOR);
					cdPoly.addInteriorRing(innerRing);
					mapRing(arp, innerRing);
				}
			}
		}
	}

Matthias Betz's avatar
Matthias Betz committed
173
174
175
176
	private void addPolygonToAvailablePolygons(org.citygml4j.model.gml.geometry.primitives.Polygon gmlPoly,
			ConcretePolygon cdPoly) {
		if (gmlPoly.isSetId()) {
			cdPoly.setGmlId(new GmlId(gmlPoly.getId()));
177
178
179
			if (polygons.put(gmlPoly.getId(), cdPoly) != null) {
				logger.warn("Found already existing polygon ID {}, duplicate IDs are not valid", gmlPoly.getId());
			}
Matthias Betz's avatar
Matthias Betz committed
180
181
182
		}
	}

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
	private void mapRing(AbstractRingProperty gmlRing, LinearRing cdRing) {
		AbstractRing ringGeometry = gmlRing.getRing();
		if (ringGeometry.isSetId()) {
			cdRing.setGmlId(new GmlId(ringGeometry.getId()));
		}
		currentRing = cdRing;
		// jump to LinearRing or Ring visit
		ringGeometry.accept(this);
	}

	@Override
	public void visit(org.citygml4j.model.gml.geometry.primitives.LinearRing linearRing) {
		if (linearRing.isSetCoord()) {
			List<Coord> coords = linearRing.getCoord();
			for (Coord coord : coords) {
				createVertex(coord.getX(), coord.getY(), coord.getZ());
			}
		}
		if (linearRing.isSetPosList()) {
			parsePosList(linearRing);
		}
		if (linearRing.isSetPosOrPointPropertyOrPointRep()) {
			parsePoints(linearRing);
		}
	}

	private void parsePoints(org.citygml4j.model.gml.geometry.primitives.LinearRing linearRing) {
		List<PosOrPointPropertyOrPointRep> points = linearRing.getPosOrPointPropertyOrPointRep();
		for (PosOrPointPropertyOrPointRep point : points) {
			if (!point.isSetPos()) {
				throw new UnsupportedOperationException("Cannot parse points for: " + linearRing.getId());
			}
			DirectPosition pos = point.getPos();
			List<Double> coords = pos.getValue();
			int dimension = getDimension(linearRing, pos, coords);
			switch (dimension) {
			case 1:
				createVertex(coords.get(0), 0, 0);
				break;
			case 2:
				createVertex(coords.get(0), coords.get(1), 0);
				break;
			case 3:
				createVertex(coords.get(0), coords.get(1), coords.get(2));
				break;
			default:
				throw new UnsupportedOperationException("Cannot parse Coordinates with dimension:" + dimension);
			}
		}
	}

	private void parsePosList(org.citygml4j.model.gml.geometry.primitives.LinearRing linearRing) {
		DirectPositionList directPosList = linearRing.getPosList();
		if (directPosList.isSetValue()) {
			List<Double> coords = directPosList.getValue();
			int dimension = getDimension(linearRing, directPosList, coords);
			switch (dimension) {
			case 1:
				for (int i = 0; i < coords.size(); i++) {
					createVertex(coords.get(i), 0, 0);
				}
				break;
			case 2:
				for (int i = 0; i < coords.size(); i = i + 2) {
					createVertex(coords.get(i + 0), coords.get(i + 1), 0);
				}
				break;
			case 3:
				for (int i = 0; i < coords.size(); i = i + 3) {
					createVertex(coords.get(i + 0), coords.get(i + 1), coords.get(i + 2));
				}
				break;
			default:
				throw new UnsupportedOperationException("Cannot parse Coordinates with dimension:" + dimension);
			}
		}
	}

	private int getDimension(org.citygml4j.model.gml.geometry.primitives.LinearRing linearRing, DirectPosition pos,
			List<Double> coords) {
		int dimension = 3;
		if (pos.isSetSrsDimension()) {
			dimension = pos.getSrsDimension();
		}
		if (coords.size() % dimension != 0) {
			throw new IllegalStateException("Number of coordinates do not match dimension: " + dimension + ", ring: "
					+ linearRing.getId() + ", polygon: " + currentRing.getParent().getGmlId().getGmlString());
		}
		return dimension;
	}

	private int getDimension(org.citygml4j.model.gml.geometry.primitives.LinearRing linearRing,
			DirectPositionList directPosList, List<Double> coords) {
		int dimension = 3;
		if (directPosList.isSetSrsDimension()) {
			dimension = directPosList.getSrsDimension();
		}
		if (coords.size() % dimension != 0) {
			throw new IllegalStateException("Number of coordinates do not match dimension: " + dimension + ", ring: "
					+ linearRing.getId() + ", polygon: " + currentRing.getParent().getGmlId().getGmlString());
		}
		return dimension;
	}

	private void createVertex(double x, double y, double z) {
		// transform into utm, if available
		BasicCoordinateTransform trans = config.getTargetTransform();
		if (trans != null) {
			p1.setValue(x, y);
			trans.transform(p1, p2);
			x = p2.x;
			y = p2.y;
			z = z / config.getFromMetres();
		}
		x = round(x, config.getNumberOfRoundingPlaces());
		y = round(y, config.getNumberOfRoundingPlaces());
		z = round(z, config.getNumberOfRoundingPlaces());
		Vertex v = new Vertex(x, y, z);
		Vertex duplicate = vertexMap.get(v);
		if (duplicate == null) {
			vertexMap.put(v, v);
		} else {
			v = duplicate;
		}

		currentRing.addVertex(v);
	}

	private double round(double value, int places) {
		if (places < 0) {
			throw new IllegalArgumentException();
		}

		BigDecimal bd = BigDecimal.valueOf(value);
		bd = bd.setScale(places, RoundingMode.HALF_UP);
		return bd.doubleValue();
	}

	private static GeometryMapper parseGeometry(AbstractGeometry gmlG, Geometry geom, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (gmlG.isSetId()) {
			geom.setGmlId(new GmlId(gmlG.getId()));
		}
		co.addGeometry(geom);
		GeometryMapper geomMapper = new GeometryMapper(geom, config, polygons, linkedPolygons, vertexMap);
		gmlG.accept(geomMapper);
		return geomMapper;
	}

	private static void parseIntoGeometry(AbstractGeometry geometry, GeometryMapper geomMapper, BoundarySurface bs,
			BuildingInstallation coBi) {
		geomMapper.setBoundarySurface(bs);
		geomMapper.setBuildingInstallation(coBi);
		geometry.accept(geomMapper);
	}

340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
	public static void mapTriangulatedSurface(Geometry geom, TriangulatedSurface surface, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (surface == null) {
			return;
		}
		TrianglePatchArrayProperty trianglePatches = surface.getTrianglePatches();
		if (trianglePatches == null) {
			return;
		}
		GeometryMapper mapper = new GeometryMapper(geom, config, polygons, linkedPolygons, vertexMap);
		List<Triangle> triangles = trianglePatches.getTriangle();
		for (Triangle t : triangles) {
			if (t == null) {
				continue;
			}
			ConcretePolygon poly = new ConcretePolygon();
			LinearRing ext = new LinearRing(LinearRingType.EXTERIOR);
			poly.setExteriorRing(ext);
			mapper.mapRing(t.getExterior(), ext);
			geom.addPolygon(poly);
		}
	}

364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
	public static void mapLod0MultiSurface(MultiSurfaceProperty lod0ms, CityObject co, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (lod0ms == null || !lod0ms.isSetMultiSurface()) {
			return;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD0);
		parseGeometry(lod0ms.getMultiSurface(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod1MultiSurface(MultiSurfaceProperty lod1ms, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod1ms == null || !lod1ms.isSetMultiSurface()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD1);
		return parseGeometry(lod1ms.getMultiSurface(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod2MultiSurface(MultiSurfaceProperty lod2MultiSurface, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod2MultiSurface == null || !lod2MultiSurface.isSetMultiSurface()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
		return parseGeometry(lod2MultiSurface.getMultiSurface(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod3MultiSurface(MultiSurfaceProperty lod3MultiSurface, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod3MultiSurface == null || !lod3MultiSurface.isSetMultiSurface()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD3);
		return parseGeometry(lod3MultiSurface.getMultiSurface(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod4MultiSurface(MultiSurfaceProperty lod4MultiSurface, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod4MultiSurface == null || !lod4MultiSurface.isSetMultiSurface()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD4);
		return parseGeometry(lod4MultiSurface.getMultiSurface(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod1Solid(SolidProperty lod1Solid, CityObject co, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (lod1Solid == null || !lod1Solid.isSetSolid()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);
		return parseGeometry(lod1Solid.getSolid(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod2Solid(SolidProperty lod2Solid, CityObject co, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (lod2Solid == null || !lod2Solid.isSetSolid()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD2);
		return parseGeometry(lod2Solid.getSolid(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod3Solid(SolidProperty lod3Solid, CityObject co, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (lod3Solid == null || !lod3Solid.isSetSolid()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD3);
		return parseGeometry(lod3Solid.getSolid(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static GeometryMapper mapLod4Solid(SolidProperty lod4Solid, CityObject co, ParserConfiguration config,
			Map<String, ConcretePolygon> polygons, List<Pair<String, Geometry>> linkedPolygons,
			Map<Vertex, Vertex> vertexMap) {
		if (lod4Solid == null || !lod4Solid.isSetSolid()) {
			return null;
		}
		Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD4);
		return parseGeometry(lod4Solid.getSolid(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static void mapLod1Geometry(GeometryProperty<? extends AbstractGeometry> lod1Geometry, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod1Geometry == null || !lod1Geometry.isSetGeometry()) {
			return;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD1);
		parseGeometry(lod1Geometry.getGeometry(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static void mapLod2Geometry(GeometryProperty<? extends AbstractGeometry> lod2Geometry, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod2Geometry == null || !lod2Geometry.isSetGeometry()) {
			return;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD2);
		parseGeometry(lod2Geometry.getGeometry(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static void mapLod3Geometry(GeometryProperty<? extends AbstractGeometry> lod3Geometry, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod3Geometry == null || !lod3Geometry.isSetGeometry()) {
			return;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD3);
		parseGeometry(lod3Geometry.getGeometry(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static void mapLod4Geometry(GeometryProperty<? extends AbstractGeometry> lod4Geometry, CityObject co,
			ParserConfiguration config, Map<String, ConcretePolygon> polygons,
			List<Pair<String, Geometry>> linkedPolygons, Map<Vertex, Vertex> vertexMap) {
		if (lod4Geometry == null || !lod4Geometry.isSetGeometry()) {
			return;
		}
		Geometry geom = new Geometry(GeometryType.MULTI_SURFACE, Lod.LOD4);
		parseGeometry(lod4Geometry.getGeometry(), geom, co, config, polygons, linkedPolygons, vertexMap);
	}

	public static void mapBoundarySurfaceIntoGeometry(MultiSurfaceProperty msp, GeometryMapper geom, BoundarySurface bs,
			BuildingInstallation coBi) {
		if (msp == null || !msp.isSetGeometry()) {
			return;
		}
		parseIntoGeometry(msp.getGeometry(), geom, bs, coBi);
	}

	public static void mapBuildingInstallationIntoGeometry(GeometryProperty<? extends AbstractGeometry> gp,
			GeometryMapper geom, BuildingInstallation coBi) {
		if (gp == null || !gp.isSetGeometry()) {
			return;
		}
		parseIntoGeometry(gp.getGeometry(), geom, null, coBi);
	}

	public Geometry getGeometry() {
		return geom;
	}

}