id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc 3687,"Add casts for (geometry, geography) -> (json, jsonb)",dbaston,dbaston,"Any reason not to do this? It seems as simple as {{{ CREATE FUNCTION geometry_json_cast (geometry) RETURNS json AS $$ SELECT ST_AsGeoJSON($1)::json $$ LANGUAGE SQL; CREATE CAST (geometry AS json) WITH FUNCTION geometry_json_cast(geometry); }}} Built-in functions like {{{row_to_json}}} will automatically pick up this cast and use it when converting geometries to JSON values.",enhancement,closed,medium,PostGIS 3.0.0,postgis,master,fixed,,