Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jklimke/libcitygml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Klimke committed Aug 14, 2017
2 parents a1bfff6 + 67fa6af commit d56031f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sources/src/parser/geocoordinatetransformer.cpp
Expand Up @@ -136,6 +136,24 @@ namespace citygml {

if (!model->getEnvelope().srsName().empty()) {
transformation.setSourceSRS(model->getEnvelope().srsName());
if (model->getEnvelope().validBounds()) {
if (transformation.valid()) {
TVec3d lowerBound = model->getEnvelope().getLowerBound();
TVec3d upperBound = model->getEnvelope().getUpperBound();

transformation.transform(lowerBound);
transformation.transform(upperBound);

Envelope* newEnvelope = new Envelope(m_destinationSRS);
newEnvelope->setLowerBound(lowerBound);
newEnvelope->setUpperBound(upperBound);

model->setEnvelope(newEnvelope);
}
else {
CITYGML_LOG_WARN(m_logger, "No valid spatial reference system is given for CityModel with id '" << model->getId() << "'. Envelope (Bounding Box) is not transformed.");
}
}
}

for (unsigned int i = 0; i < model->getNumRootCityObjects(); i++) {
Expand Down

0 comments on commit d56031f

Please sign in to comment.