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


C++ OGRGeometryCollection::assignSpatialReference方法代码示例

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


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

示例1: getCurveGeometry

OGRGeometry* OGRGeometryCollection::getCurveGeometry(
    const char* const* papszOptions) const
{
    OGRGeometryCollection* poGC =
        OGRGeometryFactory::createGeometry(
            OGR_GT_GetCurve(getGeometryType()))->toGeometryCollection();
    if( poGC == nullptr )
        return nullptr;
    poGC->assignSpatialReference( getSpatialReference() );
    bool bHasCurveGeometry = false;
    for( int iGeom = 0; iGeom < nGeomCount; iGeom++ )
    {
        OGRGeometry* poSubGeom =
            papoGeoms[iGeom]->getCurveGeometry(papszOptions);
        if( poSubGeom->hasCurveGeometry() )
            bHasCurveGeometry = true;
        poGC->addGeometryDirectly( poSubGeom );
    }
    if( !bHasCurveGeometry )
    {
        delete poGC;
        return clone();
    }
    return poGC;
}
开发者ID:ksshannon,项目名称:gdal,代码行数:25,代码来源:ogrgeometrycollection.cpp

示例2: getSpatialReference

OGRGeometry *OGRGeometryCollection::clone() const

{
    OGRGeometryCollection       *poNewGC;

    poNewGC = new OGRGeometryCollection;
    poNewGC->assignSpatialReference( getSpatialReference() );

    for( int i = 0; i < nGeomCount; i++ )
    {
        poNewGC->addGeometry( papoGeoms[i] );
    }

    return poNewGC;
}
开发者ID:puggan,项目名称:OpenCPN,代码行数:15,代码来源:ogrgeometrycollection.cpp

示例3: getLinearGeometry

OGRGeometry* OGRGeometryCollection::getLinearGeometry(double dfMaxAngleStepSizeDegrees,
                                                        const char* const* papszOptions) const
{
    OGRGeometryCollection* poGC = (OGRGeometryCollection*)
        OGRGeometryFactory::createGeometry(OGR_GT_GetLinear(getGeometryType()));
    if( poGC == NULL )
        return NULL;
    poGC->assignSpatialReference( getSpatialReference() );
    for( int iGeom = 0; iGeom < nGeomCount; iGeom++ )
    {
        OGRGeometry* poSubGeom = papoGeoms[iGeom]->getLinearGeometry(dfMaxAngleStepSizeDegrees,
                                                                       papszOptions);
        poGC->addGeometryDirectly( poSubGeom );
    }
    return poGC;
}
开发者ID:bbradbury,项目名称:lib_gdal,代码行数:16,代码来源:ogrgeometrycollection.cpp

示例4: toGeometryCollection

OGRGeometry *OGRGeometryCollection::clone() const

{
    OGRGeometryCollection *poNewGC =
        OGRGeometryFactory::createGeometry(getGeometryType())->
            toGeometryCollection();
    poNewGC->assignSpatialReference( getSpatialReference() );
    poNewGC->flags = flags;

    for( auto&& poSubGeom: *this )
    {
        if( poNewGC->addGeometry( poSubGeom ) != OGRERR_NONE )
        {
            delete poNewGC;
            return nullptr;
        }
    }

    return poNewGC;
}
开发者ID:ksshannon,项目名称:gdal,代码行数:20,代码来源:ogrgeometrycollection.cpp

示例5: getSpatialReference

OGRGeometry *OGRGeometryCollection::clone() const

{
    OGRGeometryCollection       *poNewGC;

    poNewGC = (OGRGeometryCollection*)
            OGRGeometryFactory::createGeometry(getGeometryType());
    if( poNewGC == NULL )
        return NULL;
    poNewGC->assignSpatialReference( getSpatialReference() );
    poNewGC->flags = flags;

    for( int i = 0; i < nGeomCount; i++ )
    {
        if( poNewGC->addGeometry( papoGeoms[i] ) != OGRERR_NONE )
        {
            delete poNewGC;
            return NULL;
        }
    }

    return poNewGC;
}
开发者ID:bbradbury,项目名称:lib_gdal,代码行数:23,代码来源:ogrgeometrycollection.cpp


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