4 /* Copyright (C) 2024 Olly Betts
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "exportfilter.h"
24 # include <ogrsf_frmts.h>
31 class ExportWithGDAL
: public ExportFilter
{
33 GDALDataset
* gdal_dataset
= nullptr;
34 OGRLayer
* gdal_layer
= nullptr;
35 OGRSpatialReference
* srs
= nullptr;
36 OGRLineString line_string
;
38 void finish_line_string();
42 ExportWithGDAL(const char* filename
,
43 const char* input_datum
,
44 const char* gdal_driver_name
);
47 void header(const char *, const char *, time_t,
48 double, double, double,
49 double, double, double) override
;
50 void start_pass(int pass
) override
;
51 void line(const img_point
*, const img_point
*, unsigned, bool) override
;
53 void label(const img_point
*, const wxString
&, int, int) override
;
55 void footer() override
;
59 class ShapefilePoints
: public ExportWithGDAL
{
61 ShapefilePoints(const char* filename
,
62 const char* input_datum
)
63 : ExportWithGDAL(filename
, input_datum
, "ESRI Shapefile") {}
65 const int * passes() const override
;
68 class ShapefileLines
: public ExportWithGDAL
{
70 ShapefileLines(const char* filename
,
71 const char* input_datum
)
72 : ExportWithGDAL(filename
, input_datum
, "ESRI Shapefile") {}
74 const int * passes() const override
;