-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
graticulecreator.h
79 lines (75 loc) · 3.44 KB
/
graticulecreator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
graticulecreator.h
--------------------------------------
Date : Sun Sep 16 12:06:50 AKDT 2007
Copyright : (C) 2007 by Gary E. Sherman
Email : sherman at mrcc dot com
***************************************************************************
* *
* This program 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 *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _GRATICULECREATOR_H_
#define _GRATICULECREATOR_H_
#include "shapefile.h"
#include "utils.h"
//qt includes
#include <QString>
//#include <qfile.h>
class GraticuleCreator
{
public:
enum ShapeType { POINT, LINE, POLYGON };
GraticuleCreator(QString theOutputFileName, ShapeType theType);
~GraticuleCreator() ;
void generatePointGraticule(
double theXIntervalDouble,
double theYIntervalDouble,
double theXOriginDouble,
double theYOriginDouble,
double theXEndPointDouble,
double theYEndPointDouble);
void generateLineGraticule(
double theXIntervalDouble,
double theYIntervalDouble,
double theXOriginDouble,
double theYOriginDouble,
double theXEndPointDouble,
double theYEndPointDouble);
void generatePolygonGraticule(
double theXIntervalDouble,
double theYIntervalDouble,
double theXOriginDouble,
double theYOriginDouble,
double theXEndPointDouble,
double theYEndPointDouble);
void generatePoints (QString theInputFileName );
private:
DBFHandle mDbfHandle;
SHPHandle mShapeHandle;
void createDbf (QString theDbfName ) ;
void createShapeFile(QString theFileNamei, ShapeType theType );
void writeDbfRecord ( int theRecordIdInt, QString theLabel) ;
void writePoint(int theRecordInt, double theXDouble, double y );
//! Writes a WGS 84 .prj file for the generated grid
void writeProjectionFile(QString theFileName);
void writePoint(
int theRecordInt,
int theCoordinateCountInt,
double * theXArrayDouble,
double * theYArrayDouble );
void writeLine(
int theRecordInt,
int theCoordinateCountInt,
double * theXArrayDouble,
double * theYArrayDouble );
void writePolygon(
int theRecordInt,
int theCoordinateCountInt,
double * theXArrayDouble,
double * theYArrayDouble );
};
#endif