/* This file is part of Mapnik (c++ mapping toolkit) * Copyright (C) 2005 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ //$Id: raster_datasource.cc 44 2005-04-22 18:53:54Z pavlenko $ #include "raster_datasource.hh" #include "image_reader.hh" #include "raster_featureset.hh" #include "raster_info.hh" DATASOURCE_PLUGIN(raster_datasource); raster_datasource::raster_datasource(const Parameters& params) : extent_() { filename_=params.get("file"); format_=params.get("format"); double lox,loy,hix,hiy; fromString(params.get("lox"),lox); fromString(params.get("loy"),loy); fromString(params.get("hix"),hix); fromString(params.get("hiy"),hiy); extent_=Envelope(lox,loy,hix,hiy); } raster_datasource::~raster_datasource() { } std::string raster_datasource::name_="raster"; int raster_datasource::type() const { return datasource::Raster; } std::string raster_datasource::name() { return name_; } bool raster_datasource::parseEnvelope(const std::string& str,Envelope& envelope) { return true; } const mapnik::Envelope& raster_datasource::envelope() const { return extent_; } featureset_ptr raster_datasource::featuresAll(const CoordTransform& t) const { return featureset_ptr(0); } featureset_ptr raster_datasource::featuresInBox(const CoordTransform& t, const mapnik::Envelope& box) const { RasterInfo info(filename_,format_,extent_); single_file_policy policy(info); //todo: handle different policies! return featureset_ptr(new RasterFeatureset(policy,box,t)); } featureset_ptr raster_datasource::featuresAtPoint(const CoordTransform& t, const coord2d& pt) const { return featureset_ptr(0); }