radolan  1.2.0
shapefile_converter.h
1 /* The MIT License (MIT)
2  *
3  * (c) Jürgen Simon 2014 (juergen.simon@uni-bonn.de)
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21  * SOFTWARE.
22  */
23 
24 #if WITH_SHAPELIB
25 
26 #ifndef RADOLAN_SHAPEFILE_CONVERTER_H
27 #define RADOLAN_SHAPEFILE_CONVERTER_H
28 
29 #include <radolan/conversion_exeption.h>
30 #include <radolan/types.h>
31 #include <vector>
32 
33 namespace Radolan {
34 
41  public:
42 
56  static void convertToPoints(RDScan *scan,
57  const char *filename,
58  bool geographic = false,
59  bool withValues = true) throw(RDConversionException);
60 
72  static void convertToPolygons(RDScan *scan,
73  const char *filename,
74  bool geographic = false,
75  bool withValues = true) throw(RDConversionException);
76 
88  static void getBoundingBoxPolygon(RDScan *scan,
89  std::vector<double> &px,
90  std::vector<double> &py,
91  bool geographic = false);
92 
103  static void writeBoundingBox(RDScan *scan,
104  const char *filename,
105  bool geographic = false) throw(RDConversionException);
106 
114  static void printBoundingBox(RDScan *scan,
115  bool geographic = false);
116 
125  static void printAsProj(RDScan *scan,
126  bool geographic = false);
127  };
128 }
129 
130 #endif // WITH_SHAPELIB
131 #endif
static void printAsProj(RDScan *scan, bool geographic=false)
Prints the scan data in proj format to console.
Exception for conversion errors from RADOLAN into other formats.
Data type for reading and handling radolan products.
Definition: types.h:171
static void getBoundingBoxPolygon(RDScan *scan, std::vector< double > &px, std::vector< double > &py, bool geographic=false)
Obtains the bounding box of the radolan scan.
static void printBoundingBox(RDScan *scan, bool geographic=false)
Prints out the bounding box of the coordinate system to console TODO: this might be better off in uti...
static void convertToPoints(RDScan *scan, const char *filename, bool geographic=false, bool withValues=true)
Writes out a shapefile with the individual radar pixels as points.
This class contains facilities for converting a RADOLAN file into 2 different Shapefile formats...
static void writeBoundingBox(RDScan *scan, const char *filename, bool geographic=false)
Writes out the bounding box of the coordinate system as shapefile.
static void convertToPolygons(RDScan *scan, const char *filename, bool geographic=false, bool withValues=true)
Writes out a shapefile with the individual radar pixels as polygons.