Skip to content

Commit 29d22a3

Browse files
committed
updated citygml4j to 3.2.3
1 parent 9b03435 commit 29d22a3

File tree

10 files changed

+47
-30
lines changed

10 files changed

+47
-30
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ subprojects {
8484
options {
8585
title = "$project.name $project.version"
8686
header = title
87-
overview "$projectDir/build/tmp/javadoc/overview.html"
87+
overview = "$projectDir/build/tmp/javadoc/overview.html"
8888
bottom """
8989
<a href="${appIssueTrackerUrl}">Report a bug or suggest an enhancement</a><br>
9090
${project.name} is open source and licensed under the <a target="_blank" href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br>

citydb-io-citygml/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def citygml4j_version = '3.2.3-SNAPSHOT'
1+
def citygml4j_version = '3.2.3'
22

33
dependencies {
44
api project(':citydb-logging')

citydb-io-citygml/src/main/java/org/citydb/io/citygml/adapter/appearance/GeoreferencedTextureAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void build(org.citygml4j.core.model.appearance.GeoreferencedTexture sourc
6969
}
7070

7171
if (source.getOrientation() != null) {
72-
target.setOrientation(source.getOrientation().toRowMajorList());
72+
target.setOrientation(source.getOrientation().toRowMajor());
7373
}
7474
}
7575

@@ -86,7 +86,7 @@ public void serialize(GeoreferencedTexture source, org.citygml4j.core.model.appe
8686
target.setReferencePoint(new PointProperty(helper.getPoint(referencePoint, false))));
8787

8888
source.getOrientation().ifPresent(transformationMatrix ->
89-
target.setOrientation(TransformationMatrix2x2.ofRowMajorList(transformationMatrix.toRowMajor())));
89+
target.setOrientation(TransformationMatrix2x2.ofRowMajor(transformationMatrix.toRowMajor())));
9090
}
9191

9292
private void processWorldFile(org.citygml4j.core.model.appearance.GeoreferencedTexture source, ExternalFile textureImage, ModelBuilderHelper helper) throws ModelBuildException {
@@ -121,7 +121,7 @@ private void processWorldFile(org.citygml4j.core.model.appearance.GeoreferencedT
121121
}
122122

123123
if (content.size() == 6) {
124-
source.setOrientation(TransformationMatrix2x2.ofRowMajorList(content.subList(0, 4)));
124+
source.setOrientation(TransformationMatrix2x2.ofRowMajor(content.subList(0, 4)));
125125
source.setReferencePoint(new PointProperty(
126126
new org.xmlobjects.gml.model.geometry.primitives.Point(
127127
new DirectPosition(content.subList(4, 6)))));

citydb-io-citygml/src/main/java/org/citydb/io/citygml/adapter/appearance/builder/AppearanceHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private void addMapping(GeometryReference reference, TexCoordList texCoordList,
206206
private void addMapping(GeometryReference reference, TexCoordGen texCoordGen, ParameterizedTexture target) {
207207
if (texCoordGen.getWorldToTexture() != null) {
208208
getTargets(reference).forEach(surface ->
209-
target.addWorldToTextureMapping(surface, texCoordGen.getWorldToTexture().toRowMajorList()));
209+
target.addWorldToTextureMapping(surface, texCoordGen.getWorldToTexture().toRowMajor()));
210210
}
211211
}
212212

citydb-io-citygml/src/main/java/org/citydb/io/citygml/adapter/appearance/serializer/AppearanceHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void addWorldToTextureTargets(Map<Surface<?>, Matrix3x4> mapping, Paramet
153153
String surfaceId = k.getOrCreateObjectId();
154154
if (geometries.contains(surfaceId) && targets.add(surfaceId)) {
155155
TexCoordGen texCoordGen = new TexCoordGen();
156-
texCoordGen.setWorldToTexture(TransformationMatrix3x4.ofRowMajorList(v.toRowMajor()));
156+
texCoordGen.setWorldToTexture(TransformationMatrix3x4.ofRowMajor(v.toRowMajor()));
157157
target.getTextureParameterizations().add(new TextureAssociationProperty(new TextureAssociation(
158158
"#" + surfaceId, new AbstractTextureParameterizationProperty(texCoordGen))));
159159
}

citydb-io-citygml/src/main/java/org/citydb/io/citygml/adapter/core/AbstractFeatureAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public void visit(ImplicitGeometry implicitGeometry) {
6262
if (source.getBoundedBy() != null
6363
&& source.getBoundedBy().isSetEnvelope()) {
6464
List<Double> coordinates = source.getBoundedBy().getEnvelope().toCoordinateList3D();
65-
target.setEnvelope(Envelope.of(
66-
Coordinate.of(coordinates.get(0), coordinates.get(1), coordinates.get(2)),
67-
Coordinate.of(coordinates.get(3), coordinates.get(4), coordinates.get(5)))
65+
target.setEnvelope(Envelope.empty()
66+
.include(coordinates.get(0), coordinates.get(1), coordinates.get(2))
67+
.include(coordinates.get(3), coordinates.get(4), coordinates.get(5))
6868
.setSrsIdentifier(helper.getInheritedSrsName(source.getBoundedBy().getEnvelope())));
6969
}
7070

citydb-io-citygml/src/main/java/org/citydb/io/citygml/adapter/core/ImplicitGeometryAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ImplicitGeometryAdapter implements ModelBuilder<org.citygml4j.core.
4343
@Override
4444
public void build(org.citygml4j.core.model.core.ImplicitGeometry source, ImplicitGeometryProperty target, ModelBuilderHelper helper) throws ModelBuildException {
4545
if (source.getTransformationMatrix() != null) {
46-
target.setTransformationMatrix(source.getTransformationMatrix().toRowMajorList());
46+
target.setTransformationMatrix(source.getTransformationMatrix().toRowMajor());
4747
}
4848

4949
if (source.getReferencePoint() != null) {
@@ -66,7 +66,7 @@ public org.citygml4j.core.model.core.ImplicitGeometry createObject(ImplicitGeome
6666
@Override
6767
public void serialize(ImplicitGeometryProperty source, org.citygml4j.core.model.core.ImplicitGeometry target, ModelSerializerHelper helper) throws ModelSerializeException {
6868
source.getTransformationMatrix().ifPresent(transformationMatrix ->
69-
target.setTransformationMatrix(TransformationMatrix4x4.ofRowMajorList(
69+
target.setTransformationMatrix(TransformationMatrix4x4.ofRowMajor(
7070
transformationMatrix.toRowMajor())));
7171

7272
source.getReferencePoint().ifPresent(referencePoint ->

citydb-model/src/main/java/org/citydb/model/geometry/Envelope.java

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Coordinate getUpperCorner() {
5858

5959
@Override
6060
public int getVertexDimension() {
61-
return (lowerCorner.getDimension() == 2 || upperCorner.getDimension() == 2) ? 2 : 3;
61+
return lowerCorner.getDimension() == 2 || upperCorner.getDimension() == 2 ? 2 : 3;
6262
}
6363

6464
@Override
@@ -173,36 +173,46 @@ public boolean isOnTile(Coordinate point) {
173173
&& point.getY() <= upperCorner.getY();
174174
}
175175

176-
public Envelope include(Coordinate coordinate) {
177-
if (coordinate.getX() < lowerCorner.getX()) {
178-
lowerCorner.setX(coordinate.getX());
176+
public Envelope include(double x, double y) {
177+
if (x < lowerCorner.getX()) {
178+
lowerCorner.setX(x);
179179
}
180180

181-
if (coordinate.getY() < lowerCorner.getY()) {
182-
lowerCorner.setY(coordinate.getY());
181+
if (y < lowerCorner.getY()) {
182+
lowerCorner.setY(y);
183183
}
184184

185-
if (coordinate.getX() > upperCorner.getX()) {
186-
upperCorner.setX(coordinate.getX());
185+
if (x > upperCorner.getX()) {
186+
upperCorner.setX(x);
187187
}
188188

189-
if (coordinate.getY() > upperCorner.getY()) {
190-
upperCorner.setY(coordinate.getY());
189+
if (y > upperCorner.getY()) {
190+
upperCorner.setY(y);
191191
}
192192

193-
if (coordinate.getDimension() == 3 && getVertexDimension() == 3) {
194-
if (coordinate.getZ() < lowerCorner.getZ()) {
195-
lowerCorner.setZ(coordinate.getZ());
196-
}
193+
return this;
194+
}
197195

198-
if (coordinate.getZ() > upperCorner.getZ()) {
199-
upperCorner.setZ(coordinate.getZ());
200-
}
196+
public Envelope include(double x, double y, double z) {
197+
include(x, y);
198+
199+
if (z < lowerCorner.getZ()) {
200+
lowerCorner.setZ(z);
201+
}
202+
203+
if (z > upperCorner.getZ()) {
204+
upperCorner.setZ(z);
201205
}
202206

203207
return this;
204208
}
205209

210+
public Envelope include(Coordinate coordinate) {
211+
return coordinate.getDimension() == 2 ?
212+
include(coordinate.getX(), coordinate.getY()) :
213+
include(coordinate.getX(), coordinate.getY(), coordinate.getZ());
214+
}
215+
206216
public Envelope include(Envelope envelope) {
207217
return include(envelope.lowerCorner)
208218
.include(envelope.upperCorner);

citydb-model/src/main/java/org/citydb/model/util/matrix/Matrix.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ public Matrix(int rows, int columns) {
4040
this(new double[rows][columns], rows, columns);
4141
}
4242

43+
public Matrix(int rows, int columns, double value) {
44+
this(rows, columns);
45+
for (int i = 0; i < rows; i++) {
46+
Arrays.fill(elements[i], value);
47+
}
48+
}
49+
4350
public Matrix(Matrix other) {
4451
this(other.rows, other.columns);
4552
for (int i = 0; i < rows; ++i) {

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
33
}
44
rootProject.name = 'citydb-tool'
55
include 'citydb-cli'

0 commit comments

Comments
 (0)