2004-04-05 20:53:17 +00:00
|
|
|
#ifndef _GRATICULECREATOR_H_
|
|
|
|
#define _GRATICULECREATOR_H_
|
|
|
|
|
|
|
|
#include "shapefile.h"
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
//qt includes
|
|
|
|
#include <qstring.h>
|
|
|
|
#include <qfile.h>
|
|
|
|
|
|
|
|
class GraticuleCreator
|
|
|
|
{
|
|
|
|
public:
|
2005-10-13 12:53:17 +00:00
|
|
|
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(
|
2004-11-09 01:04:00 +00:00
|
|
|
double theXIntervalDouble,
|
|
|
|
double theYIntervalDouble,
|
|
|
|
double theXOriginDouble,
|
|
|
|
double theYOriginDouble,
|
|
|
|
double theXEndPointDouble,
|
|
|
|
double theYEndPointDouble);
|
2005-10-13 12:53:17 +00:00
|
|
|
void generatePoints (QString theInputFileName );
|
2004-04-05 20:53:17 +00:00
|
|
|
|
|
|
|
private:
|
2005-10-13 12:53:17 +00:00
|
|
|
DBFHandle mDbfHandle;
|
|
|
|
SHPHandle mShapeHandle;
|
|
|
|
void GraticuleCreator::createDbf (QString theDbfName ) ;
|
|
|
|
void GraticuleCreator::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 );
|
2004-04-05 20:53:17 +00:00
|
|
|
};
|
|
|
|
#endif
|