[postgis-users] Calculating Attributes
Aurora Geomatics
aurorageomatics at gmail.com
Fri Apr 3 11:47:29 PDT 2009
Ah the heart of all knowledge... Philosophy!
On 3-Apr-09, at 10:24 AM, Paul Ramsey wrote:
> Philosophical point:
>
> Creating a column and filling it with a property of GEOMETRY like
> ST_Area() or ST_Length() is something which makes sense in a legacy
> GIS like Arc* or GRASS, where attributes are handled separately from
> spatial. In a spatial database, where the GEOMETRY is co-equal to the
> other columns, there is not much point, unless you are doing it for
> export purposes (filling in a column before exporting to shapefile for
> consumption by a legacy GIS).
>
> What does having AREA in a column gain you? Now you can do math and
> tests against it? Well, in database land, you can do that already,
> just do you math and tests against the ST_Area() function directly.
>
> Paul
Hmmm point taken, and I understand the logic behind the argument is
absolutely sound, why fill a database with endless amounts of
attributes that are simply the results of calculations which in theory
can me quickly and dynamically calculated to it's present values.
Hydrological processes, and networking are a good example of this
where temporal changes occur to values.
However, there are instances where information is static within the
realm of a human timescape. In these instances where is the worth in
constantly calculating the value of 10 x 10 when we can easily store
it to memory as 100 and do a simple read?
Legacy or not, certain values are well represented as a static
attribute while others sensitive to dynamics are best suited as you
mention to dynamic testing.
In my case I simply wish to:
Receive information from gov data (usually in shapefile format)
Add to postgreSQL/postGIS database
Manipulate for end user visualization and reference
Export to KML for easy desktop viewing and web viewing for non-
technical users.
=====
I think I am starting to get the hang of pgAdmin, I'm busy
reprogramming my brain for these new tools.
Mars
>> Hello Aurora,
>>
>> In ArcGIS it's all different. In PostGIS you can use simple/complex
>> SQL
>> queries to "calculate values" in a similar fashion of arcgis.
>>
>> The simplest of them all would be, in your case:
>>
>> ALTER TABLE table1 ADD COLUMN area_column double precision;
>> UPDATE table1 SET area_column = ST_AREA(the_geom);
>>
>> You can in that SQL query divide, multiply, and do whatever you
>> want with
>> that result that will be written to the column area_column.
>>
>> I hope that helps
>>
>> George
>>
>> On Fri, Apr 3, 2009 at 12:55 PM, Aurora Geomatics
>> <aurorageomatics at gmail.com> wrote:
>>>
>>> Hello PostGIS users,
>>>
>>> I have just installed William Kyng's PostgeSQ/PostGIS packages for
>>> Mac OS
>>> X.5
>>>
>>> I have been playing with pgAdmin and QGIS with importing
>>> shapefiles into
>>> PostGIS. Works dandy.
>>>
>>> Now I am wondering how to solve Attribute Calculations.
>>>
>>> Years of using ArcGIS and GRASS it is pretty straightforward on
>>> those
>>> apps, and am stumped with PostGIS Attribute calculations..
>>>
>>> For example, using a polygon feature;
>>>
>>> Creating a new column, say AREA and filling with a calculation
>>> that is
>>> Hectares.
>>>
>>> Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090403/df0d529e/attachment.html>
More information about the postgis-users
mailing list