Mac, typo correction to Paul's note. select st_astext(st_transform(the_geom,4326)) As wktgeom4326 from yourtable limit 1;
I should add it depends how you plan to use this. The ST_AsText is mostly for viewing the text representation or to feed to systems that only accept WKT. So normally you would just do SELECT st_transform(the_geom,4326) As the_geom from yourtable; Varies depending on which front end you are feeding to. You may also want to consider not using 4326 and keeping it in 2269 if you are going to be using this for measurement. WGS84 is not a useful transform measurement (at least not yet anyway). Hope that doesn't confuse you more, Regina -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Paul Ramsey Sent: Friday, September 11, 2009 4:01 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Working with multilinestring data - figuringout coordinates Given those coordinates and your proj4 definition, it looks like the data is in SRS 2269, which this test seems to confirm: geog=# select st_astext(st_transform(st_geomfromtext('LINESTRING(7509930.12510756 776667.642310877,7509924.12502675 776694.329928875)',2269),4326)); st_astext ---------------------------------------------------------------------------- ------- LINESTRING(-123.212720672425 45.7650955901238,-123.212747680646 45.7651681862228) (1 row) If your data does not have an SRID already set, set it to 2269, thusly: update yourtable set yourgeomcolumn = st_setsrid(yourgeomcolumn,2269); Now you can pull out other projections (like 4326 (lonlat)) using the st_transform function. select st_astext(st_transform(the_geom)) from yourtable limit 1; Paul On Fri, Sep 11, 2009 at 12:34 PM, Mac Martine <[email protected]> wrote: > Hello- > I'm a total newbie with this stuff so bare with me. I have a shape > files that I got into Postgres. Now I'm pulling it out and it's giving > me MULTILINESTRINGS with numbers that look like: > 7509930.12510756 776667.642310877,7509924.12502675 776694.329928875 > > Now, I get the feeling those are correct, but that I need to convert > them to Longitude and Latitude, and that's where I'm stuck. > > I'm pretty sure it's SRID 4326 but I can't find any info on doing > conversions from here. Maybe I'm wrong. I also found this info which > may be of help. > > +proj=lcc +lat_1=44.33333333333334 +lat_2=46 +lat_0=43.66666666666666 > +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +to_meter=0.3048 > +no_defs > > I'd really appreciate some guidance. I've googled all kinds of things > and am not figuring it out. > Thanks! > _______________________________________________ > 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 _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
