[postgis-users] Questions about using SRID not -1
Ben Madin
lists at remoteinformation.com.au
Tue Jan 19 01:44:39 PST 2010
On 19/01/2010, at 1:23 , Oscar Zamudio wrote:
> Hi everybody.
> I had no success with any of the recipes received here.
Did you try setting the srid when you imported the data ?
> Could it be that a table with data loaded without SRID explicit value has no chance of being updated later to the right one?
> Regards,
> Oscar
>
>
> On Sun, Jan 17, 2010 at 1:08 PM, Oscar Zamudio <cmntlk at gmail.com> wrote:
> Ben,
> I tried your intruction:
>
> UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);
>
> But I got:
>
> ERROR: Operation on two GEOMETRIES with different SRIDs
>
> Regards,
> Oscar
>
> On Sat, Jan 16, 2010 at 10:48 PM, Ben Madin <lists at remoteinformation.com.au> wrote:
> Oscar,
>
> you have a couple of options as I see it. In Postgres you could just update the geometries first.
>
> > UPDATE mytable SET the_geom = ST_SetSRID(the_geom,4326);
>
>
> And for next time, assuming your data originally had some sort of coordinate system (and it must have if it was spatial data), you can / should use the -s flag in shp2pgsql to provide 'SRID awareness'
>
> In your case, I would suggest -s 4326.
>
> ie (using -d to drop and replace existing table
>
> $ shp2pgsql -s 4326 -d myshapefile myoldtablename | psql mydatabase
More information about the postgis-users
mailing list