void MDAL::DriverGdal::createMesh() { Vertices vertices( meshGDALDataset()->mNPoints ); bool is_longitude_shifted = initVertices( vertices ); Faces faces( meshGDALDataset()->mNVolumes ); initFaces( vertices, faces, is_longitude_shifted ); mMesh.reset( new MemoryMesh( name(), vertices.size(), faces.size(), 4, //maximum quads computeExtent( vertices ), mFileName ) ); mMesh->vertices = vertices; mMesh->faces = faces; bool proj_added = addSrcProj(); if ( ( !proj_added ) && is_longitude_shifted ) { std::string wgs84( "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ); mMesh->setSourceCrs( wgs84 ); } }
Coordinate MapReprojector::reprojectFromWgs84(const Coordinate& c, shared_ptr<OGRSpatialReference> srs) { shared_ptr<OGRSpatialReference> wgs84(new OGRSpatialReference()); wgs84->importFromEPSG(4326); return reproject(c, wgs84, srs); }
boost::shared_ptr<OGRSpatialReference> OsmApiDbReader::getProjection() const { boost::shared_ptr<OGRSpatialReference> wgs84(new OGRSpatialReference()); if (wgs84->SetWellKnownGeogCS("WGS84") != OGRERR_NONE) { throw HootException("Error creating EPSG:4326 projection."); } return wgs84; }
void Conflator::_saveMap(QString path) { LOG_INFO("Writing debug .osm file..." << path.toStdString()); shared_ptr<OsmMap> wgs84(new OsmMap(_map)); MapReprojector::reprojectToWgs84(wgs84); OsmWriter writer; writer.setIncludeHootInfo(true); writer.setIncludeIds(true); writer.write(wgs84, path); }
void MDAL::LoaderGdal::createMesh() { Vertices vertices( meshGDALDataset()->mNPoints ); bool is_longitude_shifted = initVertices( vertices ); Faces faces( meshGDALDataset()->mNVolumes ); initFaces( vertices, faces, is_longitude_shifted ); mMesh.reset( new Mesh() ); mMesh->vertices = vertices; mMesh->faces = faces; bool proj_added = addSrcProj(); if ( ( !proj_added ) && is_longitude_shifted ) { std::string wgs84( "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ); mMesh->setSourceCrs( wgs84 ); } }