* create_filter moved to core lib
* modified demo/c++/rundemo.cpp to reflect the above
This commit is contained in:
parent
02d95a7ba2
commit
c0fa1a6004
5 changed files with 22 additions and 23 deletions
|
@ -28,20 +28,13 @@
|
||||||
#include <regex_filter.hpp>
|
#include <regex_filter.hpp>
|
||||||
#include <filter.hpp>
|
#include <filter.hpp>
|
||||||
#include <filter_factory.hpp>
|
#include <filter_factory.hpp>
|
||||||
|
#include <mapnik.hpp>
|
||||||
|
|
||||||
using mapnik::filter;
|
using mapnik::filter;
|
||||||
using mapnik::filter_ptr;
|
using mapnik::filter_ptr;
|
||||||
using mapnik::filter_factory;
|
using mapnik::filter_factory;
|
||||||
using mapnik::Feature;
|
using mapnik::Feature;
|
||||||
|
using mapnik::create_filter;
|
||||||
namespace
|
|
||||||
{
|
|
||||||
using namespace boost::python;
|
|
||||||
filter_ptr create_filter(string const& filter_text)
|
|
||||||
{
|
|
||||||
return filter_factory<Feature>::compile(filter_text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void export_filter()
|
void export_filter()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,17 +4,16 @@
|
||||||
|
|
||||||
using namespace mapnik;
|
using namespace mapnik;
|
||||||
|
|
||||||
// helper function
|
|
||||||
filter_ptr create_filter (std::string const& wkt)
|
|
||||||
{
|
|
||||||
filter_factory<Feature> factory;
|
|
||||||
return factory.compile(wkt);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main ( int argc , char** argv)
|
int main ( int argc , char** argv)
|
||||||
{
|
{
|
||||||
|
if (argc != 2)
|
||||||
|
{
|
||||||
|
std::cout << "usage: ./rundemo <plugins_dir>\n";
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
std::cout << " running demo ... \n";
|
std::cout << " running demo ... \n";
|
||||||
datasource_cache::instance()->register_datasources("/usr/local/lib/mapnik/input");
|
datasource_cache::instance()->register_datasources(argv[1]);
|
||||||
freetype_engine::instance()->register_font("/usr/share/fonts/bitstream-vera/Vera.ttf");
|
freetype_engine::instance()->register_font("/usr/share/fonts/bitstream-vera/Vera.ttf");
|
||||||
|
|
||||||
Map m(800,600);
|
Map m(800,600);
|
||||||
|
@ -217,5 +216,5 @@ int main ( int argc , char** argv)
|
||||||
"- demo.png\n"
|
"- demo.png\n"
|
||||||
"Have a look!\n";
|
"Have a look!\n";
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,11 @@ namespace mapnik {
|
||||||
:abgr_(0xffffffff) {}
|
:abgr_(0xffffffff) {}
|
||||||
|
|
||||||
Color(int red,int green,int blue,int alpha=0xff)
|
Color(int red,int green,int blue,int alpha=0xff)
|
||||||
: abgr_((alpha&0xff) << 24 | (blue&0xff) << 16 | (green&0xff) << 8 | red&0xff) {}
|
: abgr_((alpha&0xff) << 24 |
|
||||||
|
(blue&0xff) << 16 |
|
||||||
|
(green&0xff) << 8 |
|
||||||
|
red&0xff) {}
|
||||||
|
|
||||||
explicit Color(int rgba)
|
explicit Color(int rgba)
|
||||||
: abgr_(rgba) {}
|
: abgr_(rgba) {}
|
||||||
|
|
||||||
|
|
|
@ -74,11 +74,11 @@
|
||||||
#include "feature_layer_desc.hpp"
|
#include "feature_layer_desc.hpp"
|
||||||
#include "css_color_parser.hpp"
|
#include "css_color_parser.hpp"
|
||||||
#include "color_factory.hpp"
|
#include "color_factory.hpp"
|
||||||
|
#include "config.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
MAPNIK_DECL filter_ptr create_filter (std::string const& wkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MAPNIK_HPP
|
#endif //MAPNIK_HPP
|
||||||
|
|
|
@ -22,11 +22,15 @@
|
||||||
|
|
||||||
//$Id$
|
//$Id$
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include "mapnik.hpp"
|
#include "mapnik.hpp"
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
filter_ptr create_filter (std::string const& wkt)
|
||||||
|
{
|
||||||
|
filter_factory<Feature> factory;
|
||||||
|
return factory.compile(wkt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue