diff --git a/articles/intro.html b/articles/intro.html index 68d379f..9cd73d3 100644 --- a/articles/intro.html +++ b/articles/intro.html @@ -186,7 +186,7 @@

Read a GeoPackage#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg +#> Path: /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg #> Extensions: TRUE class(g) #> [1] "geopackage" @@ -207,12 +207,12 @@

Read a GeoPackage#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/Rtmp2dDbAM/Rgpkg1cba2f16d082.gpkg +#> Path: /tmp/Rtmpg4Ph17/Rgpkg1d022be574ab.gpkg #> Extensions: TRUE class(g2) #> [1] "geopackage"

Note that a temporary GeoPackage -(/tmp/Rtmp2dDbAM/Rgpkg1cba2f16d082.gpkg) is automatically created when +(/tmp/Rtmpg4Ph17/Rgpkg1d022be574ab.gpkg) is automatically created when using the geopackage(<list>) constructor.

You also may have a DBIConnection to a GeoPackage database already opened that you want to use. In any case (character, @@ -252,8 +252,8 @@

Inspect Contents of GeoPackage#> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 6.008333, 6.266667, 49.69167, 49.94167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file1cba35ea0acf.gpkg:DEM1 -#> varname : file1cba35ea0acf +#> source : file1d025ccbab3e.gpkg:DEM1 +#> varname : file1d025ccbab3e #> name : DEM1 #> #> $DEM2 @@ -262,15 +262,15 @@

Inspect Contents of GeoPackage#> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 6.008333, 6.266667, 49.69167, 49.94167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> source : file1cba35ea0acf.gpkg:DEM2 -#> varname : file1cba35ea0acf +#> source : file1d025ccbab3e.gpkg:DEM2 +#> varname : file1d025ccbab3e #> name : DEM2 #> min value : 195 #> max value : 500 #> #> $myattr #> # Source: table<myattr> [10 x 2] -#> # Database: sqlite 3.45.0 [/tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg] +#> # Database: sqlite 3.45.0 [/tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg] #> a b #> <int> <chr> #> 1 1 A @@ -289,7 +289,7 @@

Inspect Contents of GeoPackage#> geometry : polygons #> dimensions : 1, 0 (geometries, attributes) #> extent : 6.008333, 6.266667, 49.69167, 49.94167 (xmin, xmax, ymin, ymax) -#> source : file1cba35ea0acf.gpkg (bbox) +#> source : file1d025ccbab3e.gpkg (bbox) #> layer : bbox #> coord. ref. : lon/lat WGS 84 (EPSG:4326) @@ -327,7 +327,7 @@

Inspect Contents of GeoPackage
 gpkg_tbl(g, "gpkg_contents")
 #> # Source:   table<gpkg_contents> [4 x 10]
-#> # Database: sqlite 3.45.0 [/tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg]
+#> # Database: sqlite 3.45.0 [/tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg]
 #>   table_name data_type   identifier description last_change   min_x min_y  max_x
 #>   <chr>      <chr>       <chr>      <chr>       <chr>         <dbl> <dbl>  <dbl>
 #> 1 DEM1       2d-gridded… DEM1       ""          2024-03-03…    6.01  49.7   6.27
@@ -354,12 +354,12 @@ 

Method 1: gpkg_table_pragma()
 head(gpkg_table_pragma(g))
 #>                                     dsn table_name nrow table_info.cid
-#> 1 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM1    1              0
-#> 2 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM1    1              1
-#> 3 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM1    1              2
-#> 4 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM1    1              3
-#> 5 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM1    1              4
-#> 6 /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg       DEM2    1              0
+#> 1 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM1    1              0
+#> 2 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM1    1              1
+#> 3 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM1    1              2
+#> 4 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM1    1              3
+#> 5 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM1    1              4
+#> 6 /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg       DEM2    1              0
 #>   table_info.name table_info.type table_info.notnull table_info.dflt_value
 #> 1              id         INTEGER                  0                  <NA>
 #> 2      zoom_level         INTEGER                  1                  <NA>
@@ -389,7 +389,7 @@ 

Method 2: gpkg_vect() an #> geometry : polygons #> dimensions : 1, 0 (geometries, attributes) #> extent : 6.008333, 6.266667, 49.69167, 49.94167 (xmin, xmax, ymin, ymax) -#> source : file1cba35ea0acf.gpkg (bbox) +#> source : file1d025ccbab3e.gpkg (bbox) #> coord. ref. : lon/lat WGS 84 (EPSG:4326)

The table of interest need not have a geometry column, but this method does not work on GeoPackage that contain only gridded data, and @@ -400,7 +400,7 @@

Method 2: gpkg_vect() an #> geometry : none #> dimensions : 0, 2 (geometries, attributes) #> extent : 0, 0, 0, 0 (xmin, xmax, ymin, ymax) -#> source : file1cba35ea0acf.gpkg (SELECT) +#> source : file1d025ccbab3e.gpkg (SELECT) #> coord. ref. : #> names : table_name feature_count #> type : <chr> <int>

@@ -444,10 +444,10 @@

Method 3: gpkg_rast()#> resolution : 0.008333333, 0.008333333 (x, y) #> extent : 6.008333, 6.266667, 49.69167, 49.94167 (xmin, xmax, ymin, ymax) #> coord. ref. : lon/lat WGS 84 (EPSG:4326) -#> sources : file1cba35ea0acf.gpkg:DEM1 -#> file1cba35ea0acf.gpkg:DEM2 -#> varnames : file1cba35ea0acf -#> file1cba35ea0acf +#> sources : file1d025ccbab3e.gpkg:DEM1 +#> file1d025ccbab3e.gpkg:DEM2 +#> varnames : file1d025ccbab3e +#> file1d025ccbab3e #> names : DEM1, DEM2 #> min values : ? , 195 #> max values : ? , 500 @@ -468,7 +468,7 @@

Method 4: gpkg_table()
 gpkg_table(g, "gpkg_contents")
 #> # Source:   table<gpkg_contents> [4 x 10]
-#> # Database: sqlite 3.45.0 [/tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg]
+#> # Database: sqlite 3.45.0 [/tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg]
 #>   table_name data_type   identifier description last_change   min_x min_y  max_x
 #>   <chr>      <chr>       <chr>      <chr>       <chr>         <dbl> <dbl>  <dbl>
 #> 1 DEM1       2d-gridded… DEM1       ""          2024-03-03…    6.01  49.7   6.27
@@ -517,7 +517,7 @@ 

Managing Connections#> -------------------------------------------------------------------------------- #> # of Tables: 19 #> -#> DEM1, DEM2, bbox, dummy_feature, gpkg_2d_gridded_coverage_ancillary, +#> DEM1, DEM2, bbox, dummy_features, gpkg_2d_gridded_coverage_ancillary, #> gpkg_2d_gridded_tile_ancillary, gpkg_contents, gpkg_extensions, #> gpkg_geometry_columns, gpkg_ogr_contents, gpkg_spatial_ref_sys, #> gpkg_tile_matrix, gpkg_tile_matrix_set, myattr, rtree_bbox_geom, @@ -525,7 +525,7 @@

Managing Connections#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/Rtmp2dDbAM/file1cba35ea0acf.gpkg +#> Path: /tmp/Rtmpg4Ph17/file1d025ccbab3e.gpkg #> Extensions: TRUE # disconnect diff --git a/pkgdown.yml b/pkgdown.yml index 24dcb1f..8ff834f 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: intro: intro.html -last_built: 2024-03-03T18:53Z +last_built: 2024-03-03T22:23Z diff --git a/reference/geopackage-class.html b/reference/geopackage-class.html index 5a3c9ac..a5730ca 100644 --- a/reference/geopackage-class.html +++ b/reference/geopackage-class.html @@ -1,5 +1,5 @@ -geopackage Constructors — geopackage • gpkggeopackage Constructors — geopackage • gpkg @@ -59,7 +59,7 @@

geopackage Constructors

-

geopackage Constructors

+

geopackage() (alias gpkg()) creates an S3 object of class geopackage.

@@ -78,7 +78,9 @@

geopackage Constructors

geopackage(x, ...) # S3 method for character -geopackage(x, connect = FALSE, ...)

+geopackage(x, connect = FALSE, ...) + +gpkg(x, ...)
@@ -113,6 +115,13 @@

Value

A geopackage object

+
+

Details

+

Several geopackage() methods are provided:

  • geopackage(x=<list>): creates a new GeoPackage object from a heterogeneous list of inputs

  • +
  • geopackage(x=<missing>): creates a new empty GeoPackage file in tmpdir

  • +
  • geopackage(x=<SQLiteConnection>): creates a GeoPackage object from an existing SQLite connection

  • +
  • geopackage(x=<character>): creates a GeoPackage object from a path to an existing GeoPackage file

  • +
-

This function creates a minimal (empty) feature table and gpkg_geometry_columns table entry.

+

This function has been deprecated. Please use gpkg_create_empty_features().

@@ -88,11 +88,12 @@

Value

Details

-

This is a workaround so that gpkg_vect() (via terra::vect()) will recognize a GeoPackage as containing geometries and allow for use of OGR query utilities. The "dummy table" is not added to gpkg_contents and you should not try to use it for anything. The main purpose is to be able to use gpkg_vect() and gpkg_ogr_query() on a GeoPackage that contains only gridded and/or attribute data.

+

Create a minimal (empty) feature table and gpkg_geometry_columns table entry.

+

This is a workaround so that gpkg_vect() (via terra::vect()) will recognize a GeoPackage as containing geometries and allow for use of OGR query utilities. The "dummy table" is not added to gpkg_contents and you should not try to use it for anything. The main purpose is to be able to use gpkg_vect() and gpkg_ogr_query() on a GeoPackage that contains only gridded and/or attribute data.

diff --git a/reference/gpkg_table.html b/reference/gpkg_table.html index 690fb5f..baa9d1f 100644 --- a/reference/gpkg_table.html +++ b/reference/gpkg_table.html @@ -84,10 +84,24 @@

Lazy Access to Tables by Name

# S3 method for geopackage gpkg_table_pragma(x, table_name = NULL, ...) -gpkg_table(x, table_name, collect = FALSE, query_string = FALSE, ...) +gpkg_table( + x, + table_name, + collect = FALSE, + column_names = "*", + query_string = FALSE, + ... +) # S3 method for default -gpkg_table(x, table_name, collect = FALSE, query_string = FALSE, ...) +gpkg_table( + x, + table_name, + collect = FALSE, + column_names = "*", + query_string = FALSE, + ... +) gpkg_collect(x, table_name, query_string = FALSE, ...) @@ -116,6 +130,10 @@

Arguments

logical. Materialize a data.frame object in memory? Default: FALSE requires 'dbplyr' package. TRUE uses 'RSQLite'.

+
column_names
+

character. Used only when collect=TRUE. A character vector of column names to select from table_name.

+ +
query_string

logical. Return SQLite query rather than executing it? Default: FALSE

@@ -166,7 +184,7 @@

Examples

# inspect gpkg_contents table gpkg_table(g, "gpkg_contents") #> # Source: table<gpkg_contents> [2 x 10] -#> # Database: sqlite 3.45.0 [/tmp/Rtmp45BfrU/file1aebb51cf93.gpkg] +#> # Database: sqlite 3.45.0 [/tmp/RtmpRPcblI/file1b237a00447.gpkg] #> table_name data_type identifier description last_change min_x min_y max_x #> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> #> 1 DEM1 2d-gridded-co… DEM1 "" 2024-03-03… 6.01 49.7 6.27 @@ -178,7 +196,7 @@

Examples

#> geometry : none #> dimensions : 0, 10 (geometries, attributes) #> extent : 0, 0, 0, 0 (xmin, xmax, ymin, ymax) -#> source : file1aebb51cf93.gpkg (SELECT) +#> source : file1b237a00447.gpkg (SELECT) #> coord. ref. : #> names : table_name data_type identifier description last_change min_x #> type : <chr> <chr> <chr> <chr> <chr> <num> diff --git a/reference/index.html b/reference/index.html index f7c5478..0a8b634 100644 --- a/reference/index.html +++ b/reference/index.html @@ -61,7 +61,7 @@

All functions

-

geopackage()

+

geopackage() gpkg()

geopackage Constructors

@@ -76,6 +76,10 @@

All functions gpkg_add_contents() gpkg_update_contents() gpkg_delete_contents() gpkg_create_contents()

Add, Remove, Update and Create gpkg_contents table and records

+ +

gpkg_create_empty_features()

+ +

Create an empty feature table

gpkg_spatial_ref_sys() gpkg_list_srs() gpkg_create_spatial_ref_sys() gpkg_add_spatial_ref_sys() gpkg_delete_spatial_ref_sys()

diff --git a/sitemap.xml b/sitemap.xml index e1e7e8e..2405f53 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -33,6 +33,9 @@ /reference/gpkg-contents.html + + /reference/gpkg-features.html + /reference/gpkg-package.html