Python objects and dataframe operations#
This reference distinguishes eager dataframes, deferred plans and query results. The package’s literal export list and declarations are in cugeo.geometry. Exact dataframe member signatures are in the deferred and eager declarations.
Choose an object#
Purpose |
Public names |
Work and result |
|---|---|---|
Describe or read a file |
|
A |
Register in-memory inputs |
|
Register a producer for queries. Ownership depends on the copy choice. |
Work eagerly |
|
Operate on eager containers. Check the supported profile for the operands and operation. |
Build a deferred query |
|
Build a plan and collect it to execute. |
Run SQL or read chunks |
|
Return a result or a reader of result chunks. |
Manage and prepare work |
|
Manage query resources and reuse a prepared Parquet geometry column. |
Diagnose and configure |
|
Inspect errors or build identity and configure the device reserve policy. |
table_from_file(path, *, format=None, options=None) snapshots a file description without reading it. Table.path and Table.format describe the source. Table.options returns a fresh copy of its options. read_file(path, *, columns=None, geometry=None, active_geometry=None, format=None, options=None, session=None) reads immediately. Projected column names must be unique and exact. Source occurrences receive a new cuDF RangeIndex.
Session.prepare_geometry(table, *, geometry) accepts a Parquet Table and a geometry column name. It prepares a session object without reading the column immediately. Session.table_from_arrow(obj, *, geometry=None, copy=False) uploads host batches or borrows a single CUDA batch when eligible. Session.table_from_cudf(frame, *, copy, producer_stream=None) requires an explicit Boolean copy choice. See passing inputs and results between Python libraries for producer lifetime and export choices.
Eager frames and series#
GeoDataFrame.from_arrow constructs an eager frame. geometry and active_geometry_name identify the active geometry. set_geometry selects it and set_crs sets its CRS metadata. The frame exposes schema, columns, index, indexing, take, dropna, drop_duplicates and export methods. Geometry metadata and occurrence indexes are preserved within the checked profiles of these operations. Active-column delegates operate on the selected geometry.
GeoSeries provides measures such as area, length, bounds, count_coordinates, total_bounds and distance, predicates including intersects, within, contains, covers, covered_by, touches, disjoint and dwithin, and constructions such as centroid, envelope and buffer. It also exposes geometry state, row selection and exports. Check the declaration and supported operand, CRS, argument and result profile for the particular operation.
Eager spatial joins#
The eager method GeoDataFrame.sjoin(df, how='inner', predicate='intersects', lsuffix='left', rsuffix='right', **kwargs) has its own admission rules and producer requirements, including the qualified pylibcudf producer. Do not assume that its predicate support matches deferred joins or that either interface transforms coordinates automatically.
Deferred frames and joins#
LazyFrame.set_geometry, select, filter, sjoin and groupby retain a plan. collect executes it and returns a Result. collect_chunked returns a ChunkedResultReader. A ColumnExpr represents a scoped expression in that plan.
LazyFrame.sjoin(right, *, how='inner', predicate='intersects', lsuffix='left', rsuffix='right') joins the active geometries and retains left columns and right attributes as an unordered bag.
Option |
Accepted planning values |
|---|---|
|
|
|
|
Suffixes |
Nonempty strings without NUL |
right, full and dwithin are recognized capability refusals. Unrecognized values are invalid. Admission of an option does not guarantee that every runtime geometry shape is supported. The planner tests cover both operand orientations and collisions: suffixes distinguish overlapping labels while expressions retain their input lineage. See the join planner tests for the checked fixtures.
Results and destinations#
Result.columns, types, type_metadata, schema and len(result) read metadata without copying result data. Together they identify output labels, SQL types, representation and units. rows copies to the host on first access. NULL becomes None, geometry and bytea become bytes, arbitrary numeric values remain lossless text, and temporal values are integer ticks or days.
Destination |
Method |
Placement and conditions |
|---|---|---|
Python values |
|
Host row tuples, materialized lazily. |
Arrow |
|
Independently owned host PyArrow table. |
pandas |
|
Host ArrowDtype columns with field metadata. Labels must be unique. |
GeoPandas |
|
Host GeoDataFrame for qualified geometry layouts and selector conditions. |
cuDF |
|
Device Arrow export. Refuses geometry, bytea, arbitrary-precision numeric and duplicate labels. |
A geometry value can therefore appear as bytes in rows while the same result is refused by to_cudf. For device consumers retaining an Arrow export, see device buffer ordering and release.
ChunkedResultReader exposes the result schema and streamed state. has_next() computes the next chunk when needed. read_chunk() returns a Result, and iteration yields chunks in order. close() cancels remaining work. Chunks already read remain valid. A nonstreamed result is returned as one whole chunk and must fit in GPU memory.
Generated export index#
The index follows the literal public exports in the Python source. Function signatures preserve parameter names, defaults, and annotations. The binding column identifies re-exports and imported definitions. Runtime route conditions belong with each operation.
cugeo.geometry#
Export |
Declaration |
Binding |
|---|---|---|
|
Class |
|
|
Class |
|
|
|
|
|
|
|
|
Class |
|
|
Class |
|
|
Class |
|
|
Class |
— |
|
Class |
— |
|
Class |
— |
|
Class |
— |
|
Class |
— |
|
Class |
— |
|
Imported binding |
|
|
Attribute |
— |
|
Class |
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
|
— |
|
Class |
|
|
Class |
|
|
Class |
|
|
|
|
|
|
— |
|
Attribute |
— |
Generated direct class declarations#
These entries list public methods declared on the class. Source signatures may show a receiver parameter. Inherited methods and generated constructors follow the class or external binding named in the export index.
cugeo.geometry.BuildIdentity#
component(self, name: str) -> BuildComponentto_dict(self) -> dict
cugeo.geometry.ChunkedResultReader#
__init__(self, native)columns — propertytypes — propertytype_metadata — propertyschema — propertystreamed — propertyclosed — propertyhas_next(self) -> boolread_chunk(self) -> Resultclose(self)
cugeo.geometry.ColumnExpr#
__init__(self, native)area — propertyis_null(self)is_not_null(self)
cugeo.geometry.GeoDataFrame#
__init__(self)from_arrow(cls, obj, *, geometry, active_geometry=None, index=None, session=None)columns — propertyindex — propertyactive_geometry_name — propertycrs — propertyschema — propertygeometry — propertyset_geometry(self, label)set_crs(self, crs=None, epsg=None, inplace=False, allow_override=False)covered_by(self, other, align=None)touches(self, other, align=None)sjoin(self, df, how='inner', predicate='intersects', lsuffix='left', rsuffix='right', **kwargs)sjoin_nearest(self, right, how='inner', max_distance=None, lsuffix='left', rsuffix='right', distance_col=None, exclusive=False)disjoint(self, other, align=None)geom_type — propertycount_coordinates(self)total_bounds — propertyis_empty — propertycentroid — propertyenvelope — propertybuffer(self, distance, resolution=16, cap_style='round', join_style='round', mitre_limit=5.0, single_sided=False, **kwargs)dwithin(self, other, distance, align=None)dropna(self, *, axis=0, how=_NO_DEFAULT, thresh=_NO_DEFAULT, subset=None, inplace=False, ignore_index=False)drop_duplicates(self, subset=None, *, keep='first', inplace=False, ignore_index=False)take(self, positions)to_arrow(self)to_geopandas(self)
cugeo.geometry.GeoSeries#
__init__(self)name — propertyindex — propertycrs — propertyschema — propertyset_crs(self, crs=None, epsg=None, inplace=False, allow_override=False)geom_type — propertycount_coordinates(self)is_empty — propertyarea — propertycentroid — propertyenvelope — propertybuffer(self, distance, resolution=16, cap_style='round', join_style='round', mitre_limit=5.0, single_sided=False, **kwargs)length — propertybounds — propertyintersects(self, other, align=None)total_bounds — propertywithin(self, other, align=None)contains(self, other, align=None)covers(self, other, align=None)covered_by(self, other, align=None)touches(self, other, align=None)disjoint(self, other, align=None)distance(self, other, align=None)dwithin(self, other, distance, align=None)take(self, positions)isna(self)notna(self)dropna(self, *, axis=0, inplace=False, how=None, ignore_index=False)drop_duplicates(self, *, keep='first', inplace=False, ignore_index=False)to_arrow(self)to_geopandas(self)
cugeo.geometry.LazyFrame#
__init__(self, source)geometry — propertyset_geometry(self, label)select(self, columns=(), **named)filter(self, condition)sjoin(self, right, *, how='inner', predicate='intersects', lsuffix='left', rsuffix='right')groupby(self, keys, *, dropna=False, sort=False, as_index=False)collect(self, *, session=None, device=None, geometry_encoding='auto')collect_chunked(self, *, session=None, device=None, geometry_encoding='auto', chunk_read_limit=0)
cugeo.geometry.LazyGrouped#
__init__(self, native)agg(self, **named)size(self, *, name='rows')
cugeo.geometry.PreparedGeometry#
__init__(self, native, table, geometry, device)table — propertygeometry — propertydevice — propertystats(self)release(self)
cugeo.geometry.RegisteredTable#
__init__(self, native)device — propertyrow_count — propertyowned_device_bytes — propertystats(self)release(self)
cugeo.geometry.Result#
__init__(self, device)columns — propertytypes — propertytype_metadata — propertyschema — propertyrows — propertyexport(self, *, stream)to_arrow(self)to_pandas(self)to_geopandas(self, geometry=None)to_cudf(self)
cugeo.geometry.Session#
__init__(self, device=0, *, device_memory_limit=None, memory_resource=None, decimal_width='precision', device_reserve=None)device — propertydecimal_width — propertyclosed — propertyretained_device_bytes — propertydevice_reservation — propertyclose(self)sql(self, text: str, *, tables: Mapping, geometry_encoding: str='auto') -> Resultsql_chunked(self, text: str, *, tables: Mapping, chunk_read_limit: int=0, geometry_encoding: str='auto') -> ChunkedResultReaderprepare_geometry(self, table, *, geometry) -> PreparedGeometrytable_from_cudf(self, frame, *, copy, producer_stream=None) -> RegisteredTabletable_from_arrow(self, obj, *, geometry=None, copy=False) -> RegisteredTable
cugeo.geometry.Table#
__init__(self, path, *, format=None, options=None)options — property
Generated class protocol declarations#
Class |
Declaration |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|