2009-02-03 18:06:23 +01:00
|
|
|
/*****************************************************************************
|
2011-11-14 04:37:50 +01:00
|
|
|
*
|
2009-02-03 18:06:23 +01:00
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2011-10-22 03:33:03 +02:00
|
|
|
* Copyright (C) 2011 Artem Pavlenko
|
2009-02-03 18:06:23 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef OCCI_FEATURESET_HPP
|
|
|
|
#define OCCI_FEATURESET_HPP
|
|
|
|
|
|
|
|
// mapnik
|
|
|
|
#include <mapnik/datasource.hpp>
|
2010-11-16 18:31:13 +01:00
|
|
|
#include <mapnik/geometry.hpp>
|
2011-11-14 04:37:50 +01:00
|
|
|
#include <mapnik/unicode.hpp>
|
2009-02-03 18:06:23 +01:00
|
|
|
|
|
|
|
// boost
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
2009-02-03 23:23:33 +01:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2009-02-03 18:06:23 +01:00
|
|
|
|
|
|
|
// oci
|
|
|
|
#include "occi_types.hpp"
|
2011-11-14 04:37:50 +01:00
|
|
|
|
2009-02-03 18:06:23 +01:00
|
|
|
class occi_featureset : public mapnik::Featureset
|
|
|
|
{
|
2011-10-22 03:33:03 +02:00
|
|
|
public:
|
|
|
|
occi_featureset(oracle::occi::StatelessConnectionPool* pool,
|
|
|
|
oracle::occi::Connection* conn,
|
|
|
|
std::string const& sqlstring,
|
|
|
|
std::string const& encoding,
|
|
|
|
bool use_connection_pool,
|
|
|
|
unsigned prefetch_rows,
|
|
|
|
unsigned num_attrs);
|
|
|
|
virtual ~occi_featureset();
|
|
|
|
mapnik::feature_ptr next();
|
|
|
|
|
|
|
|
private:
|
2011-12-06 13:53:16 +01:00
|
|
|
void convert_geometry (SDOGeometry* geom, mapnik::feature_ptr feature);
|
2011-10-22 03:33:03 +02:00
|
|
|
void convert_ordinates (mapnik::feature_ptr feature,
|
|
|
|
const mapnik::eGeomType& geom_type,
|
|
|
|
const std::vector<oracle::occi::Number>& elem_info,
|
|
|
|
const std::vector<oracle::occi::Number>& ordinates,
|
|
|
|
const int dimensions,
|
|
|
|
const bool is_single_geom,
|
2011-12-06 13:53:16 +01:00
|
|
|
const bool is_point_geom);
|
2011-10-22 03:33:03 +02:00
|
|
|
void fill_geometry_type (mapnik::geometry_type* geom,
|
|
|
|
const int real_offset,
|
|
|
|
const int next_offset,
|
|
|
|
const std::vector<oracle::occi::Number>& ordinates,
|
|
|
|
const int dimensions,
|
|
|
|
const bool is_point_geom);
|
|
|
|
|
|
|
|
occi_connection_ptr conn_;
|
|
|
|
oracle::occi::ResultSet* rs_;
|
|
|
|
boost::scoped_ptr<mapnik::transcoder> tr_;
|
|
|
|
const char* fidcolumn_;
|
|
|
|
unsigned num_attrs_;
|
|
|
|
mutable int feature_id_;
|
2009-02-03 18:06:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OCCI_FEATURESET_HPP
|