Skip to content

Commit

Permalink
handle offset with a new slot
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoxing committed Oct 14, 2020
1 parent 6b11d4e commit 4767a56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/include/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ namespace seed

bool Generate3mxMetadata(const std::string& output);

bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, const std::string& outputDataRootRelative, const std::string& output);
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, osg::Vec3d offset, const std::string& outputDataRootRelative, const std::string& output);
}
}
6 changes: 5 additions & 1 deletion src/core/src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ namespace seed
return true;
}

bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, const std::string& outputDataRootRelative, const std::string& output)
bool Generate3mx(const std::string& srs, osg::Vec3d srsOrigin, osg::Vec3d offset, const std::string& outputDataRootRelative, const std::string& output)
{
neb::CJsonObject oJson;
oJson.Add("3mxVersion", 1);
Expand All @@ -397,6 +397,10 @@ namespace seed
oJsonLayer["SRSOrigin"].Add(srsOrigin.x());
oJsonLayer["SRSOrigin"].Add(srsOrigin.y());
oJsonLayer["SRSOrigin"].Add(srsOrigin.z());
oJsonLayer.AddEmptySubArray("offset");
oJsonLayer["offset"].Add(offset.x());
oJsonLayer["offset"].Add(offset.y());
oJsonLayer["offset"].Add(offset.z());
oJsonLayer.Add("root", outputDataRootRelative);
oJson.AddEmptySubArray("layers");
oJson["layers"].Add(oJsonLayer);
Expand Down
2 changes: 1 addition & 1 deletion src/osgbTo3mx/osgTo3mx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace seed
{
seed::log::DumpLog(seed::log::Warning, "Can NOT open file %s!", input.c_str());
}
return Generate3mx(srs, srsOrigin, outputDataRootRelative, output);
return Generate3mx(srs, srsOrigin, osg::Vec3d(0, 0, 0), outputDataRootRelative, output);
}

bool OsgTo3mx::ConvertTile(const std::string& inputData, const std::string& outputData, const std::string& tileName, osg::BoundingBox& bb)
Expand Down
2 changes: 1 addition & 1 deletion src/pointcloudToLod/pointcloudToLod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ namespace seed
return false;
}

if (!Generate3mx(m_oPointVisitor->GetSRSName(), m_oPointVisitor->GetOffset(), outputDataRootRelative, output3mx))
if (!Generate3mx(m_oPointVisitor->GetSRSName(), osg::Vec3d(0, 0, 0), m_oPointVisitor->GetOffset(), outputDataRootRelative, output3mx))
{
seed::log::DumpLog(seed::log::Critical, "Generate %s failed!", outputMetadata.c_str());
return false;
Expand Down

0 comments on commit 4767a56

Please sign in to comment.