[postgis-users] Problem With Geometries and a View

Gregory S. Williamson gsw at globexplorer.com
Wed Jan 31 06:18:44 PST 2007


No such thing as a dumb question [dumb answers maybe, but they are *very* rare on this list] ... 

In general I have found it useful to pre-process everything that I can, even to the point of some convoluted scripting, to reduce runtime overhead. Sometimes storing the data in advance can make a significant difference in speed ... my motto tends towards "disk space is very cheap, and off-line processing is almost as cheap." That said, the "\timing" (in the psql interface) and "explain analyze" functions can be very useful in diagnosing some issues. Such as what indexes are useful and the like.

And don't be shy with questions to this list -- check the archives first if you can, since there's a wealth of material there, if you know what to look for. But there's a wealth of experience you can tap into here.

Greg Williamson
DBA
GlobeXplorer LLC, a DigitalGlobe company

Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

(My corporate masters made me say this.)


-----Original Message-----
From:	postgis-users-bounces at postgis.refractions.net on behalf of Leonardo Mateo
Sent:	Wed 1/31/2007 5:00 AM
To:	PostGIS Users Discussion
Cc:	
Subject:	Re: [postgis-users] Problem With Geometries and a View

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 ~
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


-------------------------------------------------------
Click link below if it is SPAM gsw at globexplorer.com
"https://mailscanner.globexplorer.com/dspam/dspam.cgi?signatureID=45c090f632851465134470&user=gsw@globexplorer.com&retrain=spam&template=history&history_page=1"
!DSPAM:45c090f632851465134470!
-------------------------------------------------------








More information about the postgis-users mailing list