Documentation & Knowledge Base

Documentation & Help

Find instructions, guides, and answers to your questions regarding the use of the Gismatrix platform.

Spatial Functions

Gismatrix includes a comprehensive set of spatial functions compliant with the OGC Simple Features for SQL standard. These functions allow you to perform complex geospatial queries and analyses directly on your device. Crucially, all these functions are available across all platforms (desktop, tablet, and phone) and work completely offline, without requiring an internet connection.

You can use them in various places within the Gismatrix application where SQL expressions can be entered:

Most functions are directly compatible with PostGIS functions. For these, a brief description and a link to the official PostGIS documentation for more details are provided. Functions that are specific to Gismatrix or differ in their behavior are described in more detail.

Special Considerations for Complex Queries (Aggregations and CTEs)

When using the SQL View tool to construct queries in Gismatrix, the system generally takes care of adding the primary key and maintaining the link to the map automatically. In Gismatrix, the primary key is the __id__ column, which is universally present in every layer and is essential for interactivity (selection and display on the map via featureId, "Add layer to map from..."). If this column is missing from the result, the output becomes a standard attribute table with no spatial characteristics, and the geom column, normally hidden and reserved for internal rendering, is treated as a regular data column.

The system injects this __id__ automatically for standard queries. However, for complex queries involving row grouping (GROUP BY), duplicate elimination (DISTINCT), set operations (UNION, INTERSECT, EXCEPT), or advanced CTE blocks (WITH) combined with aggregations (e.g., ST_Union, ST_Extent), the system does not rely on automatic injection in order to prevent SQL errors and avoid binding to the wrong layer when multiple tables are joined.

In all such cases, you must manually add the primary key __id__ of the target source table (the layer whose features you want linked to the map via featureId) into your main SELECT clause as alias.__id__ AS __id__, and (if the main query uses GROUP BY) include it in the GROUP BY clause as well. The system will recognize the manual identifier, bind the result to the matching map layer, hide the geom column in the grid, and enable all spatial features, including the "Add layer to map from..." button. Naturally, a geometry column must also be present in the SELECT statement.

Example 1: Aggregation with GROUP BY and ST_Union

In this example, we want to union several land use polygons within a single parcel. Because the outer query uses GROUP BY, we must explicitly include p.__id__ in both clauses; otherwise, the system loses track of the primary key.

SELECT
  p.__id__ AS __id__, -- MANDATORY MANUALLY ADDED IDENTIFIER (System recognizes it and skips auto-injection)
  p.ko_parc,
  -- Unioned land use geometry within the parcel
  ST_Intersection(ST_Boundary(ST_Union(d.geom)), p.geom) AS geom
FROM draba d
JOIN delez p ON ST_Intersects(d.geom, p.geom) = 1
GROUP BY
  p.__id__,           -- MANDATORY ADDITION IN GROUP BY
  p.ko_parc,
  p.geom;

Example 2: Using CTEs (WITH) with Aggregation

When using a CTE (WITH) where geometries are aggregated inside an auxiliary block and then joined to a main table, you must likewise manually include p.__id__ AS __id__ in the main SELECT clause so the result links directly to the parcel layer on the map.

WITH merged_draba AS (
  SELECT
    p.ko_parc,
    ST_Union(d.geom) AS geom
  FROM draba d
  JOIN delez p ON ST_Intersects(d.geom, p.geom) = 1
  GROUP BY p.ko_parc
)
SELECT
  p.__id__ AS __id__, -- MANDATORY MANUALLY ADDED IDENTIFIER OF THE TARGET MAP LAYER
  p.ko_parc,
  ST_Difference(ST_Intersection(ST_Boundary(md.geom), p.geom), ST_Buffer(ST_Boundary(p.geom), 0.01)) AS geom
FROM delez p
JOIN merged_draba md ON p.ko_parc = md.ko_parc;

Spatial Query Optimizer & Bounding-Box Operators (<-> and &&)

Gismatrix includes a built-in Spatial Query Optimizer that automatically injects R-Tree spatial index filters for positive spatial predicates (such as ST_Intersects, ST_Contains, ST_Within, ST_DWithin, etc.) across both two-table JOIN queries and single-table constant-geometry WHERE filters. In addition, it supports two specialized PostGIS operators that bind directly to pre-calculated physical Bounding Box columns (__minx__, __maxx__, __miny__, __maxy__) on every spatial layer, avoiding the overhead of reading and decoding binary WKB geometries.

