From c80ec7e53375df34d5279021531ee34ba142c7e9 Mon Sep 17 00:00:00 2001 From: Claus Nagel Date: Tue, 21 Apr 2015 23:16:39 +0200 Subject: [PATCH] [citygml export] surface data objects without targets are exported again to avoid invalid xlinks --- .../exporter/database/content/DBAppearance.java | 8 ++++---- .../exporter/database/content/DBTextureParam.java | 10 ++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/org/citydb/modules/citygml/exporter/database/content/DBAppearance.java b/src/org/citydb/modules/citygml/exporter/database/content/DBAppearance.java index 77568c3d1..7d11d4fef 100644 --- a/src/org/citydb/modules/citygml/exporter/database/content/DBAppearance.java +++ b/src/org/citydb/modules/citygml/exporter/database/content/DBAppearance.java @@ -321,11 +321,11 @@ private void addSurfaceData(Appearance appearance, ResultSet rs, GlobalAppearanc surfaceData.setId(gmlId); } - // retrieve targets. if there are no targets we suppress this surface data object - boolean hasTargets = globalAppResolver == null ? textureParamExporter.read(surfaceData, surfaceDataId) : + // retrieve targets + if (globalAppResolver == null) + textureParamExporter.read(surfaceData, surfaceDataId); + else textureParamExporter.read(surfaceData, surfaceDataId, globalAppResolver.getSurfaceDataTarget(surfaceDataId)); - if (!hasTargets) - return; String gmlName = rs.getString(10); String gmlNameCodespace = rs.getString(11); diff --git a/src/org/citydb/modules/citygml/exporter/database/content/DBTextureParam.java b/src/org/citydb/modules/citygml/exporter/database/content/DBTextureParam.java index cf9816fac..7be292c54 100644 --- a/src/org/citydb/modules/citygml/exporter/database/content/DBTextureParam.java +++ b/src/org/citydb/modules/citygml/exporter/database/content/DBTextureParam.java @@ -80,7 +80,7 @@ private void init() throws SQLException { } } - public boolean read(AbstractSurfaceData surfaceData, long surfaceDataId) throws SQLException { + public void read(AbstractSurfaceData surfaceData, long surfaceDataId) throws SQLException { ResultSet rs = null; try { @@ -95,15 +95,13 @@ public boolean read(AbstractSurfaceData surfaceData, long surfaceDataId) throws fillTextureParam(surfaceData, worldToTexture, texCoordsObj, target, isReverse); } - - return surfaceData.hasLocalProperty("hasTargets"); } finally { if (rs != null) rs.close(); } } - public boolean read(AbstractSurfaceData surfaceData, long surfaceDataId, SurfaceDataTarget target) throws SQLException { + public void read(AbstractSurfaceData surfaceData, long surfaceDataId, SurfaceDataTarget target) throws SQLException { PreparedStatement stmt = null; ResultSet rs = null; @@ -124,8 +122,6 @@ public boolean read(AbstractSurfaceData surfaceData, long surfaceDataId, Surface fillTextureParam(surfaceData, worldToTexture, texCoordsObj, geometry.getGmlId(), geometry.isReverse()); } - - return surfaceData.hasLocalProperty("hasTargets"); } finally { if (rs != null) { try { @@ -226,8 +222,6 @@ else if (worldToTexture != null) { } } } - - surfaceData.setLocalProperty("hasTargets", true); } @Override