fix rasterlite plugin + add visual test - closes #2630

This commit is contained in:
Dane Springmeyer 2015-01-09 16:13:04 -08:00
parent ac04512bb5
commit 62dbfeaa28
8 changed files with 168 additions and 11 deletions

View file

@ -114,24 +114,16 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q)
{
if (size > 0)
{
mapnik::raster_ptr rasterp = std::make_shared<mapnik::raster>(intersect, width, height, 1.0);
mapnik::image_data_rgba8 & image = rasterp->data_;
image.set(0xffffffff);
mapnik::image_data_rgba8 image(width,height);
unsigned char* raster_data = static_cast<unsigned char*>(raster);
unsigned char* image_data = image.getBytes();
std::memcpy(image_data, raster_data, size);
feature->set_raster(rasterp);
free (raster);
feature->set_raster(std::make_shared<mapnik::raster>(intersect, std::move(image), 1.0));
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Done";
}
else
{
MAPNIK_LOG_ERROR(rasterlite) << "Rasterlite Plugin: Error " << rasterliteGetLastError (dataset_);
MAPNIK_LOG_DEBUG(rasterlite) << "Rasterlite Plugin: Error " << rasterliteGetLastError (dataset_);
}
}

View file

@ -0,0 +1,72 @@
{
"keys": [
""
],
"data": {},
"grid": [
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
]
}

View file

@ -0,0 +1,72 @@
{
"keys": [
""
],
"data": {},
"grid": [
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View file

@ -0,0 +1,21 @@
<!DOCTYPE Map>
<Map srs="+init=epsg:4326">
<Parameters>
<Parameter name="sizes">256,256</Parameter>
<Parameter name="bbox">-180 0 0 85.0511287798066</Parameter>
</Parameters>
<Style name="1">
<Rule>
<RasterSymbolizer opacity=".5"/>
</Rule>
</Style>
<Layer name="globe" srs="+init=epsg:4326">
<StyleName>1</StyleName>
<Datasource>
<Parameter name="type">rasterlite</Parameter>
<Parameter name="table">globe</Parameter>
<Parameter name="file">../../data/rasterlite/globe.sqlite</Parameter>
</Datasource>
</Layer>
</Map>