Bounding Box Intersects Operator &&: Used inside WHERE or JOIN ON clauses to test whether two bounding boxes overlap (equivalent to ST_EnvelopeIntersects). It automatically leverages the R-Tree index and is ideal whenever a fast envelope check is sufficient without exact GEOS vertex-level topology evaluation.

KNN Distance Operator <->: Designed to be used in an ORDER BY clause combined with LIMIT. It computes 2D Euclidean distance between bounding boxes directly from the physical BBOX columns, enabling blazing-fast sorting and retrieval of the N closest records even on tables with hundreds of thousands of features.

Example 3: Fast Filtering and Nearest-Neighbor Search with && and <->

The query below uses the R-Tree index to narrow candidates to parcels overlapping the search envelope, then returns the 5 parcels closest to the target point.

SELECT
  p.__id__ AS __id__,
  p.ko_parc,
  p.geom
FROM delez p
WHERE p.geom && ST_MakeEnvelope(14.0, 45.0, 15.0, 46.0)
ORDER BY p.geom <-> ST_MakePoint(14.50, 46.05) ASC
LIMIT 5;

When are these two operators efficient and when are they not?

Note for advanced users and AI agents: To fully leverage spatial indexes (R-Tree) and ensure fast query execution, keep the following rules in mind:

  • ✅ Highly efficient (ORDER BY ... LIMIT): The <-> operator is purpose-built for KNN sorting in ORDER BY, reading pre-computed bounding box coordinates without decoding WKB blobs.
  • ✅ Highly efficient (Coarse envelope filtering with &&): The && operator is ideal in WHERE and JOIN ON clauses when bounding-box overlap is what you need. When exact topological intersection is required, you can call ST_Intersects directly because Gismatrix injects the R-Tree pre-filter automatically.
  • ❌ Inefficient (using <-> in a WHERE clause): Using <-> as a distance filter inside WHERE (e.g., WHERE p.geom <-> ST_MakePoint(...) < 100) will NOT use the spatial R-Tree index, forcing a full table scan (Sequential Scan).
    Solution: To filter features within a given radius in WHERE, always use ST_DWithin(p.geom, ST_MakePoint(...), 100), which automatically utilizes the R-Tree spatial index.
  • ❌ Not supported for <-> on CTEs and subqueries: The <-> operator reads pre-calculated physical BBOX columns from base tables. Temporary tables (defined via WITH CTE blocks) and dynamic subqueries do not possess these hidden physical columns, so applying <-> to them will result in a database error (no such column). Always apply operators directly to base physical tables.

Geometry Constructors

Function Description
ST_GeomFromText(wkt) Creates a geometry from its Well-Known Text (WKT) representation. PostGIS Documentation.
ST_GeomFromWKB(wkb) Creates and validates a geometry from its Well-Known Binary (WKB) representation. PostGIS Documentation. Useful when parsing raw binary spatial data imported from external databases or binary streams.
ST_MakeEnvelope(xmin, ymin, xmax, ymax) Creates a rectangular polygon from the given minimum and maximum coordinates. PostGIS Documentation.
ST_MakePoint(x, y, [z], [m]) Creates a 2D, 3D, or 4D point. PostGIS Documentation.

Geometry Accessors

