If you're just looking to iterate over all lines in a multilinestring do something like this...<br><br><br>    for i in 1..NumGeometries(the_geom) loop<br>        a_geom := GeometryN(the_geom, i);<br>        --do something
<br>    end loop;<br><br><br><div><span class="gmail_quote">On 11/21/06, <b class="gmail_sendername"><a href="mailto:postgis-users-request@postgis.refractions.net">postgis-users-request@postgis.refractions.net</a></b> <
<a href="mailto:postgis-users-request@postgis.refractions.net">postgis-users-request@postgis.refractions.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Send postgis-users mailing list submissions to<br>        <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>or, via email, send a message with subject or body 'help' to<br>        
<a href="mailto:postgis-users-request@postgis.refractions.net">postgis-users-request@postgis.refractions.net</a><br><br>You can reach the person managing the list at<br>        <a href="mailto:postgis-users-owner@postgis.refractions.net">
postgis-users-owner@postgis.refractions.net</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of postgis-users digest..."<br><br><br>Today's Topics:<br><br>   1. runing postgis init scripts on a named schema (Dylan Beaudette)
<br>   2. Ubuntu install of PostGIS 1.1.6 failing (Allan Doyle)<br>   3. RE: runing postgis init scripts on a named schema<br>      (Pedro Doria Meunier)<br>   4. Re: runing postgis init scripts on a named schema<br>      (Dylan Beaudette)
<br>   5. Spatial Join Performance (Eric Shuman)<br>   6. Re: SRID for Saudi Arabia (Markus Schaber)<br>   7. lat and long format (Sunitha Bayana)<br>   8. looking for some perf data (raphael Jacquot)<br>   9. Re: looking for some perf data (Martin Davis)
<br>  10. Re: looking for some perf data (raphael Jacquot)<br>  11. Re: looking for some perf data (Martin Davis)<br>  12. Re: looking for some perf data (raphael Jacquot)<br>  13. Splitting multistrings (Nick Black)<br>  14. Re: Splitting multistrings (Steffen Macke)
<br>  15. Re: Splitting multistrings (Barend K ? bben)<br>  16. Re: looking for some perf data (Paul Ramsey)<br>  17. centroid() and AddGeometryColumn() questions<br>      (<a href="mailto:matt.pettis@thomson.com">matt.pettis@thomson.com
</a>)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 20 Nov 2006 14:24:32 -0800<br>From: Dylan Beaudette <<a href="mailto:dylan.beaudette@gmail.com">dylan.beaudette@gmail.com
</a>><br>Subject: [postgis-users] runing postgis init scripts on a named schema<br>To: <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>Message-ID: <<a href="mailto:200611201424.32336.dylan.beaudette@gmail.com">
200611201424.32336.dylan.beaudette@gmail.com</a>><br>Content-Type: text/plain;  charset="us-ascii"<br><br>Hi everyone,<br><br>I have a fully functional postgis DB up and running, using the<br>default 'public' schema. I have just added a new schema, and would like
<br>to 'spatially-enable' this new one.<br><br>does anyone have tips on how this might be accomplished ?<br><br><br>thanks in advance!<br><br>--<br>Dylan Beaudette<br>Soils and Biogeochemistry Graduate Group<br>University of California at Davis
<br>530.754.7341<br><br><br>------------------------------<br><br>Message: 2<br>Date: Mon, 20 Nov 2006 18:45:50 -0500<br>From: Allan Doyle <<a href="mailto:adoyle@eogeo.org">adoyle@eogeo.org</a>><br>Subject: [postgis-users] Ubuntu install of PostGIS 
1.1.6 failing<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:1D9F853E-B379-4D84-B8F2-3E5797FA573E@eogeo.org">
1D9F853E-B379-4D84-B8F2-3E5797FA573E@eogeo.org</a>><br>Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed<br><br>I'm installing onto an up-to-date Ubuntu 6.06 system<br><br>proj-4.5.0 installs ok<br>geos-3.0.0rc2
 installs ok<br>postgis-1.1.6 gives the following errors:<br><br>=====<br>mwow% sudo su postgres<br>postgres@mwow:/usr/local/src/postgis-1.1.6$ make check<br>make -C regress test<br>make[1]: Entering directory `/usr/local/src/postgis-
1.1.6/regress'<br>Creating spatial db postgis_reg<br>ERROR:  function postgis_lib_version() does not exist<br>HINT:  No function matches the given name and argument types. You may<br>need to add explicit type casts.<br><br>
Something went wrong (no postgis installed in postgis_reg).<br>For details, check /tmp/pgis_reg_17211/regress_log<br><br>make[1]: *** [test] Error 1<br>make[1]: Leaving directory `/usr/local/src/postgis-1.1.6/regress'<br>
make: *** [check] Error 2<br>=====<br><br>The contents of /tmp/pgis_reg_17211/regress_log are not enlightening<br>to me:<br>=====<br>CREATE DATABASE<br>BEGIN<br>psql:lwpostgis.sql:39: NOTICE:  type "histogram2d" is not yet defined
<br>DETAIL:  Creating a shell type definition.<br>psql:lwpostgis.sql:39: ERROR:  could not load library "/usr/local/src/<br>postgis-1.1.6/lwgeom/liblwgeom.so.1.1": libgeos_c.so.1: cannot open<br>shared object file: No such file or directory
<br>psql:lwpostgis.sql:44: ERROR:  current transaction is aborted,<br>commands ignored until end of transaction block<br>psql:lwpostgis.sql:52: ERROR:  current transaction is aborted,<br>commands ignored until end of transaction block
<br>psql:lwpostgis.sql:62: ERROR:  current transaction is aborted,<br>commands ignored until end of transaction block<br><br>... snip ...<br><br>psql:lwpostgis.sql:3462: ERROR:  current transaction is aborted,<br>commands ignored until end of transaction block
<br>psql:lwpostgis.sql:3509: ERROR:  current transaction is aborted,<br>commands ignored until end of transaction block<br>ROLLBACK<br>=====<br><br>I did check the geos build, there is a step that makes libgeos_c.so.1<br>
in /usr/local/lib.<br><br>I tried explicitly setting --with-geos-libdir=/usr/local/lib but<br>there's no difference.<br><br>Has anyone bumped into (and solved!) this?<br><br>Thanks,<br><br>        Allan<br><br>--<br>Allan Doyle
<br>+1.781.433.2695<br><a href="mailto:adoyle@eogeo.org">adoyle@eogeo.org</a><br><br><br><br><br><br>------------------------------<br><br>Message: 3<br>Date: Mon, 20 Nov 2006 23:46:04 -0000<br>From: "Pedro Doria Meunier" <
<a href="mailto:pdoria@netmadeira.com">pdoria@netmadeira.com</a>><br>Subject: RE: [postgis-users] runing postgis init scripts on a named<br>        schema<br>To: <<a href="mailto:dylan.beaudette@gmail.com">dylan.beaudette@gmail.com
</a>>,        "'PostGIS Users Discussion'"<br>        <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <000001c70cfe$0af31dc0$05d6bed5@oem41cbbf9e178
><br>Content-Type: text/plain;       charset="us-ascii"<br><br>Hi Dylan,<br><br>That depends...<br>What's your operating system?<br>Are you compiling from sources?<br><br><br>Pedro Doria Meunier<br>(351) 91 302 49 72 - (351) 96 247 99 12
<br>MSN - <a href="mailto:pdoriam@hotmail.com">pdoriam@hotmail.com</a><br>ICQ - 308-182-126<br>Skype: pdoriam<br><br>-----Original Message-----<br>From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net
</a><br>[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of Dylan<br>Beaudette<br>Sent: segunda-feira, 20 de Novembro de 2006 22:25<br>To: 
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>Subject: [postgis-users] runing postgis init scripts on a named schema<br><br>Hi everyone,<br><br>I have a fully functional postgis DB up and running, using the
<br>default 'public' schema. I have just added a new schema, and would like<br>to 'spatially-enable' this new one.<br><br>does anyone have tips on how this might be accomplished ?<br><br><br>thanks in advance!<br><br>--<br>
Dylan Beaudette<br>Soils and Biogeochemistry Graduate Group<br>University of California at Davis<br>530.754.7341<br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">
postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br><br><br><br><br>------------------------------
<br><br>Message: 4<br>Date: Mon, 20 Nov 2006 16:30:24 -0800<br>From: Dylan Beaudette <<a href="mailto:dylan.beaudette@gmail.com">dylan.beaudette@gmail.com</a>><br>Subject: Re: [postgis-users] runing postgis init scripts on a named
<br>        schema<br>To: <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>Message-ID: <<a href="mailto:200611201630.24632.dylan.beaudette@gmail.com">200611201630.24632.dylan.beaudette@gmail.com
</a>><br>Content-Type: text/plain;  charset="iso-8859-1"<br><br>On Monday 20 November 2006 14:24, Dylan Beaudette wrote:<br>> Hi everyone,<br>><br>> I have a fully functional postgis DB up and running, using the
<br>> default 'public' schema. I have just added a new schema, and would like<br>> to 'spatially-enable' this new one.<br>><br>> does anyone have tips on how this might be accomplished ?<br>><br>><br>> thanks in advance!
<br><br>note that this is on debian linux, postgres 8.1.2, postgis 1.1.1<br><br>thanks<br><br>--<br>Dylan Beaudette<br>Soils and Biogeochemistry Graduate Group<br>University of California at Davis<br>530.754.7341<br><br><br>
------------------------------<br><br>Message: 5<br>Date: Mon, 20 Nov 2006 17:19:30 -0800<br>From: "Eric Shuman" <<a href="mailto:erics@ameri-title.com">erics@ameri-title.com</a>><br>Subject: [postgis-users] Spatial Join Performance
<br>To: "Postgis-Users" <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:KMEIKNPGBOLILGCIHBLCKEBHCBAA.erics@ameri-title.com">
KMEIKNPGBOLILGCIHBLCKEBHCBAA.erics@ameri-title.com</a>><br>Content-Type: text/plain;       charset="iso-8859-1"<br><br>Paul,<br><br>I did try using distance function instead of contains and the query<br>completed much faster!  30 minutes instead of 
2.5 hours. Thanks for the<br>tip!!!<br><br>But... =><br>Another issue was brought up earlier in this thread mentioning that not all<br>taxlot will be in just one zone... which has now brought up another road<br>block. I have been taking care of this issue by selecting distinct on
<br>(taxlot,zone) then grouping on the taxlot and concatenating the zone with a<br>delimiter.<br><br>The issue now is that comparing on a point won't pick up all the zones (I<br>was just going to accept this), but comparing on the polygon gets false hits
<br>due to topological shifting and errors.  I am experimenting with creating a<br>negative buffer and comparing its distance to the zone.  This works on a<br>test subject lot.<br><br>The road block is this...  When I try to run the query on my entire data set
<br>I get this error.<br>-----------------------------------------------<br>server closed the connection unexpectedly<br>        This probably means the server terminated abnormally<br>        before or while processing the request.
<br>-----------------------------------------------<br><br>To speed up the buffer I have also simplified the_geom.(this works)  I broke<br>the steps down by creating additional geometry fields in my taxlot layer to<br>hold the simplified geometry and then the buffered geometry. The simplify
<br>step works, the buffer is where it bails.<br><br>The taxlot geometries as multipolygon.  I ran an isvalid() on the geometry<br>and found some to be invalid, but if I exclude them from the query I still<br>get the server crash.
<br><br>Here are the queries:<br>--SELECT AddGeometryColumn('','taxlot','the_simple_geom','-1','GEOMETRY',2);<br>--update taxlot set the_simple_geom = simplify(taxlot.the_geom,5);<br>--SELECT AddGeometryColumn('','taxlot','the_buffer_geom','-1','GEOMETRY',2);
<br>--update taxlot set the_buffer_geom = buffer(taxlot.the_simple_geom,-5);<br>BAILS HERE<br><br><br>Any ideas on what might be wrong???<br><br>(should this be a new thread?)<br><br>---------------<br>Eric Shuman<br><br>
<br><br><br><br>------------------------------<br><br>Message: 6<br>Date: Tue, 21 Nov 2006 13:31:49 +0100<br>From: Markus Schaber <<a href="mailto:schabi@logix-tt.com">schabi@logix-tt.com</a>><br>Subject: Re: [postgis-users] SRID for Saudi Arabia
<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:4562F1B5.7010304@logix-tt.com">4562F1B5.7010304@logix-tt.com
</a>><br>Content-Type: text/plain; charset=ISO-8859-15<br><br>Hi, Stephen,<br><br>Stephen Davies wrote:<br>> Could somebody please point me at the correct (latlong) SRID for the<br>> Riyadh region of Saudi Arabia.
<br><br>There are several SRIDs, depending on the projection used.<br><br>E. G. all world-wide lat/lon formats like WGS85 (SRID 4326) cover Saudi<br>Arabia. But there is an UTM zone, as well...<br><br>So without knowing the projection information, we can't tell you the SRID.
<br><br>HTH,<br>Markus<br><br>--<br>Markus Schaber | Logical Tracking&Tracing International AG<br>Dipl. Inf.     | Software Development GIS<br><br>Fight against software patents in Europe! <a href="http://www.ffii.org">
www.ffii.org</a><br><a href="http://www.nosoftwarepatents.org">www.nosoftwarepatents.org</a><br><br><br>------------------------------<br><br>Message: 7<br>Date: Tue, 21 Nov 2006 08:44:11 -0800<br>From: "Sunitha Bayana" <
<a href="mailto:sbayana@sidestep.com">sbayana@sidestep.com</a>><br>Subject: [postgis-users] lat and long format<br>To: <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
><br>Message-ID:<br>        <<a href="mailto:1C8FFEE4F601A74EBF7E78E38EA5E53807525C1E@mailbox.jayst.sidestep.com">1C8FFEE4F601A74EBF7E78E38EA5E53807525C1E@mailbox.jayst.sidestep.com</a>><br>Content-Type: text/plain; charset="us-ascii"
<br><br>Hi<br><br><br><br><br><br><br><br>Is there any way in postgis to convert the lat and long from degree system to<br>decimal system. I have the data in the format as below<br><br><br><br><br><br><br><br>17.21.00S<br>
<br><br><br><br><br><br><br>145.30.00W<br><br><br><br><br><br><br><br><br><br><br><br><br><br>Thanks in advance.<br><br><br><br><br><br><br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...
<br>URL: <a href="http://lists.refractions.net/pipermail/postgis-users/attachments/20061121/7d0ecda0/attachment-0001.html">http://lists.refractions.net/pipermail/postgis-users/attachments/20061121/7d0ecda0/attachment-0001.html
</a><br><br>------------------------------<br><br>Message: 8<br>Date: Tue, 21 Nov 2006 17:46:46 +0100<br>From: raphael Jacquot <<a href="mailto:sxpert@sxpert.org">sxpert@sxpert.org</a>><br>Subject: [postgis-users] looking for some perf data
<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:45632D76.6040609@sxpert.org">45632D76.6040609@sxpert.org
</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed<br><br>hi there<br>I'm looking for some hard verifiable proof that using r-tree based<br>geometry indexes is better than using 2 columns and a btree index on it,
<br>performance wise.<br><br>has there any study done on that ?<br><br><br>------------------------------<br><br>Message: 9<br>Date: Tue, 21 Nov 2006 09:12:31 -0800<br>From: Martin Davis <<a href="mailto:mbdavis@refractions.net">
mbdavis@refractions.net</a>><br>Subject: Re: [postgis-users] looking for some perf data<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
><br>Message-ID: <<a href="mailto:4563337F.1090404@refractions.net">4563337F.1090404@refractions.net</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed<br><br>First of all, you need to be more specific.  The performance of an index
<br>is related to the kinds of queries you are making on it.   If you are<br>making  a simple equality query, then a B-tree on the (x,y) pair is<br>probably fine.  But if you're wanting to do range searches in two<br>dimensions, a B-tree does not support this kind of query, and hence
<br>performance will be slow compared to an access method which does support<br>this (e.g. R-tree, quad-tree, etc etc).<br><br>I don't know of any reference which has a "hard verifiable" comparison<br>with a simple B-tree for range queries.  I suspect this is because the
<br>performance difference is so obviously bad for B-trees that researchers<br>haven't bothered to document it.<br><br>You might try looking at two of the books by Hanan Samet:<br><br>Foundations of Multidimensional and Metric Data Structures
<br>The Design and Analysis of Spatial Data Structures<br><br>You could also try the original R-tree papers, or a survey entitled<br>"R-Trees are everywhere".  Also a paper entitled "Multidimensional<br>Access Methods" by Gaede et al.
<br><br><br>raphael Jacquot wrote:<br>> hi there<br>> I'm looking for some hard verifiable proof that using r-tree based<br>> geometry indexes is better than using 2 columns and a btree index on<br>> it, performance wise.
<br>><br>> has there any study done on that ?<br>> _______________________________________________<br>> postgis-users mailing list<br>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net
</a><br>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>><br><br>--<br>Martin Davis<br>Senior Technical Architect<br>Refractions Research, Inc.
<br>(250) 383-3022<br><br><br><br>------------------------------<br><br>Message: 10<br>Date: Tue, 21 Nov 2006 18:14:44 +0100<br>From: raphael Jacquot <<a href="mailto:sxpert@sxpert.org">sxpert@sxpert.org</a>><br>Subject: Re: [postgis-users] looking for some perf data
<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:45633404.7020604@sxpert.org">45633404.7020604@sxpert.org
</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed<br><br>Martin Davis wrote:<br>> First of all, you need to be more specific.  The performance of an index<br>> is related to the kinds of queries you are making on it.   If you are
<br>> making  a simple equality query, then a B-tree on the (x,y) pair is<br>> probably fine.  But if you're wanting to do range searches in two<br>> dimensions, a B-tree does not support this kind of query, and hence
<br>> performance will be slow compared to an access method which does support<br>> this (e.g. R-tree, quad-tree, etc etc).<br><br>typically I'm looking to compare using<br><br>create table blah1 (<br>        lon     double precision,
<br>        lat     double precision<br>)<br>with one index on lon and another one on lat<br><br>the classic request being<br>lon>constant1 and lon<constant2 and lat>constant3 and lat<constant4<br><br>and<br><br>
create table blah2 (<br>        position Point<br>)<br>with a gist r-tree index<br><br>using the @ operator<br><br>> raphael Jacquot wrote:<br>>> hi there<br>>> I'm looking for some hard verifiable proof that using r-tree based
<br>>> geometry indexes is better than using 2 columns and a btree index on<br>>> it, performance wise.<br>>><br>>> has there any study done on that ?<br>>> _______________________________________________
<br>>> postgis-users mailing list<br>>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>>><br>><br><br><br><br>------------------------------<br><br>Message: 11<br>Date: Tue, 21 Nov 2006 09:22:12 -0800<br>From: Martin Davis <<a href="mailto:mbdavis@refractions.net">
mbdavis@refractions.net</a>><br>Subject: Re: [postgis-users] looking for some perf data<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
><br>Message-ID: <<a href="mailto:456335C4.1060503@refractions.net">456335C4.1060503@refractions.net</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed<br><br>Well, those are range queries.  Not too surprising, 
99.9% of spatial<br>queries are.<br><br>The real question is: given that every modern spatial database uses some<br>sort of spatial index (R-tree, quad-tree, or grid), why even bother to<br>question whether B-trees might be better?
<br><br>raphael Jacquot wrote:<br>><br>> typically I'm looking to compare using<br>><br>> create table blah1 (<br>>     lon    double precision,<br>>     lat    double precision<br>> )<br>> with one index on lon and another one on lat
<br>><br>> the classic request being<br>> lon>constant1 and lon<constant2 and lat>constant3 and lat<constant4<br>><br>> and<br>><br>> create table blah2 (<br>>     position Point<br>> )
<br>> with a gist r-tree index<br>><br>> using the @ operator<br><br>--<br>Martin Davis<br>Senior Technical Architect<br>Refractions Research, Inc.<br>(250) 383-3022<br><br><br><br>------------------------------<br>
<br>Message: 12<br>Date: Tue, 21 Nov 2006 18:21:07 +0100<br>From: raphael Jacquot <<a href="mailto:sxpert@sxpert.org">sxpert@sxpert.org</a>><br>Subject: Re: [postgis-users] looking for some perf data<br>To: PostGIS Users Discussion <
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:45633583.2010009@sxpert.org">45633583.2010009@sxpert.org</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed
<br><br>Martin Davis wrote:<br>> Well, those are range queries.  Not too surprising, 99.9% of spatial<br>> queries are.<br>><br>> The real question is: given that every modern spatial database uses some<br>> sort of spatial index (R-tree, quad-tree, or grid), why even bother to
<br>> question whether B-trees might be better?<br><br>ask my boss :D<br><br>> raphael Jacquot wrote:<br>>><br>>> typically I'm looking to compare using<br>>><br>>> create table blah1 (<br>>>     lon    double precision,
<br>>>     lat    double precision<br>>> )<br>>> with one index on lon and another one on lat<br>>><br>>> the classic request being<br>>> lon>constant1 and lon<constant2 and lat>constant3 and lat<constant4
<br>>><br>>> and<br>>><br>>> create table blah2 (<br>>>     position Point<br>>> )<br>>> with a gist r-tree index<br>>><br>>> using the @ operator<br>><br><br><br><br>
------------------------------<br><br>Message: 13<br>Date: Tue, 21 Nov 2006 17:21:22 +0000<br>From: "Nick Black" <<a href="mailto:nickblack1@gmail.com">nickblack1@gmail.com</a>><br>Subject: [postgis-users] Splitting multistrings
<br>To: "PostGIS Users Discussion" <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID:<br>        <<a href="mailto:223020e60611210921y6f4d68buaf0310e7a5fae6c5@mail.gmail.com">
223020e60611210921y6f4d68buaf0310e7a5fae6c5@mail.gmail.com</a>><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Hi,<br><br>I'm trying to split multistrings into individual linestrings using SQL<br>
within PostGIS, but I cant find an appropriate function.  Is it<br>possible to do this using SQL?  If not, does anyone know a way this<br>can be done?<br><br>Many Thanks<br><br>Nick<br><br><br>------------------------------
<br><br>Message: 14<br>Date: Tue, 21 Nov 2006 19:28:55 +0200<br>From: "Steffen Macke" <<a href="mailto:sdteffen@gmail.com">sdteffen@gmail.com</a>><br>Subject: Re: [postgis-users] Splitting multistrings<br>
To: "PostGIS Users Discussion" <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID:<br>        <<a href="mailto:3cb1691c0611210928h56023b9dtd3faea5ed6f0b9cd@mail.gmail.com">
3cb1691c0611210928h56023b9dtd3faea5ed6f0b9cd@mail.gmail.com</a>><br>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><br>Hi Nick,<br><br>> I'm trying to split multistrings into individual linestrings using SQL
<br>> within PostGIS, but I cant find an appropriate function.  Is it<br>> possible to do this using SQL?  If not, does anyone know a way this<br>> can be done?<br><br>Did you have a look at the GeometryN() function?
<br>Together with the PostgreSQL generate_series() and NumGeometries() you<br>should be able to split your lines accordingly.<br><br>Or do you have to insert new vertices at the split points? In this<br>case, a little bit
<br>of additional information would help.<br><br>Regards,<br><br>Steffen<br><br><br>------------------------------<br><br>Message: 15<br>Date: Tue, 21 Nov 2006 18:54:53 +0100<br>From: Barend K ? bben <<a href="mailto:kobben@itc.nl">
kobben@itc.nl</a>><br>Subject: Re: [postgis-users] Splitting multistrings<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <
<a href="mailto:C188FBFD.36C0%kobben@itc.nl">C188FBFD.36C0%kobben@itc.nl</a>><br>Content-Type: text/plain;       charset="ISO-8859-1"<br><br>Hi ,<br><br>Find below an example how to change MultiPolygons to Polygons, Should eb
<br>simple to convert for (mulit)linestrings...<br><br><br>__<br>Barend K�bben<br>International Institute for Geo-information<br>Sciences and Earth Observation (ITC)<br>PO Box 6, 7500AA Enschede (The Netherlands)<br>ph: +31 (0)53 4874253; fax: +31 (0)53 4874335
<br><br>+++++++++++++<br><br>--<br>-- STEP 1: get maximum of NumGeometries into tmp table<br>--<br><br>CREATE TABLE tmp (maxnumgeoms int4) WITH OIDS;<br><br>INSERT into tmp<br>    (select gid from world where gid <=<br>
        (select max(NumGeometries(the_geom)) from world)<br>    );<br><br>--<br>-- STEP 2: create World_exploded table<br>--<br><br>CREATE SEQUENCE world_exploded_id_seq<br>  INCREMENT 1<br>  MINVALUE 1<br>  MAXVALUE 9223372036854775807
