diff --git a/articles/intro.html b/articles/intro.html index c80cce9..fc49832 100644 --- a/articles/intro.html +++ b/articles/intro.html @@ -185,7 +185,7 @@

Read a GeoPackage#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg +#> Path: /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg #> Extensions: TRUE class(g) #> [1] "geopackage" @@ -206,12 +206,12 @@

Read a GeoPackage#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/RtmpWgzuB9/Rgpkg1daf5a65b245.gpkg +#> Path: /tmp/RtmpdiTf7I/Rgpkg1d2b479363a6.gpkg #> Extensions: TRUE class(g2) #> [1] "geopackage"

Note that a temporary GeoPackage -(/tmp/RtmpWgzuB9/Rgpkg1daf5a65b245.gpkg) is automatically created when +(/tmp/RtmpdiTf7I/Rgpkg1d2b479363a6.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, @@ -251,8 +251,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 : file1daf1da41bd2.gpkg:DEM1 -#> varname : file1daf1da41bd2 +#> source : file1d2b4c48639f.gpkg:DEM1 +#> varname : file1d2b4c48639f #> name : DEM1 #> #> $DEM2 @@ -261,15 +261,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 : file1daf1da41bd2.gpkg:DEM2 -#> varname : file1daf1da41bd2 +#> source : file1d2b4c48639f.gpkg:DEM2 +#> varname : file1d2b4c48639f #> name : DEM2 #> min value : 195 #> max value : 500 #> #> $myattr #> # Source: table<myattr> [10 x 2] -#> # Database: sqlite 3.45.0 [/tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg] +#> # Database: sqlite 3.45.0 [/tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg] #> a b #> <int> <chr> #> 1 1 A @@ -288,7 +288,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 : file1daf1da41bd2.gpkg (bbox) +#> source : file1d2b4c48639f.gpkg (bbox) #> layer : bbox #> coord. ref. : lon/lat WGS 84 (EPSG:4326) @@ -326,13 +326,13 @@

Inspect Contents of GeoPackage
 gpkg_tbl(g, "gpkg_contents")
 #> # Source:   table<gpkg_contents> [4 x 10]
-#> # Database: sqlite 3.45.0 [/tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg]
+#> # Database: sqlite 3.45.0 [/tmp/RtmpdiTf7I/file1d2b4c48639f.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-02-19…    6.01  49.7   6.27
-#> 2 DEM2       2d-gridded… DEM2       ""          2024-02-19…    6.01  49.7   6.27
-#> 3 bbox       features    bbox       ""          2024-02-19…    6.01  49.7   6.27
-#> 4 myattr     attributes  myattr     ""          2024-02-19… -180    -90   180   
+#> 1 DEM1       2d-gridded… DEM1       ""          2024-02-20…    6.01  49.7   6.27
+#> 2 DEM2       2d-gridded… DEM2       ""          2024-02-20…    6.01  49.7   6.27
+#> 3 bbox       features    bbox       ""          2024-02-20…    6.01  49.7   6.27
+#> 4 myattr     attributes  myattr     ""          2024-02-20… -180    -90   180   
 #> # ℹ 2 more variables: max_y <dbl>, srs_id <int>

More on how to use this type of result next.

@@ -353,12 +353,12 @@

Method 1: gpkg_table_pragma()
 head(gpkg_table_pragma(g))
 #>                                     dsn table_name nrow table_info.cid
-#> 1 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM1    1              0
-#> 2 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM1    1              1
-#> 3 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM1    1              2
-#> 4 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM1    1              3
-#> 5 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM1    1              4
-#> 6 /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg       DEM2    1              0
+#> 1 /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg       DEM1    1              0
+#> 2 /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg       DEM1    1              1
+#> 3 /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg       DEM1    1              2
+#> 4 /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg       DEM1    1              3
+#> 5 /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg       DEM1    1              4
+#> 6 /tmp/RtmpdiTf7I/file1d2b4c48639f.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>
@@ -388,7 +388,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 : file1daf1da41bd2.gpkg (bbox) +#> source : file1d2b4c48639f.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 @@ -399,7 +399,7 @@

Method 2: gpkg_vect() an #> geometry : none #> dimensions : 0, 2 (geometries, attributes) #> extent : 0, 0, 0, 0 (xmin, xmax, ymin, ymax) -#> source : file1daf1da41bd2.gpkg (SELECT) +#> source : file1d2b4c48639f.gpkg (SELECT) #> coord. ref. : #> names : table_name feature_count #> type : <chr> <int> @@ -443,10 +443,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 : file1daf1da41bd2.gpkg:DEM1 -#> file1daf1da41bd2.gpkg:DEM2 -#> varnames : file1daf1da41bd2 -#> file1daf1da41bd2 +#> sources : file1d2b4c48639f.gpkg:DEM1 +#> file1d2b4c48639f.gpkg:DEM2 +#> varnames : file1d2b4c48639f +#> file1d2b4c48639f #> names : DEM1, DEM2 #> min values : ? , 195 #> max values : ? , 500 @@ -467,13 +467,13 @@

Method 4: gpkg_table()
 gpkg_table(g, "gpkg_contents")
 #> # Source:   table<gpkg_contents> [4 x 10]
-#> # Database: sqlite 3.45.0 [/tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg]
+#> # Database: sqlite 3.45.0 [/tmp/RtmpdiTf7I/file1d2b4c48639f.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-02-19…    6.01  49.7   6.27
-#> 2 DEM2       2d-gridded… DEM2       ""          2024-02-19…    6.01  49.7   6.27
-#> 3 bbox       features    bbox       ""          2024-02-19…    6.01  49.7   6.27
-#> 4 myattr     attributes  myattr     ""          2024-02-19… -180    -90   180   
+#> 1 DEM1       2d-gridded… DEM1       ""          2024-02-20…    6.01  49.7   6.27
+#> 2 DEM2       2d-gridded… DEM2       ""          2024-02-20…    6.01  49.7   6.27
+#> 3 bbox       features    bbox       ""          2024-02-20…    6.01  49.7   6.27
+#> 4 myattr     attributes  myattr     ""          2024-02-20… -180    -90   180   
 #> # ℹ 2 more variables: max_y <dbl>, srs_id <int>

As a more complicated example we access the gpkg_2d_gridded_tile_ancillary table, and perform some data @@ -524,7 +524,7 @@

Managing Connections#> sqlite_sequence #> -------------------------------------------------------------------------------- #> <SQLiteConnection> -#> Path: /tmp/RtmpWgzuB9/file1daf1da41bd2.gpkg +#> Path: /tmp/RtmpdiTf7I/file1d2b4c48639f.gpkg #> Extensions: TRUE # disconnect diff --git a/news/index.html b/news/index.html index 4838e9a..94f9085 100644 --- a/news/index.html +++ b/news/index.html @@ -58,7 +58,7 @@

Changelog

- +
  • Added gpkg_create_spatial_view() for creating spatial views, which are dynamic layers accessible as if they were typical static geometry layers (for #6).

  • gpkg_write() now properly writing attributes from a data.frame source (which is not nested in a list) when table_name argument is

  • diff --git a/pkgdown.yml b/pkgdown.yml index 5264d39..1275015 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -3,5 +3,5 @@ pkgdown: 2.0.7 pkgdown_sha: ~ articles: intro: intro.html -last_built: 2024-02-19T19:31Z +last_built: 2024-02-20T02:34Z diff --git a/reference/gpkg_table.html b/reference/gpkg_table.html index 803e369..10c40ec 100644 --- a/reference/gpkg_table.html +++ b/reference/gpkg_table.html @@ -162,11 +162,11 @@

    Examples

    # inspect gpkg_contents table gpkg_table(g, "gpkg_contents") #> # Source: table<gpkg_contents> [2 x 10] -#> # Database: sqlite 3.45.0 [/tmp/RtmpxHu7rT/file1bea666492e0.gpkg] +#> # Database: sqlite 3.45.0 [/tmp/RtmpzIYxdz/file1b686a8902f9.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-02-19… 6.01 49.7 6.27 -#> 2 DEM2 2d-gridded-co… DEM2 "" 2024-02-19… 6.01 49.7 6.27 +#> 1 DEM1 2d-gridded-co… DEM1 "" 2024-02-20… 6.01 49.7 6.27 +#> 2 DEM2 2d-gridded-co… DEM2 "" 2024-02-20… 6.01 49.7 6.27 #> # ℹ 2 more variables: max_y <dbl>, srs_id <int> gpkg_vect(g, "gpkg_contents") @@ -174,7 +174,7 @@

    Examples

    #> geometry : none #> dimensions : 0, 10 (geometries, attributes) #> extent : 0, 0, 0, 0 (xmin, xmax, ymin, ymax) -#> source : file1bea666492e0.gpkg (SELECT) +#> source : file1b686a8902f9.gpkg (SELECT) #> coord. ref. : #> names : table_name data_type identifier description last_change min_x #> type : <chr> <chr> <chr> <chr> <chr> <num>