### WKB/WKT Serialization Example Source: https://shapely.readthedocs.io Example of serializing and deserializing a point using shapely.wkb and shapely.wkt. ```python >>> from shapely.wkt import dumps, loads >>> dumps(loads('POINT (0 0)')) 'POINT (0.0000000000000000 0.0000000000000000)' ``` -------------------------------- ### Installing Shapely with pip or conda Source: https://shapely.readthedocs.io Recommended installation commands for Shapely using pip or conda. ```bash $ pip install shapely # or using conda $ conda install shapely --channel conda-forge ``` -------------------------------- ### GeoJSON-like Integration Example Source: https://shapely.readthedocs.io Example of integrating Shapely with other Python GIS packages using GeoJSON-like dicts. ```python >>> import json >>> from shapely.geometry import mapping, shape >>> s = shape(json.loads('{"type": "Point", "coordinates": [0.0, 0.0]}')) >>> s >>> print(json.dumps(mapping(s))) {"type": "Point", "coordinates": [0.0, 0.0]} ``` -------------------------------- ### Scalar Geometry Interface Example Source: https://shapely.readthedocs.io Example of building an approximately circular patch by buffering a point using the scalar Geometry interface. ```python >>> from shapely import Point >>> patch = Point(0.0, 0.0).buffer(10.0) >>> patch >>> patch.area 313.6548490545941 ``` -------------------------------- ### Vectorized ufunc Interface Example Source: https://shapely.readthedocs.io Example of comparing an array of points with a polygon using the vectorized ufunc interface. ```python >>> import shapely >>> import numpy as np >>> geoms = np.array([Point(0, 0), Point(1, 1), Point(2, 2)]) >>> polygon = shapely.box(0, 0, 2, 2) >>> shapely.contains(polygon, geoms) array([False, True, False]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.