• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ngageoint / geopackage-js / 4078143969

pending completion
4078143969

push

github

Christopher Caldwell
bump version

3593 of 8015 branches covered (44.83%)

Branch coverage included in aggregate %.

15102 of 20471 relevant lines covered (73.77%)

1564.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.96
/lib/tiles/matrixset/tileMatrixSet.ts
1
import { BoundingBox } from '../../boundingBox';
1✔
2
import { Contents } from '../../contents/contents';
1✔
3
import { SpatialReferenceSystemConstants } from '../../srs/spatialReferenceSystemConstants';
1✔
4

5
/**
6
 * Tile Matrix Set object. Defines the minimum bounding box (min_x, min_y,
7
 * max_x, max_y) and spatial reference system (srs_id) for all content in a tile
8
 * pyramid user data table.
9
 *
10
 * @class TileMatrixSet
11
 */
12
export class TileMatrixSet {
1✔
13
  /**
14
   * Table name
15
   */
16
  public static readonly TABLE_NAME = 'gpkg_tile_matrix_set';
1✔
17

18
  /**
19
   * tableName field name
20
   */
21
  public static readonly COLUMN_TABLE_NAME = Contents.COLUMN_TABLE_NAME;
1✔
22

23
  /**
24
   * id field name, tableName
25
   */
26
  public static readonly COLUMN_ID = TileMatrixSet.COLUMN_TABLE_NAME;
1✔
27

28
  /**
29
   * srsId field name
30
   */
31
  public static readonly COLUMN_SRS_ID = SpatialReferenceSystemConstants.COLUMN_SRS_ID;
1✔
32

33
  /**
34
   * minX field name
35
   */
36
  public static readonly COLUMN_MIN_X = 'min_x';
1✔
37

38
  /**
39
   * minY field name
40
   */
41
  public static readonly COLUMN_MIN_Y = 'min_y';
1✔
42

43
  /**
44
   * maxX field name
45
   */
46
  public static readonly COLUMN_MAX_X = 'max_x';
1✔
47

48
  /**
49
   * maxY field name
50
   */
51
  public static readonly COLUMN_MAX_Y = 'max_y';
1✔
52

53
  /**
54
   * Tile Pyramid User Data Table Name
55
   */
56
  private table_name: string;
57

58
  /**
59
   * Unique identifier for each Spatial Reference System within a GeoPackage
60
   */
61
  private srs_id: number;
62

63
  /**
64
   * Bounding box minimum easting or longitude for all content in table_name
65
   */
66
  private min_x: number;
67

68
  /**
69
   * Bounding box minimum northing or latitude for all content in table_name
70
   */
71
  private min_y: number;
72

73
  /**
74
   * Bounding box maximum easting or longitude for all content in table_name
75
   */
76
  private max_x: number;
77

78
  /**
79
   * Bounding box maximum northing or latitude for all content in table_name
80
   */
81
  private max_y: number;
82

83
  /**
84
   * Constructor
85
   * @param tileMatrixSet tile matrix set to copy
86
   */
87
  public constructor(tileMatrixSet?: TileMatrixSet) {
88
    if (tileMatrixSet != null) {
563!
89
      this.table_name = tileMatrixSet.getTableName();
×
90
      this.srs_id = tileMatrixSet.getSrsId();
×
91
      this.min_x = tileMatrixSet.getMinX();
×
92
      this.min_y = tileMatrixSet.getMinY();
×
93
      this.max_x = tileMatrixSet.getMaxX();
×
94
      this.max_y = tileMatrixSet.getMaxY();
×
95
    }
96
  }
97

98
  public getId(): string {
1✔
99
    return this.table_name;
×
100
  }
101

102
  public setId(id: string): void {
1✔
103
    this.table_name = id;
542✔
104
  }
105

106
  public getTableName(): string {
1✔
107
    return this.table_name;
1,115✔
108
  }
109

110
  public setTableName(tableName: string): void {
1✔
111
    this.table_name = tableName;
23✔
112
  }
113

114
  public getSrsId(): number {
1✔
115
    return this.srs_id;
1,078✔
116
  }
117

118
  public setSrsId(srsId: number): void {
1✔
119
    this.srs_id = srsId;
563✔
120
  }
121

122
  public getMinX(): number {
1✔
123
    return this.min_x;
4,626✔
124
  }
125

126
  public setMinX(minX: number): void {
1✔
127
    this.min_x = minX;
564✔
128
  }
129

130
  public getMinY(): number {
1✔
131
    return this.min_y;
4,626✔
132
  }
133

134
  public setMinY(minY: number): void {
1✔
135
    this.min_y = minY;
564✔
136
  }
137

138
  public getMaxX(): number {
1✔
139
    return this.max_x;
608✔
140
  }
141

142
  public setMaxX(maxX: number): void {
1✔
143
    this.max_x = maxX;
564✔
144
  }
145

146
  public getMaxY(): number {
1✔
147
    return this.max_y;
608✔
148
  }
149

150
  public setMaxY(maxY: number): void {
1✔
151
    this.max_y = maxY;
564✔
152
  }
153

154
  /**
155
   * Get a bounding box
156
   *
157
   * @return bounding box
158
   */
159
  public getBoundingBox(): BoundingBox {
1✔
160
    return new BoundingBox(this.getMinX(), this.getMinY(), this.getMaxX(), this.getMaxY());
49✔
161
  }
162

163
  /**
164
   * Set a bounding box
165
   *
166
   * @param boundingBox
167
   *            bounding box
168
   */
169
  public setBoundingBox(boundingBox: BoundingBox): void {
1✔
170
    this.setMinX(boundingBox.getMinLongitude());
1✔
171
    this.setMaxX(boundingBox.getMaxLongitude());
1✔
172
    this.setMinY(boundingBox.getMinLatitude());
1✔
173
    this.setMaxY(boundingBox.getMaxLatitude());
1✔
174
  }
175
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc