[PostGIS] #5596: ST_ASGeoJSONRow: cannot set id directly on feature

PostGIS trac at osgeo.org
Mon Oct 30 12:09:37 PDT 2023


#5596: ST_ASGeoJSONRow: cannot set id directly on feature
--------------------------+---------------------------
  Reporter:  jtojnar      |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS 3.5.0
 Component:  postgis      |    Version:  3.4.x
Resolution:               |   Keywords:  json
--------------------------+---------------------------
Description changed by jtojnar:

Old description:

> As per [https://www.rfc-editor.org/rfc/rfc7946#section-3.2 GeoJSON RFC],
> the id should go directly to the feature object rather than to
> properties:
>
>     If a Feature has a commonly used identifier, that identifier SHOULD
> be included as a member of the Feature object with the name "id"
>
> But `ST_ASGeoJSONRow` does not support this so one needs to tediously
> build JSON object manually with `jsonb_build_object` as
> [https://postgis.net/docs/manual-3.4/ST_AsGeoJSON.html described in the
> manual).
>
> Ideally, there would be a new argument that would allow specifying which
> column to promote to id.

New description:

 As per [https://www.rfc-editor.org/rfc/rfc7946#section-3.2 GeoJSON RFC],
 the id should go directly to the feature object rather than to properties:

     If a Feature has a commonly used identifier, that identifier SHOULD be
 included as a member of the Feature object with the name "id"

 But `ST_ASGeoJSONRow` does not support this so one needs to tediously
 build JSON object manually with `jsonb_build_object` as
 [https://postgis.net/docs/manual-3.4/ST_AsGeoJSON.html described in the
 manual].

 Ideally, there would be a new argument that would allow specifying which
 column to promote to id.

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5596#comment:1>
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