[postgis-tickets] [PostGIS] #3687: Add casts for (geometry, geography) -> (json, jsonb)

PostGIS trac at osgeo.org
Wed Aug 19 12:55:18 PDT 2020


#3687: Add casts for (geometry, geography) -> (json, jsonb)
--------------------------+---------------------------
  Reporter:  dbaston      |      Owner:  dbaston
      Type:  enhancement  |     Status:  closed
  Priority:  medium       |  Milestone:  PostGIS 3.0.0
 Component:  postgis      |    Version:  master
Resolution:  fixed        |   Keywords:
--------------------------+---------------------------

Comment (by jawj):

 Is there a reason not also to add the reverse casts?

 I've found the following manual additions helpful:


 {{{
 CREATE CAST (json AS geometry) WITH FUNCTION ST_GeomFromGeoJSON(json) AS
 ASSIGNMENT;
 CREATE CAST (jsonb AS geometry) WITH FUNCTION ST_GeomFromGeoJSON(jsonb) AS
 ASSIGNMENT;
 }}}

 So that I can insert JSON values back in to a table.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3687#comment:9>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list