Title: | Extension Types for Spatial Data for Use with 'Arrow' |
---|---|
Description: | Provides extension types and conversions to between R-native object types and 'Arrow' columnar types. This includes integration among the 'arrow', 'nanoarrow', 'sf', and 'wk' packages such that spatial metadata is preserved wherever possible. Extension type implementations ensure first-class geometry data type support in the 'arrow' and 'nanoarrow' packages. |
Authors: | Dewey Dunnington [aut, cre] , Anthony North [ctb], Apache Software Foundation [cph], Ulf Adams [cph], Daniel Lemire [cph], Joao Paulo Magalhaes [cph] |
Maintainer: | Dewey Dunnington <[email protected]> |
License: | Apache License (>= 2) |
Version: | 0.2.1.9000 |
Built: | 2024-11-12 03:10:14 UTC |
Source: | https://github.com/geoarrow/geoarrow-r |
Convert an object to a GeoArrow array
as_geoarrow_array(x, ..., schema = NULL) as_geoarrow_array_stream(x, ..., schema = NULL)
as_geoarrow_array(x, ..., schema = NULL) as_geoarrow_array_stream(x, ..., schema = NULL)
x |
An object |
... |
Passed to S3 methods |
schema |
A geoarrow extension schema to use as the target type |
as_geoarrow_array(wk::wkt("POINT (0 1)"))
as_geoarrow_array(wk::wkt("POINT (0 1)"))
GeoArrow encoded arrays as R vectors
as_geoarrow_vctr(x, ..., schema = NULL)
as_geoarrow_vctr(x, ..., schema = NULL)
x |
An object that works with |
... |
Passed to |
schema |
An optional |
A vctr of class 'geoarrow_vctr'
as_geoarrow_vctr("POINT (0 1)")
as_geoarrow_vctr("POINT (0 1)")
Handler/writer interface for GeoArrow arrays
geoarrow_handle(x, handler, size = NA_integer_) geoarrow_writer(schema)
geoarrow_handle(x, handler, size = NA_integer_) geoarrow_writer(schema)
x |
An object implementing |
handler |
|
size |
The number of elements in the stream or NA if unknown |
schema |
geoarrow_handle()
: Returns the result of handler
geoarrow_writer()
: Returns a nanoarrow array
geoarrow_handle(wk::xy(1:3, 2:4), wk::wk_debug_filter()) wk::wk_handle(wk::xy(1:3, 2:4), geoarrow_writer(na_extension_wkt()))
geoarrow_handle(wk::xy(1:3, 2:4), wk::wk_debug_filter()) wk::wk_handle(wk::xy(1:3, 2:4), geoarrow_writer(na_extension_wkt()))
Inspect a GeoArrow schema
geoarrow_schema_parse( schema, extension_name = NULL, infer_from_storage = FALSE ) is_geoarrow_schema(schema) as_geoarrow_schema(schema)
geoarrow_schema_parse( schema, extension_name = NULL, infer_from_storage = FALSE ) is_geoarrow_schema(schema) as_geoarrow_schema(schema)
schema |
|
extension_name |
An extension name to use if schema is a storage type. |
infer_from_storage |
Attempt to guess an extension name if schema is not a geoarrow extension type. |
A list of parsed properties
geoarrow_schema_parse(na_extension_geoarrow("POINT"))
geoarrow_schema_parse(na_extension_geoarrow("POINT"))
These functions provide GeoArrow type definitions as zero-length vectors.
geoarrow_wkb(crs = NULL, edges = "PLANAR") geoarrow_wkt(crs = NULL, edges = "PLANAR") geoarrow_large_wkb(crs = NULL, edges = "PLANAR") geoarrow_large_wkt(crs = NULL, edges = "PLANAR") geoarrow_native( geometry_type, dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_point( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_linestring( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_polygon( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multipoint( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multilinestring( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multipolygon( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" )
geoarrow_wkb(crs = NULL, edges = "PLANAR") geoarrow_wkt(crs = NULL, edges = "PLANAR") geoarrow_large_wkb(crs = NULL, edges = "PLANAR") geoarrow_large_wkt(crs = NULL, edges = "PLANAR") geoarrow_native( geometry_type, dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_point( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_linestring( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_polygon( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multipoint( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multilinestring( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" ) geoarrow_multipolygon( dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" )
crs |
An object representing a CRS. For maximum portability,
it should implement |
edges |
One of "PLANAR" or "SPHERICAL". |
geometry_type |
One of "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON". |
dimensions |
One of "XY", "XYZ", "XYM", or "XYZM" |
coord_type |
One of "SEPARATE" or "INTERLEAVED" |
geoarrow_wkb() geoarrow_wkt() geoarrow_point()
geoarrow_wkb() geoarrow_wkt() geoarrow_point()
Infer a GeoArrow-native type from a vector
infer_geoarrow_schema(x, ..., promote_multi = TRUE, coord_type = NULL)
infer_geoarrow_schema(x, ..., promote_multi = TRUE, coord_type = NULL)
x |
An object from which to infer a schema. |
... |
Passed to S3 methods. |
promote_multi |
Use |
coord_type |
Specify the coordinate type to use if returning |
infer_geoarrow_schema(wk::wkt("POINT (0 1)"))
infer_geoarrow_schema(wk::wkt("POINT (0 1)"))
Extension type definitions for GeoArrow extension types
na_extension_wkb(crs = NULL, edges = "PLANAR") na_extension_wkt(crs = NULL, edges = "PLANAR") na_extension_large_wkb(crs = NULL, edges = "PLANAR") na_extension_large_wkt(crs = NULL, edges = "PLANAR") na_extension_geoarrow( geometry_type, dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" )
na_extension_wkb(crs = NULL, edges = "PLANAR") na_extension_wkt(crs = NULL, edges = "PLANAR") na_extension_large_wkb(crs = NULL, edges = "PLANAR") na_extension_large_wkt(crs = NULL, edges = "PLANAR") na_extension_geoarrow( geometry_type, dimensions = "XY", coord_type = "SEPARATE", crs = NULL, edges = "PLANAR" )
crs |
An object representing a CRS. For maximum portability,
it should implement |
edges |
One of "PLANAR" or "SPHERICAL". |
geometry_type |
One of "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON". |
dimensions |
One of "XY", "XYZ", "XYM", or "XYZM" |
coord_type |
One of "SEPARATE" or "INTERLEAVED" |
na_extension_wkb(crs = "OGC:CRS84") na_extension_geoarrow("POINT")
na_extension_wkb(crs = "OGC:CRS84") na_extension_geoarrow("POINT")