[postgis-users] Core dumps

2011-02-03 Thread Peter Hopfgartner
We do have code dumps enabled on our developement servers and, from time to 
time, some PostgreSQL/PostGIS process dumps core.
Could some useful feedback be provided to the developers from these dumps? Is 
the back trace enough, like the following:

Program terminated with signal 11, Segmentation fault.
#0  0x0035eee79c00 in strncat () from /lib64/libc.so.6
(gdb) bt
#0  0x0035eee79c00 in strncat () from /lib64/libc.so.6
#1  0x2b9176d04282 in lwmessage_truncate ()
   from /usr/lib64/pgsql/postgis-1.5.so
#2  0x2b9176cc95a1 in pg_parser_errhint ()
   from /usr/lib64/pgsql/postgis-1.5.so
#3  0x2b9176ccf2eb in LWGEOM_in () from /usr/lib64/pgsql/postgis-1.5.so
#4  0x0068b1fd in InputFunctionCall ()
#5  0x0068be6a in OidInputFunctionCall ()
#6  0x004dfead in coerce_type ()
#7  0x004e0733 in coerce_to_target_type ()
#8  0x004e1d29 in transformAssignedExpr ()
#9  0x004e1ea5 in updateTargetListEntry ()
#10 0x004b8627 in transformStmt ()
#11 0x004bab0e in parse_analyze ()
#12 0x005da07c in pg_analyze_and_rewrite ()
#13 0x005da7f8 in ?? ()
#14 0x005db55b in PostgresMain ()
#15 0x005b1d8d in ?? ()
#16 0x005b2b3c in PostmasterMain ()
#17 0x005603be in main ()


Regards,

Peter
 
R3 GIS Srl - GmbH
http://www.r3-gis.com


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ERROR: ptarray_area_spheroid: cannot handle ptarraythat crosses equator

2011-02-03 Thread Paragon Corporation
Marcello,
 
So you get an error about ptarray_area_spheroid.  You know off hand which
version of PostGIS 2.0.0 you are running.
 
We are running a 2011-01-29 build and your queries return answers for us.
Whether the answer is right is a different question.
 
 polygon |gsareageo
-+--
  161109 | 473946981.913427
 
 
 polygon |gsareageo
-+--
  161109 | 772770383.761807
 
We are running on 32-bit Windows:
PostgreSQL 9.0.2, compiled by Visual C++ build 1500, 32-bit
POSTGIS="2.0.0SVN" GEOS="3.3.0-CAPI-1.7.0" PROJ="Rel. 4.6.1, 21 August 2008"
LIBXML="2.7.6" USE_STATS
 
I thought maybe it would be a difference in Proj, but geography doesn't use
proj for area.  It could be a difference in 32-bit vs. 64-bit.  Perhaps
someone else running PostGIS 2.0.0 or 1.5 can test (preferably on 64-bit
Linux).
 
Works fine on our 1.5 build as well.
 
FWIW:  Your code is more verbose than it needs to be.  You can go straight
to geography with ST_GeogFromText:
http://www.postgis.org/documentation/manual-svn/ST_GeogFromText.html
 
 
SELECT 161109 polygon ,ST_AREA(ST_GEOGFROMTEXT('POLYGON((15.8327132977611
0.25,16 0.25,16 0,15.8566682147637 0,15.8566112518311
0.0035609924173,15.8485898971558 0.12477576973,15.8327132977611
0.25))')) gsareageo;
 
 
Hope that helps,
Regina and Leo
http://www.postgis.us
 
 

  _  

From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of marcello
marcellone
Sent: Thursday, February 03, 2011 3:52 PM
To: postgis-users@postgis.refractions.net
Subject: [postgis-users] ERROR: ptarray_area_spheroid: cannot handle
ptarraythat crosses equator


i try to calculate the area for a geographic grid 0.25 degree but for some
grids they touche equator i have the error in object.

"PostgreSQL 9.0.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE
Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292], 64-bit"

"POSTGIS="2.0.0SVN" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September
2009" LIBXML="2.7.7" USE_STATS"


SELECT 161109 polygon
,ST_AREA(GEOGRAPHY(ST_GEOMETRYFROMTEXT('POLYGON((15.8327132977611 0.25,16
0.25,16 0,15.8566682147637 0,15.8566112518311
0.0035609924173,15.8485898971558 0.12477576973,15.8327132977611
0.25))'))) gsareageo

SELECT 161109 polygon ,ST_AREA(GEOGRAPHY(ST_GEOMETRYFROMTEXT('POLYGON((15.75
0,15.75 0.25,16 0.25,16 0,15.75 0))'))) gsareageo;

Any idea about it ?



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Unprojected lat/long to 3081?

2011-02-03 Thread Aren Cambre
Thank you. That was it!

I did some more online reading and finally realized I'm dealing with a
conversion from a spherical projection to Cartesian.

Aren

On Thu, Feb 3, 2011 at 7:24 PM, Francis Markham  wrote:

> EPSG 3081 is a metre projection, so you need to transform your points from
> lat long into the appropriate projection.  Try something like this:
>
> *UPDATE event_table*
> *SET the_geom = ST_Transform(ST_SetSRID(ST_Point(event_location[1],
> event_location[0]), 4326), 3081)
> *
>
>
> This assumes your input latlons use the WGS84 datum.
>
> Cheers,
>
> Francis
>
> On 4 February 2011 09:33, Aren Cambre  wrote:
>
>> I have a database containing a Postgres native point data type *event*that 
>> has the latitude and longitude for certain events. An example value of
>> *event* is *(32.7748777996749,-96.7680574022233)*. Note: this is *not* a
>> PostGIS data type. It's a native Postgres type.
>>
>> I tried to convert this into a PostGIS gemoetry field *the_geom* and
>> project into 3081 at the same time using this:
>>
>> *UPDATE event_table*
>> *SET the_geom = ST_SetSRID(ST_Point(event_location[1],
>> event_location[0]), 3081)*
>>
>> (This derived from the example at
>> http://postgis.refractions.net/docs/ST_Point.html and reinforced by some
>> Google searching.)
>>
>> The problem is when I import this layer into a QGIS project with several
>> 3081-projected layers, all of my event points are ending up in the Pacific
>> Ocean just off Mexico's west coast. 3081 is a projection for Texas, and
>> that's where all my other data is.
>>
>> Am I doing something wrong with the conversion? I assumed that there
>> really is not a projection *per se* because the input is pure lat/long?
>>
>> Aren
>>
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Unprojected lat/long to 3081?

2011-02-03 Thread Francis Markham
EPSG 3081 is a metre projection, so you need to transform your points from
lat long into the appropriate projection.  Try something like this:

*UPDATE event_table*
*SET the_geom = ST_Transform(ST_SetSRID(ST_Point(event_location[1],
event_location[0]), 4326), 3081)
*


This assumes your input latlons use the WGS84 datum.

Cheers,

Francis

On 4 February 2011 09:33, Aren Cambre  wrote:

> I have a database containing a Postgres native point data type *event*that 
> has the latitude and longitude for certain events. An example value of
> *event* is *(32.7748777996749,-96.7680574022233)*. Note: this is *not* a
> PostGIS data type. It's a native Postgres type.
>
> I tried to convert this into a PostGIS gemoetry field *the_geom* and
> project into 3081 at the same time using this:
>
> *UPDATE event_table*
> *SET the_geom = ST_SetSRID(ST_Point(event_location[1], event_location[0]),
> 3081)*
>
> (This derived from the example at
> http://postgis.refractions.net/docs/ST_Point.html and reinforced by some
> Google searching.)
>
> The problem is when I import this layer into a QGIS project with several
> 3081-projected layers, all of my event points are ending up in the Pacific
> Ocean just off Mexico's west coast. 3081 is a projection for Texas, and
> that's where all my other data is.
>
> Am I doing something wrong with the conversion? I assumed that there really
> is not a projection *per se* because the input is pure lat/long?
>
> Aren
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Unprojected lat/long to 3081?

2011-02-03 Thread Aren Cambre
I have a database containing a Postgres native point data type *event* that
has the latitude and longitude for certain events. An example value of *
event* is *(32.7748777996749,-96.7680574022233)*. Note: this is *not* a
PostGIS data type. It's a native Postgres type.

I tried to convert this into a PostGIS gemoetry field *the_geom* and project
into 3081 at the same time using this:

*UPDATE event_table*
*SET the_geom = ST_SetSRID(ST_Point(event_location[1], event_location[0]),
3081)*

(This derived from the example at
http://postgis.refractions.net/docs/ST_Point.html and reinforced by some
Google searching.)

The problem is when I import this layer into a QGIS project with several
3081-projected layers, all of my event points are ending up in the Pacific
Ocean just off Mexico's west coast. 3081 is a projection for Texas, and
that's where all my other data is.

Am I doing something wrong with the conversion? I assumed that there really
is not a projection *per se* because the input is pure lat/long?

Aren
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] ERROR: ptarray_area_spheroid: cannot handle ptarray that crosses equator

2011-02-03 Thread marcello marcellone
i try to calculate the area for a geographic grid 0.25 degree but for some 
grids they touche equator i have the error in object.

"PostgreSQL 9.0.0 on x86_64-unknown-linux-gnu, compiled by GCC gcc (SUSE Linux) 
4.5.0 20100604 [gcc-4_5-branch revision 160292], 64-bit"

"POSTGIS="2.0.0SVN" GEOS="3.2.2-CAPI-1.6.2" PROJ="Rel. 4.7.1, 23 September 
2009" LIBXML="2.7.7" USE_STATS"


SELECT 161109 polygon 
,ST_AREA(GEOGRAPHY(ST_GEOMETRYFROMTEXT('POLYGON((15.8327132977611 0.25,16 
0.25,16 0,15.8566682147637 0,15.8566112518311 
0.0035609924173,15.8485898971558 0.12477576973,15.8327132977611 
0.25))'))) gsareageo

SELECT 161109 polygon ,ST_AREA(GEOGRAPHY(ST_GEOMETRYFROMTEXT('POLYGON((15.75 
0,15.75 0.25,16 0.25,16 0,15.75 0))'))) gsareageo;

Any idea about it ?




  ___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Postgres Tuning - Actual Results

2011-02-03 Thread Stephen Frost
Brian,

* Brian Hamlin (mapl...@light42.com) wrote:
> I am guessing that work_mem is the wildcard that is causing the
> large allocations..
> Comments / Suggestions on this ?

Yes, work_mem is used to determine, for each sort/hash/etc, if it
should be done in-memory or done on disk.  If you have a huge query,
with many sorts/hashes/etc, a single query could use much more than the
value of work_mem.

If you reduce work_mem, PG will try to find another plan where each
sort/hash/etc fits within that constraint, which may mean some spilling
to disk and/or overall change in the plan.

Thanks,

Stephen


signature.asc
Description: Digital signature
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Postgres Tuning - Actual Results

2011-02-03 Thread Brian Hamlin
I have a long, computationally intensive query I am running on Ubuntu 
Linux 64bit, 8G ram
PostgreSQL 9, PostGIS trunk. I have a question about memory usage and 
setttings..


postgresql.conf memory related settings:
  work_mem = 512M
   shared_buffers = 1024M
maintenance_work_mem = 24M

other settings at the default values

  So, on an 8G machine, after 12 hours of running
four processes on four cores.. I got the following stats

   VIRTRESSHR   MEM%
3206M  2228M  1011M   28%
3215M 2198M 1010M  27.7%
3301M 2400M 1013M  30.2%
4411M 3373M 1037M 42.5%

MEM => 6725M / 7938M
SWAP => 3685M

-

  So, clearly it has gone well into SWAP, but maybe this isnt a bad 
thing.
I am guessing that work_mem is the wildcard that is causing the large 
allocations..

Comments / Suggestions on this ?

  thanks -Brian

==
Brian Hamlin
planetwork.net
OSGeo California Chapter
(415) 717-4462 cell

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Postgresql, postgis and PHP

2011-02-03 Thread Louwrens du Toit

Hi,

Thank you very much for the info. Will check this out.
I got some info and examples on the site: 
http://trac.osgeo.org/postgis/wiki/UsersWikiMain and that already helped 
me quite a bit. It's going slow but at the moment there are already some 
nice stuff I accomplished.


I will read through the links you sent me, and come back to you guys for 
questions.


Regards,
LJ du Toit

__
LJ du Toit

On 03.02.2011 16:36, Paragon Corporation wrote:

LJ,

The first chapter is a free download.  We took Paolo Coriti's advice (hmm I
think others suggested it to),and made the first chapter very quick paced.
So it covers, geometry, geography types, how to load and how to do common
spatial joins with it.

You might want to check that out.

It's changed quite a bit from the one that is currently posted on the site,
but I think most of the pieces are there.

http://www.manning.com/obe/PostGIS_MEAPCH01.pdf

Also all the code snippets and most of the data for the chapters are
available on our book site  and we don't require you to buy the book to
download them.  Though it helps since the book is more descriptive of what
is going on in the code. Just click on the paper clip to download the code
and accompanying data  for each chapter (the link is also available on each
chapter description page)

http://www.postgis.us/chapters


There are also some good examples and walk thru tutorials on the PostGIS
users site

http://trac.osgeo.org/postgis/wiki/UsersWikiTutorials





Hope that helps,
Leo and Regina
http://www.postgis.us



-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Louwrens
du Toit
Sent: Thursday, February 03, 2011 5:38 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Postgresql, postgis and PHP

Hi Brent,

First of all thanks for the reply and the heads up warning for
conversions... I will look into that book that you mentioned but would like
to know (like Dheeraj) if you could perhaps give me a hint on how such a
query could look? That would very much be appreciated.

Thanks again for the info.

Regards,
LJ du Toit

__
LJ du Toit

Max-Planck-Institute for Evolutionary Anthropology Department of Primatology
Deutscher Platz No 6
D-04103 Leipzig
Germany

e-maillouwrence...@eva.mpg.de
phone++49 (0) 341 3550 802


On 02.02.2011 19:44, Dheeraj Chand wrote:

Brent,

I confess to being in a similar boat to the OP. I just pre-ordered the

book from Amazon, but I am curious if you can get into your opinions about
whether or not it's better to do that kind of manipulation at the db level
or at the script level.  My gut tells me that it's better to do it by db.

More interestingly, what would a query to accomplish his goals look like?

Dheeraj

On Feb 2, 2011, at 1:25 PM, pcr...@pcreso.com wrote:


Hi,

You can use simple SQL to extract core values which you manipulate&

analyse in PHP/Javascript, or you can do more of the work in SQL. Given your
skills, it seems likely that you would find it easier to use simple SQL&
more script based processing.

One initial point to note:

If you are dealing with global polygons, then SRID 4326 based data can

give very strange results for area calculations. eg, the polygons:

(0 0,  1 0,  1 1,  0 1,  0 1 ) and
(0 90, 1 90, 1 89, 0 89, 0 90)

are both 1 degree square, and will give you the same area when queried.

However, these are cartesian degrees, and you want the spherical area, which
will be close to 1 degree at the equator, but a small fraction of this at
the pole.

So, you need to either convert (transform) your coordinates to a suitable

coordinate system (identified by its SRID) before querying the area, or deal
with this issue some other way, but you need to deal with it.

Then you can use the Postgis SQL functions to retrieve the desired area

values of the transformed polygon geometries. The Postgis docs give you good
basic instructions on the commands, but tend to assume you already
understand such issues.


Rather than write a Postgis guide here, I recommend you buy a copy of

"Postgis is Action" (http://www.manning.com/obe/) - you can download the
digital version prior to the printed edition being available.

Otherwise a full discussion on this list could virtually replicate the

contents of the book!


Cheers,

   Brent Wood


--- On Wed, 2/2/11, Louwrens du Toit   wrote:


From: Louwrens du Toit
Subject: [postgis-users] Postgresql, postgis and PHP
To: postgis-users@postgis.refractions.net
Date: Wednesday, February 2, 2011, 11:24 PM Dear Postgis-Users List,

I'm an experienced web developer (mainly PHP, Javascript,
MySQL) and have recently started a job where I need work with
geographic information, mainly in a Postgresql database. So, I'm
quite new to all this geographical data etc and have a few
questions:

So, I have a database (Postgresql) with geographi

Re: [postgis-users] Postgresql, postgis and PHP

2011-02-03 Thread Paragon Corporation
LJ,

The first chapter is a free download.  We took Paolo Coriti's advice (hmm I
think others suggested it to),and made the first chapter very quick paced.
So it covers, geometry, geography types, how to load and how to do common
spatial joins with it.

You might want to check that out.

It's changed quite a bit from the one that is currently posted on the site,
but I think most of the pieces are there.

http://www.manning.com/obe/PostGIS_MEAPCH01.pdf

Also all the code snippets and most of the data for the chapters are
available on our book site  and we don't require you to buy the book to
download them.  Though it helps since the book is more descriptive of what
is going on in the code. Just click on the paper clip to download the code
and accompanying data  for each chapter (the link is also available on each
chapter description page)

http://www.postgis.us/chapters


There are also some good examples and walk thru tutorials on the PostGIS
users site

http://trac.osgeo.org/postgis/wiki/UsersWikiTutorials





Hope that helps,
Leo and Regina
http://www.postgis.us

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Louwrens
du Toit
Sent: Thursday, February 03, 2011 5:38 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Postgresql, postgis and PHP

Hi Brent,

First of all thanks for the reply and the heads up warning for
conversions... I will look into that book that you mentioned but would like
to know (like Dheeraj) if you could perhaps give me a hint on how such a
query could look? That would very much be appreciated.

Thanks again for the info.

Regards,
LJ du Toit

__
LJ du Toit

Max-Planck-Institute for Evolutionary Anthropology Department of Primatology
Deutscher Platz No 6
D-04103 Leipzig
Germany

e-maillouwrence...@eva.mpg.de
phone++49 (0) 341 3550 802


On 02.02.2011 19:44, Dheeraj Chand wrote:
> Brent,
>
> I confess to being in a similar boat to the OP. I just pre-ordered the
book from Amazon, but I am curious if you can get into your opinions about
whether or not it's better to do that kind of manipulation at the db level
or at the script level.  My gut tells me that it's better to do it by db.
>
> More interestingly, what would a query to accomplish his goals look like?
>
> Dheeraj
>
> On Feb 2, 2011, at 1:25 PM, pcr...@pcreso.com wrote:
>
>> Hi,
>>
>> You can use simple SQL to extract core values which you manipulate&
analyse in PHP/Javascript, or you can do more of the work in SQL. Given your
skills, it seems likely that you would find it easier to use simple SQL&
more script based processing.
>>
>> One initial point to note:
>>
>> If you are dealing with global polygons, then SRID 4326 based data can
give very strange results for area calculations. eg, the polygons:
>>
>> (0 0,  1 0,  1 1,  0 1,  0 1 ) and
>> (0 90, 1 90, 1 89, 0 89, 0 90)
>>
>> are both 1 degree square, and will give you the same area when queried.
However, these are cartesian degrees, and you want the spherical area, which
will be close to 1 degree at the equator, but a small fraction of this at
the pole.
>>
>> So, you need to either convert (transform) your coordinates to a suitable
coordinate system (identified by its SRID) before querying the area, or deal
with this issue some other way, but you need to deal with it.
>>
>> Then you can use the Postgis SQL functions to retrieve the desired area
values of the transformed polygon geometries. The Postgis docs give you good
basic instructions on the commands, but tend to assume you already
understand such issues.
>>
>>
>> Rather than write a Postgis guide here, I recommend you buy a copy of
"Postgis is Action" (http://www.manning.com/obe/) - you can download the
digital version prior to the printed edition being available.
>>
>> Otherwise a full discussion on this list could virtually replicate the
contents of the book!
>>
>>
>> Cheers,
>>
>>   Brent Wood
>>
>>
>> --- On Wed, 2/2/11, Louwrens du Toit  wrote:
>>
>>> From: Louwrens du Toit
>>> Subject: [postgis-users] Postgresql, postgis and PHP
>>> To: postgis-users@postgis.refractions.net
>>> Date: Wednesday, February 2, 2011, 11:24 PM Dear Postgis-Users List,
>>>
>>> I'm an experienced web developer (mainly PHP, Javascript,
>>> MySQL) and have recently started a job where I need work with 
>>> geographic information, mainly in a Postgresql database. So, I'm 
>>> quite new to all this geographical data etc and have a few 
>>> questions:
>>>
>>> So, I have a database (Postgresql) with geographical data (mainly 
>>> polygons in format "geometry" - srid 4326). Now I can do some area 
>>> (ST_Area) and intersection
>>> (ST_Intersection) queries but would like to know the
>>> following:
>>>
>>> 1. I have several tables with polygon data (layers) but need to do 
>>> queries across them (what I need to do in the end is to create 
>>> charts - bar,pie etc). I.e I would

Re: [postgis-users] Postgresql, postgis and PHP

2011-02-03 Thread Louwrens du Toit

Hi Brent,

First of all thanks for the reply and the heads up warning for 
conversions... I will look into that book that you mentioned but would 
like to know (like Dheeraj) if you could perhaps give me a hint on how 
such a query could look? That would very much be appreciated.


Thanks again for the info.

Regards,
LJ du Toit

__
LJ du Toit

Max-Planck-Institute for Evolutionary Anthropology
Department of Primatology
Deutscher Platz No 6
D-04103 Leipzig
Germany

e-maillouwrence...@eva.mpg.de
phone++49 (0) 341 3550 802


On 02.02.2011 19:44, Dheeraj Chand wrote:

Brent,

I confess to being in a similar boat to the OP. I just pre-ordered the book 
from Amazon, but I am curious if you can get into your opinions about whether 
or not it's better to do that kind of manipulation at the db level or at the 
script level.  My gut tells me that it's better to do it by db.

More interestingly, what would a query to accomplish his goals look like?

Dheeraj

On Feb 2, 2011, at 1:25 PM, pcr...@pcreso.com wrote:


Hi,

You can use simple SQL to extract core values which you manipulate&  analyse in 
PHP/Javascript, or you can do more of the work in SQL. Given your skills, it seems 
likely that you would find it easier to use simple SQL&  more script based 
processing.

One initial point to note:

If you are dealing with global polygons, then SRID 4326 based data can give 
very strange results for area calculations. eg, the polygons:

(0 0,  1 0,  1 1,  0 1,  0 1 ) and
(0 90, 1 90, 1 89, 0 89, 0 90)

are both 1 degree square, and will give you the same area when queried. 
However, these are cartesian degrees, and you want the spherical area, which 
will be close to 1 degree at the equator, but a small fraction of this at the 
pole.

So, you need to either convert (transform) your coordinates to a suitable  
coordinate system (identified by its SRID) before querying the area, or deal 
with this issue some other way, but you need to deal with it.

Then you can use the Postgis SQL functions to retrieve the desired area values 
of the transformed polygon geometries. The Postgis docs give you good basic 
instructions on the commands, but tend to assume you already understand such 
issues.


Rather than write a Postgis guide here, I recommend you buy a copy of "Postgis is 
Action" (http://www.manning.com/obe/) - you can download the digital version prior 
to the printed edition being available.

Otherwise a full discussion on this list could virtually replicate the contents 
of the book!


Cheers,

  Brent Wood


--- On Wed, 2/2/11, Louwrens du Toit  wrote:


From: Louwrens du Toit
Subject: [postgis-users] Postgresql, postgis and PHP
To: postgis-users@postgis.refractions.net
Date: Wednesday, February 2, 2011, 11:24 PM
Dear Postgis-Users List,

I'm an experienced web developer (mainly PHP, Javascript,
MySQL) and have recently started a job where I need work
with geographic information, mainly in a Postgresql
database. So, I'm quite new to all this geographical data
etc and have a few questions:

So, I have a database (Postgresql) with geographical data
(mainly polygons in format "geometry" - srid 4326). Now I
can do some area (ST_Area) and intersection
(ST_Intersection) queries but would like to know the
following:

1. I have several tables with polygon data (layers) but
need to do queries across them (what I need to do in the end
is to create charts - bar,pie etc). I.e I would like to know
for instance, what percentage area of layer 1 falls within
the area in layer 2? or
2. I have raster data (in geotiff format), and would like
to know... per polygon (in layer 1 above), what is the mean
value of the raster data...

Can someone point me in a direction of where to information
like this. How should I go about this problem?

I hope this makes sense. As I said, I'm very new to all
this geographic stuff.

Thank you,
LJ du Toit

--
__
LJ du Toit

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users




___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Export as X3D

2011-02-03 Thread Olivier Courtin


On Feb 3, 2011, at 9:32 AM, Sylvain wrote:


Oh ! Collada format is available in Postgressql / Postgis ?


No yet,
But it's planned to be there

--
Olivier

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Export as X3D

2011-02-03 Thread Sylvain
Oh ! Collada format is available in Postgressql / Postgis ? If yes could
you tell me which version to use for testing ?

Thank you.

Le jeudi 03 février 2011 à 09:22 +0100, Olivier Courtin a écrit : 

