mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
no need to set 'value' attribute on rasters except for point query
This commit is contained in:
parent
feaddaeed0
commit
226e5b2d7a
@ -109,7 +109,6 @@ gdal_datasource::gdal_datasource(parameters const& params)
|
||||
width_ = dataset->GetRasterXSize();
|
||||
height_ = dataset->GetRasterYSize();
|
||||
desc_.add_descriptor(mapnik::attribute_descriptor("nodata", mapnik::Integer));
|
||||
desc_.add_descriptor(mapnik::attribute_descriptor("value", mapnik::Double,false,8));
|
||||
|
||||
double tr[6];
|
||||
bool bbox_override = false;
|
||||
|
||||
@ -75,7 +75,6 @@ gdal_featureset::gdal_featureset(GDALDataset& dataset,
|
||||
nodata_value_(nodata),
|
||||
first_(true)
|
||||
{
|
||||
ctx_->push("value");
|
||||
ctx_->push("nodata");
|
||||
}
|
||||
|
||||
@ -456,7 +455,6 @@ feature_ptr gdal_featureset::get_feature_at_point(mapnik::coord2d const& pt)
|
||||
double nodata = band->GetNoDataValue(&raster_has_nodata);
|
||||
double value;
|
||||
band->RasterIO(GF_Read, x, y, 1, 1, &value, 1, 1, GDT_Float64, 0, 0);
|
||||
|
||||
if (! raster_has_nodata || value != nodata)
|
||||
{
|
||||
// construct feature
|
||||
@ -464,7 +462,11 @@ feature_ptr gdal_featureset::get_feature_at_point(mapnik::coord2d const& pt)
|
||||
geometry_type * point = new geometry_type(mapnik::Point);
|
||||
point->move_to(pt.x, pt.y);
|
||||
feature->add_geometry(point);
|
||||
feature->put("value",value);
|
||||
feature->put_new("value",value);
|
||||
if (raster_has_nodata)
|
||||
{
|
||||
feature->put_new("nodata",nodata);
|
||||
}
|
||||
return feature;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user