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


C++ mapnik::featureset_ptr方法代码示例

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


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

示例1: features_at_point

featureset_ptr ogr_datasource::features_at_point(coord2d const& pt) const
{
    if (!is_bound_) bind();
   
    if (dataset_ && layer_.is_valid())
    {
        OGRLayer* layer = layer_.layer();

        if (indexed_)
        {
            filter_at_point filter(pt);
            
            return featureset_ptr(new ogr_index_featureset<filter_at_point> (*dataset_,
                                                                             *layer,
                                                                             filter,
                                                                             index_name_,
                                                                             desc_.get_encoding(),
                                                                             multiple_geometries_));
        }
        else
        {
            OGRPoint point;
            point.setX (pt.x);
            point.setY (pt.y);

            return featureset_ptr(new ogr_featureset (*dataset_,
                                                      *layer,
                                                      point,
                                                      desc_.get_encoding(),
                                                      multiple_geometries_));
        }
    }

    return featureset_ptr();
}
开发者ID:ParveenArora,项目名称:mapnik,代码行数:35,代码来源:ogr_datasource.cpp

示例2: features

featureset_ptr ogr_datasource::features(query const& q) const
{
    if (! is_bound_) bind();
   
    if (dataset_ && layer_.is_valid())
    {
        OGRLayer* layer = layer_.layer();

        if (indexed_)
        {
            filter_in_box filter(q.get_bbox());
            
            return featureset_ptr(new ogr_index_featureset<filter_in_box>(*dataset_,
                                                                          *layer,
                                                                          filter,
                                                                          index_name_,
                                                                          desc_.get_encoding(),
                                                                          multiple_geometries_));
        }
        else
        {
            return featureset_ptr(new ogr_featureset (*dataset_,
                                                      *layer,
                                                      q.get_bbox(),
                                                      desc_.get_encoding(),
                                                      multiple_geometries_));
        }
    }

    return featureset_ptr();
}
开发者ID:ParveenArora,项目名称:mapnik,代码行数:31,代码来源:ogr_datasource.cpp

示例3: features

featureset_ptr ogr_datasource::features(query const& q) const
{
   if (!is_bound_) bind();
   
   if (dataset_ && layer_)
   {

        // TODO - actually filter fields!
        // http://trac.osgeo.org/gdal/wiki/rfc29_desired_fields
        // http://trac.osgeo.org/gdal/wiki/rfc28_sqlfunc
#if 0
        std::ostringstream s;
            
        s << "select ";
        std::set<std::string> const& props=q.property_names();
        std::set<std::string>::const_iterator pos=props.begin();
        std::set<std::string>::const_iterator end=props.end();
        while (pos != end)
        {
           s <<",\""<<*pos<<"\"";
           ++pos;
        }   
        s << " from " << layerName_ ;

        // execute existing SQL
        OGRLayer* layer = dataset_->ExecuteSQL (s.str(), poly);

        // layer must be freed
        dataset_->ReleaseResultSet (layer);
#endif

        if (indexed_)
        {
            filter_in_box filter(q.get_bbox());
            
            return featureset_ptr(new ogr_index_featureset<filter_in_box> (*dataset_,
                                                                           *layer_,
                                                                           filter,
                                                                           index_name_,
                                                                           desc_.get_encoding(),
                                                                           multiple_geometries_));
        }
        else
        {
            return featureset_ptr(new ogr_featureset (*dataset_,
                                                      *layer_,
                                                      q.get_bbox(),
                                                      desc_.get_encoding(),
                                                      multiple_geometries_));
        }
   }
   return featureset_ptr();
}
开发者ID:dpaleino,项目名称:mapnik,代码行数:53,代码来源:ogr_datasource.cpp

示例4: features_at_point

featureset_ptr gdal_datasource::features_at_point(coord2d const& pt) const
{
    if (!is_bound_) bind();

    gdal_query gq = pt;
    return featureset_ptr(new gdal_featureset(*open_dataset(), band_, gq, extent_, width_, height_, nbands_, dx_, dy_,  filter_factor_));
}
开发者ID:BenMoores,项目名称:mapnik-trunk,代码行数:7,代码来源:gdal_datasource.cpp

示例5: features