Function Description
GeometryType(geom) Returns the type of the geometry as a string (e.g., 'POINT', 'LINESTRING'). PostGIS Documentation.
ST_AsText(geom) Returns the Well-Known Text (WKT) representation of the geometry. PostGIS Documentation.
ST_Dimension(geom) Returns the inherent topological dimension of the geometry (0 for Point, 1 for Line, 2 for Polygon). PostGIS Documentation.
ST_EndPoint(geom) Returns the last point of a LineString. Returns NULL if the geometry is not a LineString. PostGIS Documentation.
ST_GeometryN(geom, n) If the geometry is a collection (e.g., MULTIPOINT, MULTIPOLYGON), returns the Nth geometry (1-based). PostGIS Documentation.
ST_GeometryType(geom) Returns the type of the geometry as a PostGIS-formatted string (e.g., 'ST_Point', 'ST_LineString'). PostGIS Documentation.
ST_IsClosed(geom) Returns 1 (true) if the LineString's start and end points are identical. Always returns 1 for valid polygons. PostGIS Documentation.
ST_IsEmpty(geom) Returns 1 (true) if the geometry contains no coordinates (e.g., POINT EMPTY). Distinct from an SQL NULL value. PostGIS Documentation.
ST_IsRing(geom) Returns 1 (true) if the geometry is a closed and simple LineString (no self-intersections). PostGIS Documentation.
ST_NPoints(geom) Returns the total number of vertices in a geometry. PostGIS Documentation.
ST_NumGeometries(geom) If the geometry is a collection, returns the number of sub-geometries it contains. PostGIS Documentation.
ST_PointN(geom, n) Returns the Nth point in a single LineString (1-based index). Returns NULL if the geometry is not a LineString or the index is out of bounds. PostGIS Documentation. For example, ST_PointN(geom, 2) extracts the second vertex of a line, useful for computing the initial direction vector of a pipeline or road segment.
ST_SRID(geom) Returns the Spatial Reference Identifier (SRID) for the geometry. Note: Typically returns 0 in Gismatrix because standard raw WKB blobs store projection metadata at the layer level rather than inside individual geometry bytes. PostGIS Documentation.
ST_StartPoint(geom) Returns the first point of a LineString. Returns NULL if the geometry is not a LineString. PostGIS Documentation.
ST_X(point) Returns the X coordinate of a point. Returns NULL if not a point. PostGIS Documentation.
ST_XMax(geom) Returns the maximum X coordinate of a geometry's bounding box. PostGIS Documentation.
ST_XMin(geom) Returns the minimum X coordinate of a geometry's bounding box. PostGIS Documentation.
ST_Y(point) Returns the Y coordinate of a point. Returns NULL if not a point. PostGIS Documentation.
ST_YMax(geom) Returns the maximum Y coordinate of a geometry's bounding box. PostGIS Documentation.
ST_YMin(geom) Returns the minimum Y coordinate of a geometry's bounding box. PostGIS Documentation.
ST_Z(point) Returns the Z elevation coordinate of a point. Returns NULL if not a point. PostGIS Documentation.
ST_ZMax(geom) Scans all vertices within a geometry and returns the maximum Z coordinate value. PostGIS Documentation.
ST_ZMin(geom) Scans all vertices within a geometry and returns the minimum Z coordinate value. PostGIS Documentation.

Measurement Functions

Function Description
geomA <-> geomB The K-Nearest-Neighbor (KNN) distance operator. Returns the 2D Euclidean distance between the bounding boxes of two geometries. Used in the ORDER BY clause for ultra-fast nearest-neighbor sorting powered by physical BBOX columns. PostGIS Documentation.
ST_3DArea(geom) Returns the 3D surface area of a polygon or multipolygon, accounting for Z coordinates. PostGIS Documentation.
ST_3DLength(geom) Returns the 3D length of a line accounting for Z coordinates. PostGIS Documentation.
ST_Area(geom) Returns the 2D area of a polygon. Returns 0 for lines and points. PostGIS Documentation.
ST_BBoxDistance(minx, maxx, miny, maxy, target_geom) Calculates the shortest 2D Euclidean distance between a physically provided bounding box and a target geometry. High-speed internal function (backed by L2 caching) into which Gismatrix automatically translates the <-> operator so WKB geometries do not need to be decoded during full table scans.
ST_Distance(geomA, geomB) Returns the 2D minimum Cartesian distance between two geometries in coordinate system units. PostGIS Documentation.
ST_FrechetDistance(geomA, geomB) Measures curve similarity between two geometries using the discrete Fréchet distance algorithm, taking vertex order and direction into account. Ideal for matching GPS tracks against road networks. PostGIS Documentation.
ST_HausdorffDistance(geomA, geomB) Returns the discrete Hausdorff distance ("greatest of all shortest distances") between two geometries, useful for quantifying shape deviation between polygons or lines. PostGIS Documentation.
ST_Length(geom) Returns the length of a line. If the geometry has Z coordinates, it calculates the 3D length; otherwise, 2D. PostGIS Documentation.
ST_Length2D(geom) Always returns the 2D length of a line, even if Z coordinates are present. PostGIS Documentation.
ST_MemSize(geom) Returns the WKB byte size of a geometry. PostGIS Documentation. Useful for auditing datasets and finding unusually heavy geometries (e.g., WHERE ST_MemSize(geom) > 50000) that may benefit from ST_SimplifyPreserveTopology.

