You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/1_base.adoc
+5-14Lines changed: 5 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,19 @@ Using SQLite as the basis for GeoPackage simplifies production, distribution and
24
24
25
25
====== File Format
26
26
27
-
:req1_foot1: footnote:[SQLite version 4 (reference B25), which will be an alternative to version 3, not a replacement thereof, was not available when this standard was written. See Future Work clause in Annex B.]
28
-
:req1_foot2: footnote:[SQLite is in the public domain (see http://www.sqlite.org/copyright.html)]
29
-
:req2_foot1: footnote:[With SQLite versions 3.7.17 and later this value MAY be set with the "PRAGMA application_id=1196444487;" SQL statement, where 1196444487 is the 32-bit integer value of 0x47504B47. With earlier versions of SQLite the application id can be set by writing the byte sequence 0x47, 0x50, 0x4B, 0x47 at offset 68 in the SQLite database file (see http://www.sqlite.org/fileformat2.html#database_header for details).]
30
-
:req2_foot2: footnote:[Older GeoPackages use a different versioning mechanism. Instead of using the user_version, they have an application ID of "GP10" (for GeoPackage 1.0 and 1.0.1) or "GP11" (for GeoPackage 1.1).]
31
-
32
27
[[r1]]
33
28
[caption=""]
34
29
.Requirement 1
35
30
====
36
31
A GeoPackage SHALL be a http://www.sqlite.org/[SQLite] <<5>> database file using http://sqlite.org/fileformat2.html[version 3 of the SQLite file format] <<6>> <<7>>.
37
-
The first 16 bytes of a GeoPackage SHALL be the null-terminated ASCII <<B4>> string "SQLite format 3" {req1_foot1}. {req1_foot2}
32
+
The first 16 bytes of a GeoPackage SHALL be the null-terminated ASCII <<B4>> string "SQLite format 3" ^<<K1>>^ ^<<K2>>^
38
33
====
39
34
40
35
[[r2]]
41
36
[caption=""]
42
37
.Requirement 2
43
38
====
44
-
A GeoPackage SHALL contain a value of 0x47504B47 ("GPKG" in ASCII) in the "application_id" field of the SQLite database header to indicate that it is a GeoPackage. {req2_foot1} A GeoPackage SHALL contain an appropriate value in "user_version" field of the SQLite database header to indicate its version. The value SHALL be in integer with a major version, two-digit minor version, and two-digit bug-fix. For GeoPackage Version 1.2 this value is 0x000027D8 (the hexadecimal value for 10200). {req2_foot2}
39
+
A GeoPackage SHALL contain a value of 0x47504B47 ("GPKG" in ASCII) in the "application_id" field of the SQLite database header to indicate that it is a GeoPackage. ^<<K3>>^ A GeoPackage SHALL contain an appropriate value in "user_version" field of the SQLite database header to indicate its version. The value SHALL be in integer with a major version, two-digit minor version, and two-digit bug-fix. For GeoPackage Version 1.2 this value is 0x000027D8 (the hexadecimal value for 10200). ^<<K4>>^
45
40
====
46
41
47
42
The maximum size of a GeoPackage file is about 140TB.
@@ -101,13 +96,12 @@ The columns of tables in a GeoPackage SHALL only be declared using one of the da
:req4_foot1: footnote:[The SQLite PRAGMA integrity_check SQL command does a full database scan that can take a long time to complete on a large GeoPackage file.]
105
99
106
100
[[r6]]
107
101
[caption=""]
108
102
.Requirement 6
109
103
====
110
-
The SQLite PRAGMA integrity_check SQL command SHALL return "ok" for a GeoPackage file. {req4_foot1}
104
+
The SQLite PRAGMA integrity_check SQL command SHALL return "ok" for a GeoPackage file. ^<<K5>>^
111
105
====
112
106
113
107
[[r7]]
@@ -121,13 +115,12 @@ The SQLite PRAGMA foreign_key_check SQL with no parameter value SHALL return an
121
115
122
116
[[api_sql]]
123
117
====== Structured Query Language (SQL)
124
-
:req4_foot2: footnote:[New applications should use the latest available SQLite version software <<8>>]
125
118
126
119
[[r8]]
127
120
[caption=""]
128
121
.Requirement 8
129
122
====
130
-
A GeoPackage SQLite Configuration SHALL provide SQL access to GeoPackage contents via http://www.sqlite.org/download.html[SQLite version 3] <<6>> software APIs. {req4_foot2}
123
+
A GeoPackage SQLite Configuration SHALL provide SQL access to GeoPackage contents via http://www.sqlite.org/download.html[SQLite version 3] <<6>> software APIs. ^<<K6>>^
131
124
====
132
125
133
126
====== Every GPKG SQLite Configuration
@@ -253,13 +246,11 @@ The `data_type` specifies the type of content contained in the table, for exampl
253
246
254
247
The `last_change` SHOULD contain the timestamp of when the content in the referenced table was last updated, in ISO8601 format. Note that since it is not practical to ensure that this value is maintained properly in all cases, this value should be treated as informative.
255
248
256
-
:req13_foot1: footnote:[The following statement selects an ISO 8601 timestamp value using the SQLite strftime function: SELECT (strftime('%Y-%m-%dT%H:%M:%fZ','now')).]
257
-
258
249
[[r15]]
259
250
[caption=""]
260
251
.Requirement 15
261
252
====
262
-
Values of the `gpkg_contents` table `last_change` column SHALL be in http://www.iso.org/iso/catalogue_detail?csnumber=40874[ISO 8601] <<29>> format containing a complete date plus UTC hours, minutes, seconds and a decimal fraction of a second, with a 'Z' ('zulu') suffix indicating UTC. The ISO8601 format is as defined by the strftime function '%Y-%m-%dT%H:%M:%fZ' format string applied to the current time. {req13_foot1}
253
+
Values of the `gpkg_contents` table `last_change` column SHALL be in http://www.iso.org/iso/catalogue_detail?csnumber=40874[ISO 8601] <<29>> format containing a complete date plus UTC hours, minutes, seconds and a decimal fraction of a second, with a 'Z' ('zulu') suffix indicating UTC. The ISO8601 format is as defined by the strftime function '%Y-%m-%dT%H:%M:%fZ' format string applied to the current time. ^<<K7>>^
263
254
====
264
255
265
256
The bounding box (`min_x`, `min_y`, `max_x`, `max_y`) provides an informative bounding box of the content. Applications may use this bounding box as the extents of a default view but there are no requirements that this bounding box be exact or represent the minimum bounding box of the content. The values are in the units specified by that CRS.
Copy file name to clipboardExpand all lines: spec/2a_features.adoc
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,6 @@ For example: A stream network may be modeled as multilinestring value with the m
34
34
A brief description of each geometry type is provided below.
35
35
A more detailed description can be found in ISO 13249-3 <<12>>.
36
36
37
-
:core_geometry_model_foot1: footnote:[GeometryCollection is a generic term for the ST_GeomCollection type defined in [12\], which uses it for the definition of Well Known Text (WKT) and Well Known Binary (WKB) encodings. The SQL type name GEOMCOLLECTION defined in [10\] and used in Clause 1.1.2.1.1 and Annex G below refers to the SQL BLOB encoding of a GeometryCollection.]
38
-
39
37
40
38
* Geometry: the root of the geometry type hierarchy.
41
39
* Point: a single location in space.
@@ -52,7 +50,7 @@ A more detailed description can be found in ISO 13249-3 <<12>>.
52
50
* CurvePolygon: A planar surface defined by an exterior ring and zero or more interior ring.
53
51
Each ring is defined by a Curve instance.
54
52
* Polygon: A restricted form of CurvePolygon where each ring is defined as a simple, closed LineString.
55
-
* GeometryCollection: A collection of zero or more Geometry instances. {core_geometry_model_foot1}
53
+
* GeometryCollection: A collection of zero or more Geometry instances. ^<<K8>>^
56
54
* MultiSurface: A restricted form of GeometryCollection where each Geometry in the collection must be of type Surface.
57
55
* MultiPolygon: A restricted form of MultiSurface where each Surface in the collection must be of type Polygon.
58
56
* MultiCurve: A restricted form of GeometryCollection where each Geometry in the collection must be of type Curve.
@@ -87,9 +85,6 @@ The `gpkg_contents` table SHALL contain a row with a lowercase `data_type` colum
87
85
A GeoPackage SHALL store feature table geometries with or without optional elevation (Z) and/or measure (M) values in SQL BLOBs using the Standard GeoPackageBinary format specified in table <<gpb_spec>> and clause <<gpb_data_blob_format>>.
88
86
====
89
87
90
-
:geopackage_binary_foot1: footnote:[OGC WKB simple feature geometry types specified in <<9>> are a subset of the ISO WKB geometry types specified in <<12>>]
91
-
:geopackage_binary_foot2: footnote:[WKB geometry types are are restricted to 0, 1 and 2-dimensional geometric objects that exist in 2, 3 or 4-dimensional coordinate space; they are not geographic or geodesic geometry types.]
92
-
:geopackage_binary_foot3: footnote:[The axis order in WKB is always (x,y{,z}{,m}) where x is easting or longitude, y is northing or latitude, z is optional elevation and m is optional measure.]
93
88
94
89
.GeoPackage SQL Geometry Binary Format
95
90
[[gpb_spec]]
@@ -113,7 +108,7 @@ StandardGeoPackageBinary {
113
108
<3> see <<flags_layout>>
114
109
<4> see flags envelope contents indicator code below
115
110
<5> The X bit in the header flags field must be set to 0.
116
-
<6> per OGC 06-103r4 <<9>> {geopackage_binary_foot1}{geopackage_binary_foot2}{geopackage_binary_foot3}
111
+
<6> per OGC 06-103r4 <<9>> ^<<K9>>^ ^<<K10>>^ ^<<K11>>^
117
112
118
113
[[flags_layout]]
119
114
.bit layout of GeoPackageBinary flags byte
@@ -256,12 +251,10 @@ The m value in a `gpkg_geometry_columns` table row SHALL be one of 0, 1, or 2.
256
251
257
252
====== Table Definition
258
253
259
-
:features_data_table_foot2: footnote:[A GeoPackage is not required to contain any feature data tables. Feature data tables in a GeoPackage MAY be empty.]
260
-
261
254
The third component of the SQL schema for vector features in a GeoPackage described in clause <<sfsql_intro>> above are tables that contain user data representing features.
262
255
Feature attributes are columns in a feature table, including geometries.
263
256
Features are rows in a feature table.
264
-
{features_data_table_foot2}
257
+
^<<K12>>^
265
258
266
259
[[r29]]
267
260
[caption=""]
@@ -310,12 +303,11 @@ A feature geometry is stored in a geometry column specified by the `geometry_col
310
303
311
304
The geometry type of a feature geometry column specified in the `gpkg_geometry_columns` table `geometry_type_name` column is a name from <<geometry_types>>.
312
305
313
-
:geom_type_req_foot1: footnote:[GeoPackage applications MAY use SQL triggers or tests in application code to meet this requirement]
314
306
[[r32]]
315
307
[caption=""]
316
308
.Requirement 32
317
309
====
318
-
Feature table geometry columns SHALL contain geometries of the type or assignable for the type specified for the column by the `gpkg_geometry_columns` table `geometry_type_name` uppercase column value {geom_type_req_foot1}.
310
+
Feature table geometry columns SHALL contain geometries of the type or assignable for the type specified for the column by the `gpkg_geometry_columns` table `geometry_type_name` uppercase column value ^<<K13>>^
319
311
====
320
312
321
313
Geometry subtypes are assignable as defined in <<geometry_types>> and shown in part in <<core_geometry_model_figure>>.
0 commit comments