featureset_ptr geos_datasource::features(query const& q) const
{
    if (!is_bound_) bind();

    const mapnik::box2d<double> extent = q.get_bbox();

    std::ostringstream s;
    s << "POLYGON(("
      << extent.minx() << " " << extent.miny() << ","
      << extent.maxx() << " " << extent.miny() << ","
      << extent.maxx() << " " << extent.maxy() << ","
      << extent.minx() << " " << extent.maxy() << ","
      << extent.minx() << " " << extent.miny()
      << "))";

#ifdef MAPNIK_DEBUG
    clog << "GEOS Plugin: using extent: " << s.str() << endl;
#endif

    return featureset_ptr(new geos_featureset (*geometry_,
                                               GEOSGeomFromWKT(s.str().c_str()),
                                               geometry_id_,
                                               geometry_data_,
                                               geometry_data_name_,
                                               desc_.get_encoding(),
                                               multiple_geometries_));
}
开发者ID:BenMoores,项目名称:mapnik-trunk,代码行数:27,代码来源:geos_datasource.cpp

示例6: features_at_point

featureset_ptr rasterlite_datasource::features_at_point(coord2d const& pt) const
{
    if (!is_bound_) bind();
   
    rasterlite_query gq = pt;
    return featureset_ptr(new rasterlite_featureset(open_dataset(), gq));
}
开发者ID:BenMoores,项目名称:mapnik-trunk,代码行数:7,代码来源:rasterlite_datasource.cpp

示例7: features

featureset_ptr rasterlite_datasource::features(query const& q) const
{
    if (!is_bound_) bind();

    rasterlite_query gq = q;
    return featureset_ptr(new rasterlite_featureset(open_dataset(), gq));
}
开发者ID:BenMoores,项目名称:mapnik-trunk,代码行数:7,代码来源:rasterlite_datasource.cpp

示例8: features_at_point

featureset_ptr kismet_datasource::features_at_point(coord2d const& pt, double tol) const
{
    if (! is_bound_) bind();

    MAPNIK_LOG_DEBUG(kismet) << "kismet_datasource::features_at_point()";

    return featureset_ptr();
}
开发者ID:LeadsPlus,项目名称:mapnik,代码行数:8,代码来源:kismet_datasource.cpp

示例9: features_at_point

featureset_ptr raster_datasource::features_at_point(coord2d const&) const
{
#ifdef MAPNIK_DEBUG
    std::clog << "Raster Plugin: feature_at_point not supported for raster.input" << std::endl;
#endif

    return featureset_ptr();
}
开发者ID:bygreencn,项目名称:mapnik,代码行数:8,代码来源:raster_datasource.cpp

示例10: features_at_point

featureset_ptr kismet_datasource::features_at_point(coord2d const& pt) const
{
    if (!is_bound_) bind();
    
    //cout << "kismet_datasource::features_at_point()" << endl;

    return featureset_ptr();
}
开发者ID:dpaleino,项目名称:mapnik,代码行数:8,代码来源:kismet_datasource.cpp

示例11: features

featureset_ptr ogr_datasource::features(query const& q) const
{
    if (! is_bound_) bind();

#ifdef MAPNIK_STATS
    mapnik::progress_timer __stats__(std::clog, "ogr_datasource::features");
#endif

    if (dataset_ && layer_.is_valid())
    {
        // First we validate query fields: https://github.com/mapnik/mapnik/issues/792

        std::vector<attribute_descriptor> const& desc_ar = desc_.get_descriptors();
        // feature context (schema)
        mapnik::context_ptr ctx = boost::make_shared<mapnik::context_type>();

        std::vector<attribute_descriptor>::const_iterator itr = desc_ar.begin();
        std::vector<attribute_descriptor>::const_iterator end = desc_ar.end();

        for (; itr!=end; ++itr) ctx->push(itr->get_name()); // TODO only push query attributes

        validate_attribute_names(q, desc_ar);

        OGRLayer* layer = layer_.layer();

        if (indexed_)
        {
            filter_in_box filter(q.get_bbox());

            return featureset_ptr(new ogr_index_featureset<filter_in_box>(ctx,
                                                                          *layer,
                                                                          filter,
                                                                          index_name_,
                                                                          desc_.get_encoding()));
        }
        else
        {
            return featureset_ptr(new ogr_featureset(ctx,
                                                      *layer,
                                                      q.get_bbox(),
                                                      desc_.get_encoding()));
        }
    }

    return featureset_ptr();
}
开发者ID:PaulWagener,项目名称:mapnik,代码行数:46,代码来源:ogr_datasource.cpp

