
- Create-new-column-with-other-SRID
- 10-31-2008
![]() Re: Create new column with other SRID
| Paul Cooper | 11-01-2008 |
If you were Registered and logged in, you could reply and use other advanced thread options
Hello i have a little problem creating a new column for my table and
inserting there new data.
I have a talbe:
CREATE TABLE "axes" (
gid serial PRIMARY KEY,
"name" varchar(100));
SELECT AddGeometryColumn('','axes','the_geom','27492','LINESTRING',2);
and this table if full of data
now i want to add new column with another SRID like wgs84 srid = 4326
SELECT
AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
and now i need to create a query that reads each row from column
the_geom, converts it by Transform(the_geom, 4326) and put into a new
kolumn the_geom_wgs84 in the same row.
Do You have an idea if it is possible?
I tried to do something like that:
SELECT
AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
INSERT INTO "axes" (the_geom_wgs84) VALUES (select
AsText(Transform(the_geom,4326)) from axes)
inserting there new data.
I have a talbe:
CREATE TABLE "axes" (
gid serial PRIMARY KEY,
"name" varchar(100));
SELECT AddGeometryColumn('','axes','the_geom','27492','LINESTRING',2);
and this table if full of data
now i want to add new column with another SRID like wgs84 srid = 4326
SELECT
AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
and now i need to create a query that reads each row from column
the_geom, converts it by Transform(the_geom, 4326) and put into a new
kolumn the_geom_wgs84 in the same row.
Do You have an idea if it is possible?
I tried to do something like that:
SELECT
AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
INSERT INTO "axes" (the_geom_wgs84) VALUES (select
AsText(Transform(the_geom,4326)) from axes)
On Fri, 31 Oct 2008 08:20:40 -0700 (PDT), lisek
What's wrong with
AddGeometryColumn('','axes',the_geom_wgs84','4326','LINESTRING',2);
UPDATE axes set the_geom_wgs84 = Transform(the_geom,4326) ;
Two points:
1) I don't know why you wanted to use an INSERT statment; probably
temporary SQL failure!
2) You don't need the "AsText" function; why add a forward and
backward transform you don't need?
Paul
What's wrong with
AddGeometryColumn('','axes',the_geom_wgs84','4326','LINESTRING',2);
UPDATE axes set the_geom_wgs84 = Transform(the_geom,4326) ;
Two points:
1) I don't know why you wanted to use an INSERT statment; probably
temporary SQL failure!
2) You don't need the "AsText" function; why add a forward and
backward transform you don't need?
Paul
- Can I use the GPS reciever from MS Streets and Trips 2008 with other GPS software?
- Global Positioning System
- 2008-08-04
- Trouble with map update? -- RESOLVED
- Garmin GPS
- 2011-11-08
- Help create better charts
- Satellite Navigation
- 2010-06-29
- Power Questions with tomtom..
- Tomtom GPS
- 2010-06-14
- Download failures with new Tomtom
- Tomtom GPS
- 2010-05-15
- Adding places with no address
- Garmin GPS
- 2010-03-31
- Who's happy with their 7x5T?
- Garmin GPS
- 2010-01-02



>inserting there new data.
>I have a talbe:
>CREATE TABLE "axes" (
>gid serial PRIMARY KEY,
>"name" varchar(100));
>SELECT AddGeometryColumn('','axes','the_geom','27492','LINESTRING',2);
>and this table if full of data
>now i want to add new column with another SRID like wgs84 srid = 4326
>SELECT
>AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
>and now i need to create a query that reads each row from column
>the_geom, converts it by Transform(the_geom, 4326) and put into a new
>kolumn the_geom_wgs84 in the same row.
>Do You have an idea if it is possible?
>I tried to do something like that:
>SELECT
>AddGeometryColumn('','axes','the_geom_wgs84','4326','LINESTRING',2);
>INSERT INTO "axes" (the_geom_wgs84) VALUES (select
>AsText(Transform(the_geom,4326)) from axes)