> On Feb 3, 2011, at 9:17 AM, Sylvain wrote:
> 
> > Can I use postgres 8.3 and the patch or unfortunately it's  
> > deprecated ?
> 
> Well this old patches was more a proof of concept
> Don't think you could safely use it in a real world application
> 
> > X3d and collada format is still in the roadmap or not ?
> 
> Collada is a aim yes.
> 
> --
> Olivier
> 
> 
> 
> 
> 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Export as X3D

2011-02-03 Thread Olivier Courtin


On Feb 3, 2011, at 9:17 AM, Sylvain wrote:

Can I use postgres 8.3 and the patch or unfortunately it's  
deprecated ?


Well this old patches was more a proof of concept
Don't think you could safely use it in a real world application


X3d and collada format is still in the roadmap or not ?


Collada is a aim yes.

--
Olivier





___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



Re: [postgis-users] Export as X3D

2011-02-03 Thread Sylvain
Thank you Olivier for your quick reply !

Can I use postgres 8.3 and the patch or unfortunately it's deprecated ?

X3d and collada format is still in the roadmap or not ?

Sylvain

Le jeudi 03 février 2011 à 08:28 +0100, Olivier Courtin a écrit : 

> On Feb 3, 2011, at 7:36 AM, Sylvain wrote:
> 
> Hi Sylvain,
> 
> > I'm a user of postgis 1.5.1 and postgresql 8.4 under debian squeeze.  
> > I want to know if it's possible to export geomtries which are stored  
> > in my database to x3d.
> > I found this how to (french language) : 
> > http://www.davidgis.fr/blog/index.php?2007/05/23/244-patch-de-marc-cave-ayland-et-de-la-fonction-asx3d
> >  
> >  but the post is very old !
> > Is there anyway to export asx3d under postgresql 8.4 or 9 ?
> 
> 3D support (TIN/PolyedralSurface) is currently under work on 2.0 branch.
> GML3 is already available as export on SVN.
> 
> But X3D export is not yet planned for 2.0.
> 
> --
> Olivier
> 
> 
> 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users