restgdf

A package for getting GeoDataFrames from ArcGIS FeatureLayers.

class restgdf.Directory(url: str, session: ClientSession, token: str | None = None)[source]

Bases: object

A class for interacting with ArcGIS Server directories.

async crawl(return_feature_count: bool = False) dict[source]
feature_layers() list[dict][source]
filter_directory_layers(layer_type: str) list[dict][source]
async classmethod from_url(url: str, **kwargs) Directory[source]

Create a Directory object from a url.

async prep()[source]
rasters() list[dict][source]
class restgdf.FeatureLayer(url: str, session: ClientSession, where: str = '1=1', token: str | None = None, **kwargs)[source]

Bases: object

A class for interacting with ArcGIS FeatureLayers.

async classmethod from_url(url: str, **kwargs) FeatureLayer[source]

Create a Rest object from a url.

async getgdf() GeoDataFrame[source]

Get a GeoDataFrame from an ArcGIS FeatureLayer.

async getnestedcount(fields: tuple) DataFrame[source]

Get the nested value counts for a field.

async getoids() list[int][source]

Get the object ids for the Rest object.

async getuniquevalues(fields: tuple | str, sortby: str | None = None) list | DataFrame[source]

Get the unique values for a field.

async getvaluecounts(field: str) DataFrame[source]

Get the value counts for a field.

async headgdf(n: int = 10) GeoDataFrame[source]

Get the n first features as a GeoDataFrame.

async prep()[source]

Prepare the Rest object.

async samplegdf(n: int = 10) GeoDataFrame[source]

Get n random features as a GeoDataFrame.

async where(wherestr: str) FeatureLayer[source]

Create a new Rest object with a where clause.