Spatial Predicates (returning TRUE/FALSE)

These functions test the spatial relationship between two geometries and return 1 (true) or 0 (false). When used in WHERE and JOIN ON clauses (except for ST_Disjoint, ST_Relate, and negated conditions), Gismatrix automatically activates R-Tree spatial index pre-filtering.

Function Description
geomA && geomB The Bounding Box Intersects operator. Returns 1 (true) if the bounding boxes (envelopes) of geometry A and geometry B overlap. Equivalent to ST_EnvelopeIntersects and automatically accelerated by the R-Tree spatial index. PostGIS Documentation.
ST_Contains(geomA, geomB) Returns 1 (true) if geometry A completely contains geometry B. PostGIS Documentation.
ST_CoveredBy(geomA, geomB) Returns 1 (true) if no point of geometry A lies outside geometry B. PostGIS Documentation.
ST_Covers(geomA, geomB) Returns 1 (true) if no point of geometry B lies outside geometry A. PostGIS Documentation.
ST_Crosses(geomA, geomB) Returns 1 (true) if the geometries have some, but not all, interior points in common. PostGIS Documentation.
ST_Disjoint(geomA, geomB) Returns 1 (true) if the geometries do not touch or intersect (share no points). PostGIS Documentation.
ST_DWithin(geomA, geomB, distance) Returns 1 (true) if the minimum distance between the geometries is less than or equal to distance. Automatically utilizes R-Tree expanded-envelope index filtering. PostGIS Documentation.
ST_EnvelopeIntersects(geomA, geomB) Fast O(1) axis-aligned bounding-box (AABB) overlap check bypassing vertex-level topology evaluation. Core internal function into which the && operator is automatically translated.
ST_Equals(geomA, geomB) Returns 1 (true) if the given geometries represent topologically identical shapes at the same location (ignoring vertex order and direction). PostGIS Documentation.
ST_Intersects(geomA, geomB) Returns 1 (true) if the geometries share at least one point. PostGIS Documentation.
ST_Overlaps(geomA, geomB) Returns 1 (true) if geometries of the same dimension partially overlap without either completely containing the other. PostGIS Documentation.
ST_Relate(geomA, geomB) Returns a 9-character DE-9IM matrix string describing the exact topological relationship between two geometries. PostGIS Documentation. Enables advanced users to test specialized boundary/interior relationships not covered by standard predicates.
ST_Touches(geomA, geomB) Returns 1 (true) if the geometries touch at their boundaries while their interiors do not intersect. PostGIS Documentation.
ST_Within(geomA, geomB) Returns 1 (true) if geometry A is completely within geometry B. PostGIS Documentation.

Geometry Processing Functions

