本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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_));
}
示例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_));
}
示例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));
}
示例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));
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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_));
}
示例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_));
}