Skip to content

How do I get the latitude and longitude of a building #2608

Discussion options

You must be logged in to vote
osg::ref_ptr<FeatureCursor> cursor = data->createFeatureCursor();
while(cursor->hasMore()){
      osgEarth::Feature* feature = cursor->nextFeature();
      auto id = feature->getFID();
      osg::BoundingSphered bound;
      feature->getWorldBound(osgEarth::SpatialReference::get("wgs84"),bound);
      auto ge = feature->getGeometry();
      osg::Vec3d pos = bound.center();
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by luohuiiqng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant