source: subversion/applications/utils/srtm2shp/SRTMDataGrid.h

Last change on this file was 6182, checked in by nick, 12 years ago

new and internationally-capable srtm2shp added

File size: 2.2 KB
Line 
1/*
2    Copyright (C) 2005 Nick Whitelegg, Hogweed Software, nick@hogweed.org
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU Lesser General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
17
18 */
19#ifndef SRTMDATAGRID_H
20#define SRTMDATAGRID_H
21
22#include "SRTMGeneral.h"
23
24
25struct SRTM_SAMPLE_POINT
26{
27        double hgt;
28        ScreenPos screenPos;
29        EarthPoint earthPos;
30};
31
32class SRTMDataGrid
33{
34private:
35        int samplewidth, sampleheight;
36        SRTM_SAMPLE_POINT *points;
37
38        int pt;
39        int edges[4][2];
40        int f;
41        static void addContour
42                (LINE *lines,LINE line,int edge1,int edge2,int *prevedges,int *go,
43                int *n_lines);
44        void getHgtFilename(char *filename,EarthPoint&);
45        Colour doGetHeightShading(double ht,double shadingres);
46        std::string outCoord;
47        bool feet;
48        std::string srtmlocation;
49
50public:
51        SRTMDataGrid(const std::string&,LATLON_TILE **rects,int w, int h, int f,
52                                        const std::string& outCoord,bool feet=false);
53        ~SRTMDataGrid();
54        void doLoad(LATLON_TILE *rect,int index);
55        void setPoint (int row,int col);
56        int getPoint (){return pt; }
57        double startHeight(int interval);
58        double endHeight(int interval);
59        void getLine(LINE *lines,int *n_lines, int ht,bool=true);
60        int hgtptDistance(vector<int>& prevs);
61        int getHeight() { return sampleheight; }
62        int getWidth() { return samplewidth; }
63        Colour getHeightShading (double shadingres);
64        ScreenPos getTopLeft() { return points[pt].screenPos; }
65        ScreenPos getTopRight() { return points[pt+f].screenPos; }
66        ScreenPos getBottomLeft() { return points[pt+samplewidth*f].screenPos; }
67        ScreenPos getBottomRight() { return points[pt+samplewidth*f+f].screenPos; }
68        void getScreenPoints(Map&);
69};
70
71
72#endif
Note: See TracBrowser for help on using the repository browser.