update pdsql2sqlite to new feature_impl

This commit is contained in:
Artem Pavlenko 2012-01-23 08:40:16 +00:00
parent 4f48cce42e
commit b89f5cbbbc
2 changed files with 8 additions and 3 deletions

View file

@ -40,7 +40,7 @@ headers = ['#plugins/input/postgis'] + env['CPPPATH']
libraries = []
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
libraries.extend([boost_program_options,'sqlite3','pq','mapnik'])
libraries.extend([boost_program_options,'sqlite3','pq','mapnik','icuuc'])
linkflags = env['CUSTOM_LDFLAGS']
if env['SQLITE_LINKFLAGS']:

View file

@ -141,9 +141,14 @@ void pgsql2sqlite(Connection conn,
int geometry_oid = -1;
std::string output_table_insert_sql = "insert into " + output_table_name + " values (?";
context_ptr ctx = boost::make_shared<context_type>();
for ( unsigned pos = 0; pos < num_fields ; ++pos)
{
const char* field_name = cursor->getFieldName(pos);
ctx->push(field_name);
if (pos > 0)
{
create_sql << ",";
@ -216,7 +221,7 @@ void pgsql2sqlite(Connection conn,
sqlite::record_type output_rec;
output_rec.push_back(sqlite::value_type(pkid));
bool empty_geom = true;
const char * buf = 0;
const char * buf = 0;
for (unsigned pos=0 ; pos < num_fields; ++pos)
{
if (! cursor->isNull(pos))
@ -275,7 +280,7 @@ void pgsql2sqlite(Connection conn,
{
if (oid == geometry_oid)
{
mapnik::Feature feat(pkid);
mapnik::Feature feat(ctx,pkid);
geometry_utils::from_wkb(feat.paths(),buf,size,wkbGeneric);
if (feat.num_geometries() > 0)
{