[postgis-users] Problem With Geometries and a View

Leonardo Mateo leonardomateo at gmail.com
Wed Jan 31 05:00:17 PST 2007


On 1/30/07, Obe, Regina <robe.dnd at cityofboston.gov> wrote:
> As noted already by others it should be
> SELECT extent(the_geom) FROM geom
>
> and your view should be
> [CODE]
> CREATE VIEW geom AS
>         SELECT ... GeomFromText('POINT(' || datax.value || ' ' ||
> datay.value || ')') as the_geom
>
> [CODE]
> -----
> an additional comment.  Is there a reason you are calculating the
> geometry in the view instead of just storing it in the record table e.g.
> as part of your import or with a trigger.
Yes, because I'm a newbie in GIS ;). No, really, I've came to think
why would I store data which I can generate from other fields that I
already have stored?

  If you have a large table,
> doing it the way your are doing it will be very slow because you will
> not be able to take advantage of indexed geometries.
You're totally right. I've realized later.

I'd like to thank to all for the answers given, they where very useful.
And sorry for such a dumb question, I'm really a newbie in this.

Thanx a lot again.
Cheers.

-- 
Leonardo Mateo.
There's no place like ~



More information about the postgis-users mailing list