That depends entirely on what you're planning to do with them once you get them. You'll probably want to serialize them into a known form so you can use them on the client side. ST_AsText() is one, very heavy, option. Mapserver, to take an example, uses encode(ST_AsBinary(ST_Force2D(geom)), 'hex'), so what goes over the wire is hex strings, but those are easy to turn into binary arrays, in WKB format, suitable for reading by a number of C++ libraries (like OGR or GEOG or etc).
Best, P. On Mon, Nov 23, 2009 at 1:19 PM, Pedro Doria Meunier <[email protected]> wrote: > Hi All, > > First off sorry for cross-posting. I'm hoping for a bigger audience... :] > > As for my question: > > How does one deal with Postgis geom fields in C++ ? > Google hasn't offered much help so far. > > I know I can make a "SELECT astext(my_geom) FROM my_table" and after parsing > the resulting text. > This seems a bit awkward and time-consuming... > > Is there a better way to deal with it? > > Already thankful for any ideas, > BR, > Pedro. > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