示例12: features_at_point

featureset_ptr ogr_datasource::features_at_point(coord2d const& pt, double tol) const
{
    if (!is_bound_) bind();

#ifdef MAPNIK_STATS
    mapnik::progress_timer __stats__(std::clog, "ogr_datasource::features_at_point");
#endif

    if (dataset_ && layer_.is_valid())
    {
        std::vector<attribute_descriptor> const& desc_ar = desc_.get_descriptors();
        // feature context (schema)
        mapnik::context_ptr ctx = boost::make_shared<mapnik::context_type>();

        std::vector<attribute_descriptor>::const_iterator itr = desc_ar.begin();
        std::vector<attribute_descriptor>::const_iterator end = desc_ar.end();
        for (; itr!=end; ++itr) ctx->push(itr->get_name());

        OGRLayer* layer = layer_.layer();

        if (indexed_)
        {
            filter_at_point filter(pt);

            return featureset_ptr(new ogr_index_featureset<filter_at_point> (ctx,
                                                                             *layer,
                                                                             filter,
                                                                             index_name_,
                                                                             desc_.get_encoding()));
        }
        else
        {
            OGRPoint point;
            point.setX (pt.x);
            point.setY (pt.y);

            return featureset_ptr(new ogr_featureset (ctx,
                                                      *layer,
                                                      point,
                                                      desc_.get_encoding()));
        }
    }

    return featureset_ptr();
}
开发者ID:PaulWagener,项目名称:mapnik,代码行数:45,代码来源:ogr_datasource.cpp

示例13: features_at_point

featureset_ptr ogr_datasource::features_at_point(coord2d const& pt, double tol) const
{
#ifdef MAPNIK_STATS
    mapnik::progress_timer __stats__(std::clog, "ogr_datasource::features_at_point");
#endif

    if (dataset_ && layer_.is_valid())
    {
        std::vector<attribute_descriptor> const& desc_ar = desc_.get_descriptors();
        // feature context (schema)
        mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();

        for (auto const& attr_info : desc_ar)
        {
            ctx->push(attr_info.get_name()); // TODO only push query attributes
        }

        OGRLayer* layer = layer_.layer();

        if (indexed_)
        {
            filter_at_point filter(pt, tol);

            return featureset_ptr(new ogr_index_featureset<filter_at_point> (ctx,
                                                                             *layer,
                                                                             filter,
                                                                             index_name_,
                                                                             desc_.get_encoding()));
        }
        else
        {
            mapnik::box2d<double> bbox(pt, pt);
            bbox.pad(tol);
            return featureset_ptr(new ogr_featureset (ctx,
                                                      *layer,
                                                      bbox,
                                                      desc_.get_encoding()));
        }
    }

    return featureset_ptr();
}
开发者ID:DavidLiuGitHub,项目名称:mapnik,代码行数:42,代码来源:ogr_datasource.cpp

示例14: features_at_point

featureset_ptr gdal_datasource::features_at_point(coord2d const& pt) const
{
    if (! is_bound_) bind();

    gdal_query gq = pt;

    // TODO - move to boost::make_shared, but must reduce # of args to <= 9
    return featureset_ptr(new gdal_featureset(*open_dataset(),
                                              band_,
                                              gq,
                                              extent_,
                                              width_,
                                              height_,
                                              nbands_,
                                              dx_,
                                              dy_,
                                              filter_factor_));
}
开发者ID:eightysteele,项目名称:mapnik,代码行数:18,代码来源:gdal_datasource.cpp

示例15: features_at_point

featureset_ptr geos_datasource::features_at_point(coord2d const& pt) const
{
    if (!is_bound_) bind();

    std::ostringstream s;
    s << "POINT(" << pt.x << " " << pt.y << ")";

#ifdef MAPNIK_DEBUG
    clog << "GEOS Plugin: using point: " << s.str() << endl;
#endif

    return featureset_ptr(new geos_featureset (*geometry_,
                                               GEOSGeomFromWKT(s.str().c_str()),
                                               geometry_id_,
                                               geometry_data_,
                                               geometry_data_name_,
                                               desc_.get_encoding(),
                                               multiple_geometries_));
}
开发者ID:BenMoores,项目名称:mapnik-trunk,代码行数:19,代码来源:geos_datasource.cpp


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