当前位置: 首页>>代码示例>>C++>>正文


C++ SpatialReference::setFromUserInput方法代码示例

本文整理汇总了C++中SpatialReference::setFromUserInput方法的典型用法代码示例。如果您正苦于以下问题:C++ SpatialReference::setFromUserInput方法的具体用法?C++ SpatialReference::setFromUserInput怎么用?C++ SpatialReference::setFromUserInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SpatialReference的用法示例。


在下文中一共展示了SpatialReference::setFromUserInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateSDOEntry

void Writer::CreateSDOEntry(std::string const& block_table,
                            boost::uint32_t srid,
                            pdal::Bounds<double> bounds,
                            bool is3d)
{
    std::ostringstream oss;
    oss.setf(std::ios_base::fixed, std::ios_base::floatfield);
    boost::uint32_t precision = getOptions().getValueOrDefault<boost::uint32_t>("stream_output_precision", 8);
    oss.precision(precision);

    std::ostringstream s_srid;

    if (srid == 0)
    {
        s_srid << "NULL";
    }
    else
    {
        s_srid << srid;
    }

    double tolerance = 0.05;


    pdal::Bounds<double> e = bounds;

    if (srid)
    {
        SpatialReference ref;
        ref.setFromUserInput("EPSG:"+s_srid.str());
        if (ref.isGeographic())
        {
            // FIXME: This should be overrideable
            e.setMinimum(0,-180.0);
            e.setMaximum(0,180.0);
            e.setMinimum(1,-90.0);
            e.setMaximum(1,90.0);
            e.setMinimum(2,0.0);
            e.setMaximum(2,20000.0);

            tolerance = 0.0005;
        }
    }


    oss <<  "INSERT INTO user_sdo_geom_metadata VALUES ('" << block_table <<
        "','extent', MDSYS.SDO_DIM_ARRAY(";

    oss << "MDSYS.SDO_DIM_ELEMENT('X', " << e.getMinimum(0) << "," << e.getMaximum(0) <<"," << tolerance << "),"
        "MDSYS.SDO_DIM_ELEMENT('Y', " << e.getMinimum(1) << "," << e.getMaximum(1) <<"," << tolerance << ")";

    if (is3d)
    {
        oss << ",";
        oss <<"MDSYS.SDO_DIM_ELEMENT('Z', "<< e.getMinimum(2) << "," << e.getMaximum(2) << "," << tolerance << ")";
    }
    oss << ")," << s_srid.str() << ")";

    m_session->once << oss.str();

    oss.str("");

}
开发者ID:dakcarto,项目名称:PDAL,代码行数:63,代码来源:Writer.cpp


注:本文中的SpatialReference::setFromUserInput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。