There's no way right now. You could do a little work on your client side, and pull both the WKT and the SRID, then concatenate them into an output string with 'SRID=9999;...' just like your input. In the longer run, we could add EWKT and EWKB outputs. :/

P

On 31-Mar-09, at 6:07 PM, LiN YongHeng wrote:

hello Paul Ramsey and anyone,
The function GEOSGeomToWKB_buf() doesn't include the SRID. if I want to output encodings that embed the srid, how
can I do?

2009/3/31 Paul Ramsey <[email protected]>
To clarify: your first representation is nonstandard:

 SRID=5001;POINT(44 31)

GEOS will accept it, but it won't emit it. If you print out

 GEOSGeomToWKT(g1)

you will see the standard representation

 POINT(44 31)

which you'll note doesn't include the SRID.

It doesn't actually look like we support output encodings that embed
the srid... odd.

P

On Tue, Mar 31, 2009 at 8:42 AM, strk <[email protected]> wrote:
> On Tue, Mar 31, 2009 at 11:24:50PM +0800, LiN YongHeng wrote:
>> hello everyone, Please look these code:
>> GEOSGeom g1, g2;
>> g1 = GEOSGeomFromWKT("SRID=5001;POINT(44 31)");
>> g1srid = GEOSGetSRID(g1);
>> g2 = GEOSGeomFromWKT(GEOSGeomToWKT(g1));
>> g2srid= GEOSGetSRID(g2);
>> g2srid not have the same value with g1srid, which g1srid value is 5001 and >> g2srid is -1. My GEOS version is "3.1.0". I don't know why? Can anyone give
>> me answer
>
> The WKT standard doesn't include a SRID specification,
> so GEOSGeomToWKT won't get it. Still GEOSGeomFromWKT
> accepts that.
>
> --strk;
>
> Free GIS & Flash consultant/developer () ASCII Ribbon Campaign
>  http://foo.keybit.net/~strk/services.html  /\  Keep it simple!
> _______________________________________________
> geos-devel mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>


_______________________________________________
geos-devel mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to