<br>  START 1<br>  CACHE 1;<br><br>CREATE TABLE world_exploded<br>(<br>  id int4 NOT NULL DEFAULT nextval('world_exploded_id_seq'::regclass),<br>  gid int4 NOT NULL,<br>  the_geom geometry,<br>  CONSTRAINT world_exploded_pkey PRIMARY KEY (id),
<br>  CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),<br>  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =<br>'POLYGON'::text OR the_geom IS NULL),<br>  CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = 4326)
<br>) ;<br><br>CREATE INDEX world_exploded_the_geom_gist<br>  ON world_exploded USING gist(the_geom);<br><br>CREATE INDEX world_exploded_gid<br>  ON world_exploded USING btree(gid);<br><br>--<br>-- STEP 3: insert exploded polygons
<br>--<br><br>insert into world_exploded (gid,the_geom)<br>    select<br>    gid, GeometryN(world.the_geom,maxnumgeoms)<br>    from tmp,world<br><br><br><br>------------------------------<br><br>Message: 16<br>Date: Tue, 21 Nov 2006 10:53:24 -0800
<br>From: Paul Ramsey <<a href="mailto:pramsey@refractions.net">pramsey@refractions.net</a>><br>Subject: Re: [postgis-users] looking for some perf data<br>To: PostGIS Users Discussion <<a href="mailto:postgis-users@postgis.refractions.net">
postgis-users@postgis.refractions.net</a>><br>Message-ID: <<a href="mailto:45634B24.1070907@refractions.net">45634B24.1070907@refractions.net</a>><br>Content-Type: text/plain; charset=ISO-8859-15; format=flowed<br>
<br>It's not so much a matter of "better" as it is a matter of "good<br>enough". As long as your data volume remains low enough, you can keep<br>your simple non-spatial tables and b-trees. At some point you'll flip
<br>though and need to move to spatial for "adequate" performance.  It all<br>depends on your definitions of "large" and "adequate", none of which are<br>  in scope for me :)<br><br>P<br><br>
Martin Davis wrote:<br>> Well, those are range queries.  Not too surprising, 99.9% of spatial<br>> queries are.<br>><br>> The real question is: given that every modern spatial database uses some<br>> sort of spatial index (R-tree, quad-tree, or grid), why even bother to
<br>> question whether B-trees might be better?<br>><br>> raphael Jacquot wrote:<br>>><br>>> typically I'm looking to compare using<br>>><br>>> create table blah1 (<br>>>     lon    double precision,
<br>>>     lat    double precision<br>>> )<br>>> with one index on lon and another one on lat<br>>><br>>> the classic request being<br>>> lon>constant1 and lon<constant2 and lat>constant3 and lat<constant4
<br>>><br>>> and<br>>><br>>> create table blah2 (<br>>>     position Point<br>>> )<br>>> with a gist r-tree index<br>>><br>>> using the @ operator<br>><br><br><br><br>
------------------------------<br><br>Message: 17<br>Date: Tue, 21 Nov 2006 13:04:07 -0600<br>From: <<a href="mailto:matt.pettis@thomson.com">matt.pettis@thomson.com</a>><br>Subject: [postgis-users] centroid() and AddGeometryColumn() questions
<br>To: <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID:<br>        <<a href="mailto:89C159F45B13A24682D98BDEF58E451F0B331CAA@TLRUSMNEAGMBX28.ERF.THOMSON.COM">
89C159F45B13A24682D98BDEF58E451F0B331CAA@TLRUSMNEAGMBX28.ERF.THOMSON.COM</a>><br><br>Content-Type: text/plain; charset="us-ascii"<br><br>Hi,<br><br>I am trying to add a column to my table that lists the centroids the
<br>polygon described in the 'the_geom' field.  I use the following, which<br>works (I think), but of which I have questions:<br><br>SELECT AddGeometryColumn( '', 'shp_mcd', 'centroid', -1, 'POINT', 2 );<br>UPDATE shp_mcd SET centroid = centroid ( the_geom );
<br><br>My question is about the final argument to AddGeometryColumn.<br>Documentation states that centroid() returns a POINT.  I figure that<br>that implies that the last argument should then be a 0, not a 2.  But if<br>
I use a 0 in the last field, the updated doesn't work -- it tells me<br>that i violate a dimension constraint.  Can someone explain why I need<br>to have a 2 as the last argument and not a 0?  It doesn't make sense to<br>
me.<br><br>Thanks,<br>Matt<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <a href="http://lists.refractions.net/pipermail/postgis-users/attachments/20061121/faf4d354/attachment-0001.html">
http://lists.refractions.net/pipermail/postgis-users/attachments/20061121/faf4d354/attachment-0001.html</a><br><br>------------------------------<br><br>_______________________________________________<br>postgis-users mailing list
<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users
</a><br><br><br>End of postgis-users Digest, Vol 49, Issue 21<br>*********************************************<br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>Mark Thomas<br><a href="mailto:spatialguru.net@gmail.com">
spatialguru.net@gmail.com</a><br>205.529.9013<br><br>"Commit to the Lord whatever you do,<br>    and your plans will succeed." - Proverbs 16:3