Search Shortcut cmd + k | ctrl + k
eviltransform

WGS84, GCJ02 and BD09 coordinate transformations and exact Jenks natural breaks

Maintainer(s): DeoLeung

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL eviltransform FROM community;
LOAD eviltransform;

Example

INSTALL spatial;
LOAD spatial;
LOAD eviltransform;
SELECT ST_AsText(ST_EvilTransform(ST_Point(120, 30), 'WGS84', 'GCJ02'));
SELECT ST_JenksBins([1, 2, 3, 10, 11, 12], 2);

About eviltransform

Port of pg_eviltransform to DuckDB. Adds WGS84 / GCJ02 / BD09 transformations for points, lines, polygons, multi-geometries and nested collections. Z/M ordinates are preserved by the custom coordinate formulas. Standard projections, including geographic CGCS2000 (EPSG:4490), delegate to the spatial extension.

Install and load spatial before loading eviltransform. The explicit three-argument interface is ST_EvilTransform(geometry, from_crs, to_crs); coordinates use longitude/easting as X and latitude/northing as Y. Custom CRS metadata is not attached to the output. The original approximate GCJ02 inverse and rectangular China guard are retained.

ST_JenksBins(values, breaks[, invert]) computes exact weighted Jenks natural breaks from a list. ST_JenksBinsAgg(value, breaks[, invert]) is the streaming aggregate and supports parallel combine.

Uses the stable C extension ABI v1.2.0. Loading creates/replaces the ST_EvilTransform macro in the database's main schema, so initialization requires a writable database. WebAssembly is excluded from this release. See the README for aliases, NULL handling, accuracy and installation details.

Added Functions

This extension does not add any functions.

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

This extension does not add any settings.