[GRASS-user] SQL Queries

Ok, looking for a SQL guru out there…

Want to see if something is even possible or not using GRASS (using 5.4)

Here is the situation… I have 2 files, once containing xyz pts, and another containing polygons. I am wondering if there is a way to use a sql query to find the average elevation for a given polygon?

I am trying right now to use MapInfo to do this query, but it doesn’t like the amount of points I am query (> 1,500,000) and knowing that GRASS is much better at processing and dealing with larger files, wondered if a query like this is possible…

Any ideas??

Thanks in advance!

Cheers!

Kevin Slover

Coastal / GIS Specialist

2872 Woodcock Blvd Suite 230

Atlanta GA 30341

(P) 678-530-0022

(F) 678-530-0044

Slover, Kevin wrote:

Ok, looking for a SQL guru out there…

Want to see if something is even possible or not using GRASS (using 5.4)

Here is the situation… I have 2 files, once containing xyz pts, and another containing polygons. I am wondering if there is a way to use a sql query to find the average elevation for a given polygon?

I am trying right now to use MapInfo to do this query, but it doesn’t like the amount of points I am query (> 1,500,000) and knowing that GRASS is much better at processing and dealing with larger files, wondered if a query like this is possible..

Any ideas??

If you really want to do this in SQL you could use PostGIS. I have done similar operations on tables with between a few hundred and >200,000,000 records, and have had no real problems. I have found that a monolithic spatial join as you require can be slow, but it can usually be broken down into separate queries, each dealing with a subset of the data, running sequentially via a script, and the reponse is orders of magnitude faster.

If this option is of interest, let me know & I can go through how I have done 9& optimised) such things...

Cheers

Brent Wood

Kevin,

On Thu, Jul 27, 2006 at 05:09:18PM -0400, Slover, Kevin wrote:

   Ok, looking for a SQL guru out there...

   Want to see if something is even possible or not using GRASS (using 5.4)

   Here is the situation... I have 2 files, once containing xyz pts, and
   another containing polygons. I am wondering if there is a way to use a
   sql query to find the average elevation for a given polygon?

In GRASS 5 I don't know, but in GRASS 6 you can simply use
v.stats.rast which is giving you these results in a single step
(without learning SQL :slight_smile:

http://grass.itc.it/grass61/manuals/html61_user/v.rast.stats.html

   I am trying right now to use MapInfo to do this query, but it doesn't like
   the amount of points I am query (> 1,500,000) and knowing that GRASS is
   much better at processing and dealing with larger files, wondered if a
   query like this is possible..

I think that GRASS should work with 3 million points and more.

Markus