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
