[postgis-devel] [PostGIS] #1833: full record json output in 9.2 with valid geojson output

PostGIS trac at osgeo.org
Tue May 22 05:00:52 PDT 2012


#1833: full record json output in 9.2 with valid geojson output
-------------------------+--------------------------------------------------
 Reporter:  robe         |       Owner:  pramsey      
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.0
Component:  postgis      |     Version:  2.0.x        
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by robe):

 Seems it's not as trivial as that:  See my whining:
 http://www.postgresonline.com/journal/archives/253-PostgreSQL-9.2-native-
 json-type-support.html

 It's still a nice feature and has a fairly easy work around (which allows
 you to control the rounding). I have to verify it produces that right
 output, but looks right to me.

 {{{

 SELECT array_to_json(array_agg(t),true) As my_places
 FROM (SELECT gid, title
    , ST_AsGeoJson(1, geog, 15, 0)::json As geog
 FROM test) As t;

 [{"gid":1,"title":"My neck of the
 woods","geog":{"type":"Point","coordinates":[-71.057811000000001,42.358274000000002]}},
  {"gid":2,"title":"some other neck of the
 woods","geog":{"type":"Point","coordinates":[42.358274000000002,-71.057811000000001]}}]
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1833#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-devel mailing list