Re: [postgis-users] ST_Union vs ST_Collect
Hi, Yes, thanks Jamie, that is indeed what I meant. Didn't proofread the message well enough! Regards, Loretta - Original Message - From: James DeMichele Date: Friday, September 10, 2010 6:50 pm Subject: Re: [postgis-users] ST_Union vs ST_Collect > Hello, Loretta, when you said: " replacing the ST_DUMP with > ST_COLLECT...", did you mean that you replaced the ST_UNION with > ST_COLLECT? > > -Jamie > > -Original Message- > From: postgis-users-boun...@postgis.refractions.net > [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of L > Bogert-O'Brien > Sent: Friday, September 10, 2010 3:26 PM > To: postgis-users@postgis.refractions.net > Subject: [postgis-users] ST_Union vs ST_Collect > > The question: > Why would CT_COLLECT work when CT_UNION does not? > > The background: > There are 49 distinct CMAs in my y2006.ca_ct.cbf_clp table. Each of > them have many multipolygons within them that touch each other by > boundaries only. I wanted to create a table containing a single > dissolved multipolygon for each CMA, so I created the following query > to insert the data into the new table, y2006.ca_cma_cbf_clp: > > INSERT INTO y2006.ca_cma_cbf_clp (pruid, cmauid, the_geom_4269) > (SELECT dmp.pruid, dmp.cmauid, > ST_MULTI(ST_BUFFER(ST_UNION(dmp.dmp_geom), 0.0)) >FROM (SELECT pruid, cmauid, > > cleangeometry(ST_BUFFER((ST_DUMP(the_geom_4269)).geom,0.0)) AS > dmp_geomFROM y2006.ca_ct_cbf_clp) AS dmp --9683 rows > of dumped > geometries >GROUP BY pruid, cmauid >ORDER BY pruid, cmauid); --49 rows of CMAs > > This returned 49 rows, but there were two of them that had geometries > that were NULL, and the following errors were seen: > > NOTICE: TopologyException: found non-noded intersection between > -79.4565 44.2272, -79.4565 44.2272 and -79.4565 44.2272, -79.4565 > 44.2272 -79.4565 44.2272 > NOTICE: TopologyException: Directed Edge visited twice during > ring-building -123.035 49.3916 > (These locations were within the two geometries that were missing.) > > So I just made one change, replacing the ST_DUMP with ST_COLLECT, and > then I got the results I was expecting. There were no errors and all > 49 entries in the new table had valid geometries. > > Thanks for any clarification you can give on the difference between > ST_UNION and ST_COLLECT and when one should be used over the other. > > Regards, > > Loretta > > > ___ > 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] ST_Union vs ST_Collect
Hello, Loretta, when you said: " replacing the ST_DUMP with ST_COLLECT...", did you mean that you replaced the ST_UNION with ST_COLLECT? -Jamie -Original Message- From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of L Bogert-O'Brien Sent: Friday, September 10, 2010 3:26 PM To: postgis-users@postgis.refractions.net Subject: [postgis-users] ST_Union vs ST_Collect The question: Why would CT_COLLECT work when CT_UNION does not? The background: There are 49 distinct CMAs in my y2006.ca_ct.cbf_clp table. Each of them have many multipolygons within them that touch each other by boundaries only. I wanted to create a table containing a single dissolved multipolygon for each CMA, so I created the following query to insert the data into the new table, y2006.ca_cma_cbf_clp: INSERT INTO y2006.ca_cma_cbf_clp (pruid, cmauid, the_geom_4269) (SELECT dmp.pruid, dmp.cmauid, ST_MULTI(ST_BUFFER(ST_UNION(dmp.dmp_geom), 0.0)) FROM (SELECT pruid, cmauid, cleangeometry(ST_BUFFER((ST_DUMP(the_geom_4269)).geom, 0.0)) AS dmp_geom FROM y2006.ca_ct_cbf_clp) AS dmp --9683 rows of dumped geometries GROUP BY pruid, cmauid ORDER BY pruid, cmauid); --49 rows of CMAs This returned 49 rows, but there were two of them that had geometries that were NULL, and the following errors were seen: NOTICE: TopologyException: found non-noded intersection between -79.4565 44.2272, -79.4565 44.2272 and -79.4565 44.2272, -79.4565 44.2272 -79.4565 44.2272 NOTICE: TopologyException: Directed Edge visited twice during ring-building -123.035 49.3916 (These locations were within the two geometries that were missing.) So I just made one change, replacing the ST_DUMP with ST_COLLECT, and then I got the results I was expecting. There were no errors and all 49 entries in the new table had valid geometries. Thanks for any clarification you can give on the difference between ST_UNION and ST_COLLECT and when one should be used over the other. Regards, Loretta ___ 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] ST_Union vs ST_Collect
The question: Why would CT_COLLECT work when CT_UNION does not? The background: There are 49 distinct CMAs in my y2006.ca_ct.cbf_clp table. Each of them have many multipolygons within them that touch each other by boundaries only. I wanted to create a table containing a single dissolved multipolygon for each CMA, so I created the following query to insert the data into the new table, y2006.ca_cma_cbf_clp: INSERT INTO y2006.ca_cma_cbf_clp (pruid, cmauid, the_geom_4269) (SELECT dmp.pruid, dmp.cmauid, ST_MULTI(ST_BUFFER(ST_UNION(dmp.dmp_geom), 0.0)) FROM (SELECT pruid, cmauid, cleangeometry(ST_BUFFER((ST_DUMP(the_geom_4269)).geom, 0.0)) AS dmp_geom FROM y2006.ca_ct_cbf_clp) AS dmp --9683 rows of dumped geometries GROUP BY pruid, cmauid ORDER BY pruid, cmauid); --49 rows of CMAs This returned 49 rows, but there were two of them that had geometries that were NULL, and the following errors were seen: NOTICE: TopologyException: found non-noded intersection between -79.4565 44.2272, -79.4565 44.2272 and -79.4565 44.2272, -79.4565 44.2272 -79.4565 44.2272 NOTICE: TopologyException: Directed Edge visited twice during ring-building -123.035 49.3916 (These locations were within the two geometries that were missing.) So I just made one change, replacing the ST_DUMP with ST_COLLECT, and then I got the results I was expecting. There were no errors and all 49 entries in the new table had valid geometries. Thanks for any clarification you can give on the difference between ST_UNION and ST_COLLECT and when one should be used over the other. Regards, Loretta ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Trying to simplify a collection of polygons
Thanks for the suggestion. i'll look into it. Henri From: L Bogert-OBrien To: PostGIS Users Discussion Sent: Fri, September 10, 2010 3:33:59 PM Subject: Re: [postgis-users] Trying to simplify a collection of polygons Hi Henri, Did you try using ST_MULTI and then check the output? I have had success with this. Regards, Loretta Hello, I have a collection of polygons none of which overlap except perhaps on parts of their outer rings. I have the impression this cannot be turned into a multipolygon because there is overlap. Is there any way of simplfying this collection to make a normal multipolygon? I am thinking of "fusing" the ones that touch. Thankyou Henri ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] get segment of multiline between two points
Marco, Yes. If you are using PostGIS 1.5 or above you can use ST_DumpPoints to dump the points out which is a bit faster than ST_PointN (or you can use ST_Point) http://www.postgis.org/documentation/manual-svn/ST_DumpPoints.html For lower versions you can use ST_PointN http://www.postgis.org/documentation/manual-svn/ST_PointN.html 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 Marco Sent: Friday, September 10, 2010 1:15 PM To: postgis-users@postgis.refractions.net Subject: [postgis-users] get segment of multiline between two points Hi, as the subject I've two points on a layer multiline and I need all the points included in that segment to draw on the client side. is this possible? thanks ___ 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] get segment of multiline between two points
Hi, as the subject I've two points on a layer multiline and I need all the points included in that segment to draw on the client side. is this possible? thanks ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Trying to simplify a collection of polygons
Hi Henri, Did you try using ST_MULTI and then check the output? I have had success with this. Regards, Loretta Hello, I have a collection of polygons none of which overlap except perhaps on parts of their outer rings. I have the impression this cannot be turned into a multipolygon because there is overlap. Is there any way of simplfying this collection to make a normal multipolygon? I am thinking of "fusing" the ones that touch. Thankyou Henri ___ 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] pgsql2shp revision
Denis Rykov wrote: Is the pgsl2shp show correct SVN version of revision? After updated pgsql2shp from svn and start pgsql2shp without options I get: RCSID: $Id: pgsql2shp-core.h 5870 2010-08-28 09:16:32Z mcayland $ RELEASE: 2.0 USE_GEOS=1 USE_PROJ=1 USE_STATS=1 But last SVN revision number is not 5870. This appears to be a "feature" of SVN in that the revision number embedded in the file is the last revision that altered that particular file, and not the latest revision of the whole repository. Since we store the revision information in a separate file (because it is re-used in more than one place) then you don't see the "true" repository revision. Perhaps we could "touch" the pgsql2shp-core.h file but that just seems messy :( ATB, Mark. -- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063 Sirius Labs: http://www.siriusit.co.uk/labs ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
[postgis-users] Trying to simplify a collection of polygons
Hello, I have a collection of polygons none of which overlap except perhaps on parts of their outer rings. I have the impression this cannot be turned into a multipolygon because there is overlap. Is there any way of simplfying this collection to make a normal multipolygon? I am thinking of "fusing" the ones that touch. Thankyou Henri ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users