@@ -8,9 +8,9 @@ bibliography: ../reproducible_research.bib
88categories : ["r", "gis"]
99tags : ["gis", "r", "open science"]
1010output :
11- md_document :
12- preserve_yaml : true
13- variant : gfm
11+ md_document :
12+ preserve_yaml : true
13+ variant : gfm+footnotes
1414---
1515
1616Some inspiration for this post came from the beautiful books of Lovelace
@@ -19,25 +19,25 @@ various websites.
1919
2020## Why use open standards?
2121
22- - Open file standards ease collaboration, portability and
22+ - Open file standards ease collaboration, portability and
2323 compatibility between users, machines and applications.
24- - Their (file) structure is fully documented.
25- - Consequently, scientists and programmers can build new software
24+ - Their (file) structure is fully documented.
25+ - Consequently, scientists and programmers can build new software
2626 / packages and make innovations that use these standards, while
2727 maintaining interoperability with existing applications.
28- - And, there is a much higher chance that your data will still be
28+ - And, there is a much higher chance that your data will still be
2929 readable in a hundred years from now. The standard’s open
3030 documentation makes it relatively easy to build tools that can
31- read an ancient open-standard file\ !
31+ read an ancient open-standard file!
3232
33- Luckily, quite a list of open standards is available\ ! Below, some
33+ Luckily, quite a list of open standards is available! Below, some
3434powerful and widely-used single-file formats are introduced. Single-file
3535data sources are readily amenable to exchange and publication.
3636
3737I see you can’t wait to start practicing, so you can also head straight
3838over to the [ tutorial on vector
3939formats] ( ../../tutorials/spatial_standards_vector/ ) and the [ tutorial on
40- raster formats] ( ../../tutorials/spatial_standards_raster/ ) \ ! In these
40+ raster formats] ( ../../tutorials/spatial_standards_raster/ ) ! In these
4141tutorials, a comparison table of vector/raster file formats is also
4242presented.
4343
@@ -46,9 +46,9 @@ presented.
4646** [ GDAL] ( https://gdal.org ) ** (Geospatial Data Abstraction Library) is by
4747far the most used collection of open-source drivers for:
4848
49- - a lot of [ raster] ( https://gdal.org/drivers/raster/index.html )
49+ - a lot of [ raster] ( https://gdal.org/drivers/raster/index.html )
5050 formats;
51- - a lot of [ vector] ( https://gdal.org/drivers/vector/index.html )
51+ - a lot of [ vector] ( https://gdal.org/drivers/vector/index.html )
5252 formats.
5353
5454In other words, it is the preferred workhorse for reading and writing
@@ -62,27 +62,27 @@ So, in R we use packages that use GDAL in the background, such as
6262
6363## The GeoPackage file format
6464
65- - Its website is < https://www.geopackage.org > .
66- - It is a standardized implementation of an SQLite database for
65+ - Its website is < https://www.geopackage.org > .
66+ - It is a standardized implementation of an SQLite database for
6767 geospatial data. Hence, a GeoPackage is a ** binary** file
6868 (` filename.gpkg ` ). It shares this property with shapefiles, which
69- however pose multiple limitations,\[ 1 \ ] so the GeoPackage is a more
69+ however pose multiple limitations,[ ^ 1 ] so the GeoPackage is a more
7070 than suitable replacement.
71- - The GeoPackage can store one or * multiple* ** vector** layers
71+ - The GeoPackage can store one or * multiple* ** vector** layers
7272 (points, lines, polygons and related feature types). Besides vector
7373 data, it can also store ** raster** data or extra standalone
7474 ** tables** . These properties make it somehow comparable to the
7575 ‘personal geodatabase’ of ArcGIS – ESRI’s closed, Windows-only
76- format.\[ 2 \ ]
77- - The GeoPackage standard is
76+ format.[ ^ 2 ]
77+ - The GeoPackage standard is
7878 [ maintained] ( https://www.opengeospatial.org/standards/geopackage ) by
7979 the [ Open Geospatial Consortium] ( https://www.opengeospatial.org/ )
8080 (OGC), which stands out as a reference when it comes to open
8181 geospatial standards.
8282
8383## The GeoJSON file format
8484
85- - One [ GeoJSON] ( https://tools.ietf.org/html/rfc7946 ) file
85+ - One [ GeoJSON] ( https://tools.ietf.org/html/rfc7946 ) file
8686 (` filename.geojson ` ) contains * one* ** vector** layer. Note that one
8787 vector layer can combine different [ feature geometry
8888 types] ( https://r-spatial.github.io/sf/articles/sf1.html#simple-feature-geometry-types ) ,
@@ -94,56 +94,56 @@ So, in R we use packages that use GDAL in the background, such as
9494 example). GeoJSON adds the necessary specification to JSON for
9595 standardized storage of geographic feature data, but it is still a
9696 plain JSON text file.
97- - The GeoJSON standard is maintained by the Internet Engineering Task
97+ - The GeoJSON standard is maintained by the Internet Engineering Task
9898 Force ([ IETF] ( https://www.ietf.org/ ) ), a large open standards
9999 organization that develops Internet standards under the auspices of
100100 the Internet Society.
101- - Although the previous version of the GeoJSON standard – GeoJSON 2008
101+ - Although the previous version of the GeoJSON standard – GeoJSON 2008
102102 – is still a lot in use, it is
103103 [ obsoleted] ( http://geojson.org/geojson-spec.html ) and a new version
104104 ** [ RFC7946] ( https://tools.ietf.org/html/rfc7946 ) ** is establishing.
105- - This version is strict about the coordinate reference system
105+ - This version is strict about the coordinate reference system
106106 (CRS) – it is always [ WGS84] ( https://epsg.io/4326 ) – and it also
107107 differs on a few other aspects (such as the recommendation for
108108 applications [ not to
109109 inflate] ( https://tools.ietf.org/html/rfc7946#section-11.2 )
110110 decimal coordinate precision).
111- - RFC7946 solves the problem that quite a few libraries –
111+ - RFC7946 solves the problem that quite a few libraries –
112112 including GDAL – simply assumed WGS84 in GeoJSON 2008 (without
113113 checking or transforming), even though WGS84 was not a
114114 requirement of GeoJSON 2008 (it did support an explicit * crs*
115115 declaration). This resulted in inconveniences (cf. [ this
116116 post] ( https://github.com/r-spatial/sf/issues/344#issue-229118527 )
117117 in the ` sf ` -repository).
118- - A [ specific
118+ - A [ specific
119119 section] ( https://gdal.org/drivers/vector/geojson.html#rfc-7946-write-support )
120120 in the documentation of GDAL’s GeoJSON driver gives a summary of
121121 the differences between both GeoJSON versions.
122- - While GDAL by default still follows the GeoJSON 2008 format,\[ 3 \ ]
122+ - While GDAL by default still follows the GeoJSON 2008 format,[ ^ 3 ]
123123 RFC7946 is supported by the option ` RFC7946=YES ` . Here, reprojection
124124 to WGS84 will happen automatically. It applies 7 decimal places for
125125 coordinates, i.e. approximately 1 cm. Given the advantages, *** we
126126 advise to explicitly use RFC7946*** . Several functions in R allow
127127 the user to provide options that are passed to GDAL, so we can ask
128128 to deliver RFC7946 (see the
129129 [ tutorial] ( ../../tutorials/spatial_standards_vector/ ) ).
130- - In order to keep it manageable (text file size, usage in versioning
131- systems\[ 4 \ ] ) it can be wise to use GeoJSON for more simple cases
130+ - In order to keep it manageable (text file size, usage in versioning
131+ systems[ ^ 4 ] ) it can be wise to use GeoJSON for more simple cases
132132 (points and rather simple lines and polygons), and use the binary
133133 GeoPackage format for larger (more complex) cases.
134134
135135## The GeoTIFF file format
136136
137- - [ GeoTIFF] ( https://en.wikipedia.org/wiki/GeoTIFF ) is the preferred
137+ - [ GeoTIFF] ( https://en.wikipedia.org/wiki/GeoTIFF ) is the preferred
138138 single-file open standard for ** raster** data. It adheres to the
139139 open [ TIFF] ( https://en.wikipedia.org/wiki/TIFF ) specification; hence
140140 it is a TIFF image file (` filename.tif ` ). It
141141 [ uses] ( http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_geotiff_file_structure_and_geotiff_crs_and_models_principles_informative )
142142 a small set of reserved TIFF tags to store information about CRS,
143143 extent and resolution of the raster.
144- - A GeoTIFF file can contain * one* or * multiple* rasters with the same
144+ - A GeoTIFF file can contain * one* or * multiple* rasters with the same
145145 CRS, extent and resolution.
146- - The GeoTIFF standard is
146+ - The GeoTIFF standard is
147147 [ maintained] ( https://www.opengeospatial.org/standards/geotiff ) by
148148 the [ Open Geospatial Consortium] ( https://www.opengeospatial.org/ )
149149 (OGC), which stands out as a reference when it comes to open
@@ -175,21 +175,21 @@ Pebesma E. & Bivand R. (2019). Spatial Data Science.
175175
176176</div >
177177
178- 1 . Some problems with shapefiles are: they’re not an open format, they
179- consist of multiple files and they have restrictions regarding file
180- size, column name length, number of columns and the feature types
181- that can be accommodated.
178+ [ ^ 1 ] : Some problems with shapefiles are: they’re not an open format,
179+ they consist of multiple files and they have restrictions regarding
180+ file size, column name length, number of columns and the feature
181+ types that can be accommodated.
182182
183- 2 . Note that personal geodatabases have their size limited to 250-500
184- MB; a GeoPackage can have a size of about 140 TB if the filesystem
185- can handle it.
183+ [ ^ 2 ] : Note that personal geodatabases have their size limited to
184+ 250-500 MB; a GeoPackage can have a size of about 140 TB if the
185+ filesystem can handle it.
186186
187- 3 . Though GeoJSON 2008 is obsoleted, the now recommended RFC7946
187+ [ ^ 3 ] : Though GeoJSON 2008 is obsoleted, the now recommended RFC7946
188188 standard is still officially in a * proposal* stage. That is probably
189189 the reason why GDAL does not yet default to RFC7946. A somehow
190190 confusing stage, it seems.
191191
192- 4 . When versioning GeoJSON files, mind the order of your data when
192+ [ ^ 4 ] : When versioning GeoJSON files, mind the order of your data when
193193 rewriting them: reordering could produce large diffs. Interested in
194194 combining GeoJSON and GitHub? [ Surprise
195- yourself](https://github.com/lyzidiamond/learn-geojson)\ !
195+ yourself] ( https://github.com/lyzidiamond/learn-geojson ) !
0 commit comments