From Shapely and GeoPandas#

The methods on this page are inherited by Vector. With the vct interface, call them directly on the GeoDataFrame.

Geometric attributes and methods#

This first category of attributes and methods return a geometric output converted to a Vector by default.

Attributes:

Vector.boundary

Return a Vector of lower dimensional objects representing each geometry's set-theoretic boundary.

Vector.centroid

Return a Vector of points representing the centroid of each geometry.

Vector.convex_hull

Return a Vector of geometries representing the convex hull of each geometry.

Vector.envelope

Return a Vector of geometries representing the envelope of each geometry.

Vector.exterior

Return a Vector of LinearRings representing the outer boundary of each polygon in the Vector.

Methods:

Vector.representative_point()

Return a Vector of (cheaply computed) points that are guaranteed to be within each geometry.

Vector.normalize()

Return a Vector of normalized geometries to normal form (or canonical form).

Vector.make_valid()

Repairs invalid geometries.

Vector.difference(other[, align])

Return a Vector of the points in each aligned geometry that are not in other.

Vector.symmetric_difference(other[, align])

Return a Vector of the symmetric difference of points in each aligned geometry with other.

Vector.union(other[, align])

Return a Vector of the union of points in each aligned geometry with other.

Vector.union_all([method])

Return a geometry containing the union of all geometries in the Vector.

Vector.intersection(other[, align])

Return a Vector of the intersection of points in each aligned geometry with other.

Vector.intersection_all()

Return a geometry containing the intersection of all geometries in the Vector.

Vector.clip_by_rect(xmin, ymin, xmax, ymax)

Return a Vector of the portions of geometry within the given rectangle.

Vector.buffer(distance[, resolution, ...])

Return a Vector of geometries representing all points within a given distance of each geometric object.

Vector.simplify(tolerance[, preserve_topology])

Return a Vector containing a simplified representation of each geometry.

Vector.affine_transform(matrix)

Return a Vector with translated geometries.

Vector.translate([xoff, yoff, zoff, inplace])

Shift a vector by a coordinate offset.

Vector.rotate(angle[, origin, use_radians])

Return a Vector with rotated geometries.

Vector.scale([xfact, yfact, zfact, origin])

Return a Vector with scaled geometries.

Vector.skew([xs, ys, origin, use_radians])

Return a Vector with skewed geometries.

Vector.concave_hull([ratio, allow_holes])

Return a Vector of geometries representing the concave hull of vertices of each geometry.

Vector.delaunay_triangles([tolerance, ...])

Return a Vector consisting of objects representing the computed Delaunay triangulation between the vertices of an input geometry.

Vector.voronoi_polygons([tolerance, ...])

Return a Vector consisting of objects representing the computed Voronoi diagram around the vertices of an input geometry.

Vector.minimum_rotated_rectangle()

Return a Vector of the general minimum bounding rectangle that contains the object.

Vector.minimum_bounding_circle()

Return a Vector of geometries representing the minimum bounding circle that encloses each geometry.

Vector.extract_unique_points()

Return a Vector of MultiPoints representing all distinct vertices of an input geometry.

Vector.remove_repeated_points([tolerance])

Return a Vector containing a copy of the input geometry with repeated points removed.

Vector.offset_curve(distance[, quad_segs, ...])

Return a LineString or MultiLineString geometry at a distance from the object on its right or its left side.

Vector.reverse()

Return a Vector with the order of coordinates reversed.

Vector.segmentize(max_segment_length)

Return a Vector with vertices added to line segments based on maximum segment length.

Vector.polygonize([node, full])

Create polygons formed from the linework of a Vector.

Vector.transform(transformation[, include_z])

Return a Vector with the transformation function applied to the geometry coordinates.

Vector.force_2d()

Force the dimensionality of a geometry to 2D.

Vector.force_3d([z])

Force the dimensionality of a geometry to 3D.

Vector.line_merge([directed])

Return (Multi)LineStrings formed by combining the lines in a MultiLineString.

Vector.shortest_line(other[, align])

Return the shortest two-point line between two geometries.

Vector.interpolate(distance[, normalized])

Return a point at the specified distance along each geometry.

Vector.shared_paths(other[, align])

Return the shared paths between two geometries.

Vector.dissolve([by, aggfunc, as_index, ...])

Dissolve geometries within groupby into single observation.

Vector.explode([column, ignore_index, ...])

Explode multi-part geometries into multiple component geometries.

Vector.sjoin(df, *args, **kwargs)

Spatial join of two Vectors.

Vector.sjoin_nearest(right[, how, ...])

Spatial join of two Vectors based on the distance between their geometries.

Vector.overlay(right[, how, keep_geom_type, ...])

Perform spatial overlay between Vectors.

Vector.snap(other, tolerance[, align])

Snap the vertices and segments of the geometry to vertices of the reference.

Vector.to_crs([crs, epsg, inplace])

Transform geometries to a new coordinate reference system.

Vector.set_crs([crs, epsg, inplace, ...])

Set the Coordinate Reference System (CRS) of the Vector.

Vector.get_geometry(index)

Return the n-th geometry from a collection of geometries.

Vector.set_geometry(col[, drop, inplace, crs])

Set the Vector geometry using either an existing column or the specified input.

Vector.rename_geometry(col[, inplace])

Rename the Vector geometry column to the specified name.

Vector.set_precision([grid_size, mode, inplace])

Return a GeoSeries with the precision set to a precision grid size.

Vector.get_coordinates([include_z, ...])

Get coordinates from a Vector as a DataFrame of floats.

Vector.cx()

Coordinate based indexer to select by intersection with bounding box.

