[postgis-users] spatial indices on two geometry or rast columns

James David Smith james.david.smith at gmail.com
Thu Aug 11 13:21:11 PDT 2011


Hey Vishal,

I guess really you should just re-project on the fly so that you don't
have the same data in two columns, but like you I have created another
column in the project I'm working on at the moment for convenience. I
did it like this:

SELECT AddGeometryColumn ('wards', 'geom_utm','32643','POINT','2');

UPDATE wards
set "geom_utm" = (SELECT ST_transform("geom", 32643));

I'm not sure about the GIST question or the raster thing I'm afraid.
Hope this helps.

Cheers

James



On 11 August 2011 20:16, Vishal Mehta <vishal.mehta at sei-us.org> wrote:
> Hi all,
>
>
>
> I have some vector layers in  a postgis database in EPSG 4326. Spatial
> indices have been built using GIST on the same (EPSG 4326) geometries on a
> geometry column called geom.
>
>
>
> I’d like to transform these layers to UTM (EPSG 32643). I was thinking of
> creating a new geometry column for each table and
>
> ALTER TABLE wards ADD column geom_utm geometry;
>
> UPDATE wards SET geom_utm = ST_TRANSFORM(geom,32643);
>
>
>
> Should I, (and can I) create another gist index on the transformed geometry?
>
>
>
> The same qn applies on a raster table I have called srtm_table – should I
> and can I add
>
> -          a new ‘rast’ column called rast_utm with transformed SRID in
> similar fashion above, and then add a gist index on the rast_utm column?
>
>
>
> CREATE INDEX “srtm_table_rast_gist_idx” ON “public”.”srtm_table” USING GIST
> (st_convexhull(rast_utm));
>
>
>
> Thanks,
>
> Vishal
>
>
>
> Vishal K. Mehta, Ph.D.
>
> Staff Scientist,
>
> Stockholm Environment Institute-US
>
> 400 F St, Davis, CA 95616
>
> http://sei-us.org/
>
>
>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>



More information about the postgis-users mailing list