Function Description
ST_Boundary(geom) Returns the combinatorial boundary of a geometry (e.g., polygon ring(s) or line endpoints). PostGIS Documentation.
ST_Buffer(geom, distance, [style|quadsegs|from_srid], [from_srid|to_srid], [to_srid]) Creates a buffer zone around a geometry at a specified distance. Gismatrix extends this function with native on-the-fly metric coordinate transformations. PostGIS Documentation. See detailed behavior below.
ST_Centroid(geom) Computes the geometric center (centroid) of a geometry. PostGIS Documentation.
ST_Collect(geom) An aggregate function returning a geometry collection from a set of rows without dissolving boundaries. PostGIS Documentation.
ST_Collect2(geomA, geomB) Scalar (binary) counterpart to ST_Collect that combines two input geometries into a GeometryCollection without dissolving boundaries. PostGIS Documentation.
ST_ConvexHull(geom) Computes the smallest convex geometry that encloses all vertices in the input. PostGIS Documentation.
ST_DelaunayTriangles(geom, [tolerance], [flags]) Generates a Delaunay triangulation around the vertices of the given geometry as a MultiPolygon of triangular faces. Commonly used in terrain elevation modeling (TIN). PostGIS Documentation.
ST_Difference(geomA, geomB) Returns a geometry representing the part of geometry A that does not intersect with geometry B. PostGIS Documentation.
ST_Envelope(geom) Returns the rectangular bounding-box polygon of a geometry. PostGIS Documentation.
ST_Extent(geom) An aggregate function that returns the combined bounding box (as a POLYGON) encompassing all geometries in a row set. PostGIS Documentation.
ST_ExteriorRing(geom) Returns a LineString representing the exterior ring of a POLYGON geometry. Returns NULL if the geometry is not a polygon. PostGIS Documentation.
ST_InteriorRingN(geom, n) Returns the Nth interior ring (hole) of a polygon geometry as a LineString (1-based index). Returns NULL if the geometry is not a polygon or the index is out of bounds. PostGIS Documentation.
ST_Intersection(geomA, geomB) Returns a geometry representing the shared portion of both geometries. PostGIS Documentation.
ST_LargestEmptyCircle(geom, [boundary], [tolerance]) Finds the largest empty circle that does not intersect any obstacles and lies within an optional boundary. In Gismatrix, returns a JSON string containing the center, nearest point, and radius (e.g., {"center": "POINT(x y)", "nearest": "POINT(x y)", "radius": 0.0}). PostGIS Documentation.
ST_LineInterpolatePoint(geom, fraction) Returns a point interpolated along a line at a fractional distance (between 0.0 and 1.0) of its total length. PostGIS Documentation. Useful for midpoint placement (0.5) or locating pipeline faults.
ST_LineLocatePoint(geom, point) Returns a float between 0.0 and 1.0 representing the location of the closest point on a LineString to the given Point. PostGIS Documentation. Essential for linear referencing along roads and utility corridors.
ST_LineMerge(geom) Merges connected line segments from a collection (e.g., MultiLineString) into continuous LineString(s). PostGIS Documentation.
ST_LongestLine(geomA, geomB) Returns the 2D longest line connecting two geometries (evaluated via their convex hull vertices). PostGIS Documentation.
ST_MinimumBoundingCircle(geom) Returns the smallest circle polygon that fully encloses a geometry. PostGIS Documentation.
ST_MinimumBoundingRadius(geom) Computes the center point and radius of the smallest enclosing circle. In Gismatrix, returns a JSON string containing the WKT center and radius (e.g., {"center": "POINT(x y)", "radius": 0.0}). PostGIS Documentation.
ST_NumInteriorRings(geom) Returns the number of interior rings (holes) of a polygon geometry. Returns NULL if the geometry is not a polygon. PostGIS Documentation.
ST_OffsetCurve(line_geom, distance, [style]) Returns an offset line at a given distance and side from an input line (positive to the left, negative to the right relative to line direction). Very useful for parallel road lanes and utility corridors. PostGIS Documentation.
ST_PointOnSurface(geom) Returns a point guaranteed to lie on the interior surface of the geometry (a safe alternative to ST_Centroid for crescent or U-shaped polygons). PostGIS Documentation.
ST_Polygonize(geom) Constructs a collection of polygons formed from the closed linework of intersecting lines (such as imported CAD linework or parcel boundaries). PostGIS Documentation.
ST_Reverse(geom) Returns a geometry with the order of its vertices reversed. PostGIS Documentation.
ST_SetSRID(geom, srid) Compatibility wrapper for imported server SQL queries; returns the unmodified geometry because Gismatrix manages coordinate projections dynamically per layer. PostGIS Documentation.
ST_ShortestLine(geomA, geomB) Returns the 2D shortest line connecting two geometries (the visual counterpart to ST_Distance), ideal for generating utility connection lines. PostGIS Documentation.
ST_Simplify(geom, tolerance) Simplifies a geometry using the fast Douglas-Peucker algorithm without checking topological validity at high tolerances. PostGIS Documentation.
ST_SimplifyPreserveTopology(geom, tolerance) Simplifies a geometry while strictly preserving topological validity (preventing self-intersections and collapsed polygons). Recommended for field analytics. PostGIS Documentation.
ST_Subdivide(geom, [max_vertices]) Slices large, vertex-heavy geometries into smaller parts where no piece exceeds max_vertices (default 256), dramatically accelerating R-Tree indexing and subsequent spatial predicates. PostGIS Documentation.
ST_SymDifference(geomA, geomB) Returns a geometry representing the portions of geometries A and B that do not intersect. PostGIS Documentation.
ST_Transform(geom, from_srid, to_srid) Transforms geometry coordinates from a source CRS (e.g., 'EPSG:4326') to a target CRS (e.g., 'EPSG:3794'). PostGIS Documentation.
ST_UnaryUnion(geom) Dissolves overlapping components within a single MultiPolygon or GeometryCollection without row-level aggregation overhead. PostGIS Documentation.
ST_Union(geom) An aggregate function that merges all geometries in a group of rows into a single dissolved (multi)geometry. PostGIS Documentation.
ST_Union2(geomA, geomB) Scalar (binary) counterpart to ST_Union that returns the topological union of two input geometries within a single row. PostGIS Documentation.
ST_VoronoiPolygons(geom, [tolerance], [extend_to]) Generates a 2D Voronoi diagram (polygons) around the vertices of the supplied geometry, useful for computing service and catchment areas. PostGIS Documentation.

