Skip to content

Commit

Permalink
moved footnotes to endnotes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbuehler committed Aug 29, 2017
1 parent 71791c6 commit c83c2d6
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 87 deletions.
19 changes: 5 additions & 14 deletions spec/1_base.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,19 @@ Using SQLite as the basis for GeoPackage simplifies production, distribution and

====== File Format

: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.]
:req1_foot2: footnote:[SQLite is in the public domain (see http://www.sqlite.org/copyright.html)]
: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).]
: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).]

[[r1]]
[caption=""]
.Requirement 1
====
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>>.
The first 16 bytes of a GeoPackage SHALL be the null-terminated ASCII <<B4>> string "SQLite format 3" {req1_foot1}. {req1_foot2}
The first 16 bytes of a GeoPackage SHALL be the null-terminated ASCII <<B4>> string "SQLite format 3" ^<<K1>>^ ^<<K2>>^
====

[[r2]]
[caption=""]
.Requirement 2
====
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}
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>>^
====

The maximum size of a GeoPackage file is about 140TB.
Expand Down Expand Up @@ -101,13 +96,12 @@ The columns of tables in a GeoPackage SHALL only be declared using one of the da
|=======================================================================

====== File Integrity
: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.]

[[r6]]
[caption=""]
.Requirement 6
====
The SQLite PRAGMA integrity_check SQL command SHALL return "ok" for a GeoPackage file. {req4_foot1}
The SQLite PRAGMA integrity_check SQL command SHALL return "ok" for a GeoPackage file. ^<<K5>>^
====

[[r7]]
Expand All @@ -121,13 +115,12 @@ The SQLite PRAGMA foreign_key_check SQL with no parameter value SHALL return an

[[api_sql]]
====== Structured Query Language (SQL)
:req4_foot2: footnote:[New applications should use the latest available SQLite version software <<8>>]

[[r8]]
[caption=""]
.Requirement 8
====
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}
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>>^
====

====== Every GPKG SQLite Configuration
Expand Down Expand Up @@ -253,13 +246,11 @@ The `data_type` specifies the type of content contained in the table, for exampl

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.

: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')).]

[[r15]]
[caption=""]
.Requirement 15
====
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}
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>>^
====

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.
Expand Down
16 changes: 4 additions & 12 deletions spec/2a_features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ For example: A stream network may be modeled as multilinestring value with the m
A brief description of each geometry type is provided below.
A more detailed description can be found in ISO 13249-3 <<12>>.

: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.]


* Geometry: the root of the geometry type hierarchy.
* Point: a single location in space.
Expand All @@ -52,7 +50,7 @@ A more detailed description can be found in ISO 13249-3 <<12>>.
* CurvePolygon: A planar surface defined by an exterior ring and zero or more interior ring.
Each ring is defined by a Curve instance.
* Polygon: A restricted form of CurvePolygon where each ring is defined as a simple, closed LineString.
* GeometryCollection: A collection of zero or more Geometry instances. {core_geometry_model_foot1}
* GeometryCollection: A collection of zero or more Geometry instances. ^<<K8>>^
* MultiSurface: A restricted form of GeometryCollection where each Geometry in the collection must be of type Surface.
* MultiPolygon: A restricted form of MultiSurface where each Surface in the collection must be of type Polygon.
* MultiCurve: A restricted form of GeometryCollection where each Geometry in the collection must be of type Curve.
Expand Down Expand Up @@ -87,9 +85,6 @@ The `gpkg_contents` table SHALL contain a row with a lowercase `data_type` colum
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>>.
====

: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>>]
: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.]
: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.]

.GeoPackage SQL Geometry Binary Format
[[gpb_spec]]
Expand All @@ -113,7 +108,7 @@ StandardGeoPackageBinary {
<3> see <<flags_layout>>
<4> see flags envelope contents indicator code below
<5> The X bit in the header flags field must be set to 0.
<6> per OGC 06-103r4 <<9>> {geopackage_binary_foot1}{geopackage_binary_foot2}{geopackage_binary_foot3}
<6> per OGC 06-103r4 <<9>> ^<<K9>>^ ^<<K10>>^ ^<<K11>>^

[[flags_layout]]
.bit layout of GeoPackageBinary flags byte
Expand Down Expand Up @@ -256,12 +251,10 @@ The m value in a `gpkg_geometry_columns` table row SHALL be one of 0, 1, or 2.

====== Table Definition

: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.]

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.
Feature attributes are columns in a feature table, including geometries.
Features are rows in a feature table.
{features_data_table_foot2}
^<<K12>>^

[[r29]]
[caption=""]
Expand Down Expand Up @@ -310,12 +303,11 @@ A feature geometry is stored in a geometry column specified by the `geometry_col

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>>.

:geom_type_req_foot1: footnote:[GeoPackage applications MAY use SQL triggers or tests in application code to meet this requirement]
[[r32]]
[caption=""]
.Requirement 32
====
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}.
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>>^
====

Geometry subtypes are assignable as defined in <<geometry_types>> and shown in part in <<core_geometry_model_figure>>.
Expand Down
Loading

0 comments on commit c83c2d6

Please sign in to comment.