Non-geometric per-feature attributes and methods#

This second category returns a non-geometric pandas.Series with one result per feature, as in GeoPandas. Assign that Series to a column of Vector.gdf to store it with the geometries.

Attributes:

Vector.area

Return a Series containing the area of each geometry in the Vector expressed in the units of the CRS.

Vector.length

Return a Series containing the length of each geometry expressed in the units of the CRS.

Vector.interiors

Return a Series of List representing the inner rings of each polygon in the Vector.

Vector.geom_type

Returns a Series of strings specifying the Geometry Type of each object.

Vector.geom_bounds

Returns or appends to Vector a Series with the bounds of each geometry feature.

Vector.is_valid

Return a Series of dtype('bool') with value True for geometries that are valid.

Vector.is_empty

Returns a Series of dtype('bool') with value True for empty geometries.

Vector.is_ring

Return a Series of dtype('bool') with value True for features that are closed.

Vector.is_simple

Return a Series of dtype('bool') with value True for geometries that do not cross themselves.

Vector.is_ccw

Return a Series of dtype('bool') with value True if a LineString or LinearRing is counterclockwise.

Vector.is_closed

Return a Series of dtype('bool') with value True if a LineString's or LinearRing's first and last points are equal.

Vector.has_z

Return a Series of dtype('bool') with value True for features that have a z-component.

Methods:

Vector.contains(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that contains other.

Vector.geom_equals(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry equal to other.

Vector.crosses(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that cross other.

Vector.disjoint(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry disjoint to other.

Vector.intersects(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that intersects other.

Vector.overlaps(other[, align])

Return True for all aligned geometries that overlap other, else False.

Vector.touches(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that touches other.

Vector.within(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that is within other.

Vector.covers(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that is entirely covering other.

Vector.covered_by(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that is entirely covered by other.

Vector.distance(other[, align])

Return a Series containing the distance to aligned other.

Vector.is_valid_reason()

Return a Series of strings with the reason for invalidity of each geometry.

Vector.count_coordinates()

Return a Series containing the count of the number of coordinate pairs in each geometry.

Vector.count_geometries()

Return a Series containing the count of geometries in each multi-part geometry.

Vector.count_interior_rings()

Return a Series containing the count of the number of interior rings in a polygonal geometry.

Vector.get_precision()

Return a Series of the precision of each geometry.

Vector.minimum_clearance()

Return a Series containing the minimum clearance distance, which is the smallest distance by which a vertex of the geometry could be moved to produce an invalid geometry.

Vector.minimum_bounding_radius()

Return a Series of the radii of the minimum bounding circles that enclose each geometry.

Vector.contains_properly(other[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that is completely inside other, with no common boundary points.

Vector.dwithin(other, distance[, align])

Return a Series of dtype('bool') with value True for each aligned geometry that is within a set distance from other.

Vector.hausdorff_distance(other[, align, ...])

Return a Series containing the Hausdorff distance to aligned other.

Vector.frechet_distance(other[, align, densify])

Return a Series containing the Frechet distance to aligned other.

Vector.hilbert_distance([total_bounds, level])

Calculate the distance along a Hilbert curve.

Vector.relate(other[, align])

Return the DE-9IM intersection matrices for the geometries.

Vector.relate_pattern(other, pattern[, align])

Return True if the DE-9IM string code for the relationship between the geometries satisfies the pattern, else False.

Vector.project(other[, normalized, align])

Return the distance along each geometry nearest to other.

I/O, conversions and others#

Important

The behaviour of methods below is not modified in Vector, as they deal with outputs of different types. To ensure those are up-to-date with GeoPandas, alternatively call those from Vector.gdf.

Vector.from_file(filename, **kwargs)

Alternate constructor to create a Vector from a file.

Vector.from_features(features, crs, columns)

Alternate constructor to create Vector from an iterable of features or a feature collection.

Vector.from_postgis(sql, con[, geom_col, ...])

Alternate constructor to create a Vector from a sql query containing a geometry column in WKB representation.

Vector.from_dict(data[, geometry, crs])

Construct Vector from dict of array-like or dicts by overriding DataFrame.from_dict method with geometry and crs.

Vector.from_arrow(table[, geometry])

Construct a Vector from an Arrow table object based on GeoArrow extension types.

Vector.to_file(filename[, driver, schema, index])

Write the Vector to a file.

Vector.to_feather(path[, index, ...])

Write a Vector to the Feather format.

Vector.to_parquet(path[, index, ...])

Write a Vector to the Parquet format.

Vector.to_arrow([index, geometry_encoding, ...])

Encode a Vector to GeoArrow format.

Vector.to_wkt(**kwargs)

Encode all geometry columns in the Vector to WKT.

Vector.to_wkb([hex])

Encode all geometry columns in the Vector to WKB.

Vector.to_json([na, show_bbox, drop_id])

Return a GeoJSON representation of the Vector as a string.

Vector.to_postgis(name, con[, schema, ...])

Upload Vector into PostGIS database.

Vector.to_geo_dict([na, show_bbox, drop_id])

Return a python feature collection representation of the Vector as a dictionary with a list of features based on the __geo_interface__ GeoJSON-like specification.

Vector.to_csv([path_or_buf, sep, na_rep, ...])

Write object to a comma-separated values (csv) file.

Other attributes and methods#

Vector.has_sindex

Check the existence of the spatial index without generating it.

Vector.sindex

Generate the spatial index.

Vector.total_bounds

Total bounds of the vector.

See also

The methods above are described in GeoPandas GeoSeries’s API and Shapely object’s documentation.