Geometry Validation and Repair

Function Description
ST_IsSimple(geom) Returns 1 (true) if the geometry has no anomalous geometric points such as self-intersections. PostGIS Documentation.
ST_IsValid(geom, [flags]) Returns 1 (true) if the geometry is topologically valid according to OGC rules. PostGIS Documentation.
ST_IsValidDetail(geom, [flags]) Returns a JSON string with validity status, error reason, and error coordinates if invalid. PostGIS Documentation.
ST_IsValidReason(geom, [flags]) Returns a text description of why a geometry is invalid, or "Valid Geometry" if valid. PostGIS Documentation.
ST_MakeValid(geom, [params]) Repairs an invalid geometry into a topologically valid shape while preserving original vertices. PostGIS Documentation.
ST_SuppressErrors(flag) Gismatrix helper function to enable (1 or 'true') or disable (0 or 'false') GEOS topology exception suppression. When enabled, malformed geometries return NULL instead of aborting an entire bulk SQL query.

Custom SQL Queries (JSON Support)

Full support for modern JSON extraction operators (-> and ->>) is available within custom SQL queries. The internal SQL parser natively processes these operators, allowing you to extract specific properties directly from JSON strings returned by advanced spatial functions.

For example, since ST_MinimumBoundingRadius returns a JSON object containing both the center point and radius, you can extract just the numeric radius value directly:

SELECT ST_MinimumBoundingRadius(geom)->>'$.radius' AS radius FROM samples;

For more information, refer to the official SQLite JSON reference.

ST_Buffer Deep Dive (Gismatrix Extensions)

In Gismatrix, ST_Buffer is enhanced with on-the-fly metric transformations. This allows you to compute buffers in metric units (meters) directly on layers stored in geographic coordinates (degrees, such as EPSG:4326) without manually re-projecting geometries beforehand.

When SRID arguments are supplied, the function automatically transforms the geometry to a projected metric system, calculates the accurate buffer footprint in meters, and projects the resulting polygon back into your layer's coordinate reference system.

Supported Signatures

  • ST_Buffer(geom, distance)
  • ST_Buffer(geom, distance, quadsegs)
  • ST_Buffer(geom, distance, style)
  • ST_Buffer(geom, distance, from_srid) — Defaults to_srid to 'EPSG:3857'
  • ST_Buffer(geom, distance, style|quadsegs, from_srid)
  • ST_Buffer(geom, distance, from_srid, to_srid)
  • ST_Buffer(geom, distance, style|quadsegs, from_srid, to_srid)

Parameter Reference

  • quadsegs (Integer): Number of quadrant segments used to approximate a quarter-circle. Defaults to 8.
  • style (Text): A space-separated key=value configuration string customizing buffer generation (case-insensitive):
    • quad_segs=N | quadsegs=N | quadseg=N | quadrantsegments=N — Adjusts circle arc vertex density.
    • endcap=round|flat|square — Controls line endcap style (point geometries automatically enforce round).
    • join=round|mitre|miter|bevel — Controls corner join style.
    • mitre_limit=X | miter_limit=X — Ratio limit for sharp mitred corners (defaults to 5.0).
    • side=left|right|both — Generates a single-sided or two-sided buffer along linework (e.g., only along the right or left side of a road).
  • from_srid (Text): Coordinate system of the input geometry (e.g., 'EPSG:4326'; numeric strings without a prefix such as '3794' are automatically normalized to 'EPSG:3794').
  • to_srid (Text): Target metric projected coordinate system used to measure the buffer distance (defaults to 'EPSG:3857' when omitted alongside an explicit from_srid).
Performance Note: If from_srid and to_srid resolve to the same CRS (case-insensitively), coordinate re-projection is automatically skipped for maximum execution speed.