Sounds great. Does Frank need funding for this work? Unfortunately our budget on these matters is used for this year, but possibly available next year.
Med venlig hilsen Karl Brix Zinglersen -----Oprindelig meddelelse----- Fra: [email protected] [mailto:[email protected]] På vegne af [email protected] Sendt: 15. september 2009 16:00 Til: [email protected] Emne: postgis-users Digest, Vol 85, Issue 15 Send postgis-users mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://postgis.refractions.net/mailman/listinfo/postgis-users or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of postgis-users digest..." Today's Topics: 1. Center of Points Collection (Dustin Butler) 2. Re: Center of Points Collection (Paul Ramsey) 3. Re: Center of Points Collection (Rick) 4. Re: Center of Points Collection (Paul Ramsey) 5. Re: Center of Points Collection (Kevin Neufeld) 6. Re: Center of Points Collection (Rick) 7. Re: Center of Points Collection (Dustin Butler) 8. No Primary Key (Ravi) 9. Re: No Primary Key (P Kishor) 10. Re: Center of Points Collection ([email protected]) 11. Re: multipoint2point (Richard Greenwood) 12. Pgrouting assign_vertex_id function finding lat lon values of vertexes problem (poonam jalwan) 13. st_intersection error (D?ster Horst) 14. Re: multipoint2point ([email protected]) 15. Re: multipoint2point ([email protected]) 16. Re: st_intersection error (strk) 17. Re: st_intersection error (D?ster Horst) 18. Re: st_intersection error (strk) 19. Re: st_intersection error ([email protected]) 20. Re: No Primary Key (Kevin Neufeld) 21. Re: st_intersection error (Martin Davis) 22. Re: PostGIS to DXF output (Stefan Keller) ---------------------------------------------------------------------- Message: 1 Date: Mon, 14 Sep 2009 14:24:07 -0500 From: "Dustin Butler" <[email protected]> Subject: [postgis-users] Center of Points Collection To: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset=UTF-8; format=flowed Hello, Trying to figure out how to find center using a collection of points. For example something like this which doesn't work but you get the idea. SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics WHERE pb_debit=1)); I think I need to make a multipoint geom out of the points and pass that but haven't figure out yet. Thanks, Dustin Butler Intrcomm Technology Skype: dustinbutler ------------------------------ Message: 2 Date: Mon, 14 Sep 2009 12:28:27 -0700 From: Paul Ramsey <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: Dustin Butler <[email protected]>, PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 Faster than creating a multipoint is to recognize that ST_Centroid() is just going to return the center of the bbox of the collection anyways, so you can replace it with. SELECT ST_Centroid(ST_Extent(point_geom)) FROM pb_statistics WHERE pg_debit =1; If you want to do it the hard way, then: SELECT ST_Centroid(ST_Collect(point_geom)) FROM pb_statistics WHERE pg_debit =1; P. On Mon, Sep 14, 2009 at 12:24 PM, Dustin Butler <[email protected]> wrote: > Hello, > > Trying to figure out how to find center using a collection of points. ?For > example something like this which doesn't work but you get the idea. > > SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics WHERE > pb_debit=1)); > > I think I need to make a multipoint geom out of the points and pass that but > haven't figure out yet. > > Thanks, > Dustin Butler > Intrcomm Technology > > Skype: dustinbutler > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > ------------------------------ Message: 3 Date: Mon, 14 Sep 2009 16:03:11 -0400 From: Rick <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="iso-8859-1" It occurs to me that, depending on what you want, you might try averaging the points to get a median, since you don't have a shape, and thus no concept of area to produce a centroid. i.e. add them all up and divide by the number of points. On Mon, Sep 14, 2009 at 3:28 PM, Paul Ramsey <[email protected]>wrote: > Faster than creating a multipoint is to recognize that ST_Centroid() > is just going to return the center of the bbox of the collection > anyways, so you can replace it with. > > SELECT ST_Centroid(ST_Extent(point_geom)) FROM pb_statistics WHERE pg_debit > =1; > > If you want to do it the hard way, then: > > SELECT ST_Centroid(ST_Collect(point_geom)) FROM pb_statistics WHERE > pg_debit =1; > > P. > > On Mon, Sep 14, 2009 at 12:24 PM, Dustin Butler <[email protected]> > wrote: > > Hello, > > > > Trying to figure out how to find center using a collection of points. > For > > example something like this which doesn't work but you get the idea. > > > > SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics > WHERE > > pb_debit=1)); > > > > I think I need to make a multipoint geom out of the points and pass that > but > > haven't figure out yet. > > > > Thanks, > > Dustin Butler > > Intrcomm Technology > > > > Skype: dustinbutler > > _______________________________________________ > > postgis-users mailing list > > [email protected] > > http://postgis.refractions.net/mailman/listinfo/postgis-users > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Cheers! Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090914/3a53a895/attachment-0001.html> ------------------------------ Message: 4 Date: Mon, 14 Sep 2009 13:13:26 -0700 From: Paul Ramsey <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 Very nice approach. Select ST_MakePoint(avg(ST_X(point_teom)), avg(ST_Y(point_geom))) FROM pb_statistics WHERE pg_debit =1; On Mon, Sep 14, 2009 at 1:03 PM, Rick <[email protected]> wrote: > It occurs to me that, depending on what you want, you might try averaging > the points to get a median, since you don't have a shape, and thus no > concept of area to produce a centroid. > > i.e. add them all up and divide by the number of points. > > On Mon, Sep 14, 2009 at 3:28 PM, Paul Ramsey <[email protected]> > wrote: >> >> Faster than creating a multipoint is to recognize that ST_Centroid() >> is just going to return the center of the bbox of the collection >> anyways, so you can replace it with. >> >> SELECT ST_Centroid(ST_Extent(point_geom)) FROM pb_statistics WHERE >> pg_debit =1; >> >> If you want to do it the hard way, then: >> >> SELECT ST_Centroid(ST_Collect(point_geom)) FROM pb_statistics WHERE >> pg_debit =1; >> >> P. >> >> On Mon, Sep 14, 2009 at 12:24 PM, Dustin Butler <[email protected]> >> wrote: >> > Hello, >> > >> > Trying to figure out how to find center using a collection of points. >> > ?For >> > example something like this which doesn't work but you get the idea. >> > >> > SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics >> > WHERE >> > pb_debit=1)); >> > >> > I think I need to make a multipoint geom out of the points and pass that >> > but >> > haven't figure out yet. >> > >> > Thanks, >> > Dustin Butler >> > Intrcomm Technology >> > >> > Skype: dustinbutler >> > _______________________________________________ >> > postgis-users mailing list >> > [email protected] >> > http://postgis.refractions.net/mailman/listinfo/postgis-users >> > >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users > > > > -- > Cheers! > Rick > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > > ------------------------------ Message: 5 Date: Mon, 14 Sep 2009 13:51:11 -0700 From: Kevin Neufeld <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Paul Ramsey wrote: > Faster than creating a multipoint is to recognize that ST_Centroid() > is just going to return the center of the bbox of the collection > anyways... Unfortunately, Paul, ST_Centroid returns the center of mass, not the center of the bbox. SELECT astext(st_centroid(st_collect(column1))), FROM (values ('POINT(0 0)'), ('POINT(0 1)'), ('POINT(0 2)'), ('POINT(1 0)')) as foo; astext ------------------ POINT(0.25 0.75) (1 row) Your second post, taking the avg of the x,y does seem to be the nice approach, and produces the same results as ST_Centroid - the center of mass. SELECT astext(st_makepoint(avg(st_x(column1)), avg(st_y(column1)))) FROM (values ('POINT(0 0)'), ('POINT(0 1)'), ('POINT(0 2)'), ('POINT(1 0)')) as foo; astext ------------------ POINT(0.25 0.75) (1 row) If Dustin is after the center of the collection, then something along your first suggestion might be more appropriate. (taking the center of the extents) Cheers, Kevin ------------------------------ Message: 6 Date: Mon, 14 Sep 2009 18:23:57 -0400 From: Rick <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="iso-8859-1" This is why I said depending on what you want. The average provides a weighted result, where a wild point will merely tug like a point on a bezier frame. A statistical result. Putting a bounding box around the whole thing and computing the center of that, provides an unweighted geometric result. Which may be desirable. Without providing some means, on a set of points that we have no description of, of ordering a shape, save order of occurence, the means of computing a centroid is indeterminate. Interestingly enough, if the points are evenly spaced in circle with ordinate points, all three will get the same result. (Completely manufactured, I know) But I doubt that the question would have been raised if that were the case. The question is what is the application. Dustin? My question, purely out of interest, is which would be faster? My guess is the bounding box, with the median coming close on its heels. Also, am I correct in assuming that a centroid strives to be the point at which, were a line drawn through it would split the area of the shape evenly? If so, is this always possible, and if not, can exceptions be easily identified? On Mon, Sep 14, 2009 at 4:51 PM, Kevin Neufeld <[email protected]>wrote: > Paul Ramsey wrote: > >> Faster than creating a multipoint is to recognize that ST_Centroid() >> is just going to return the center of the bbox of the collection >> anyways... >> > > Unfortunately, Paul, ST_Centroid returns the center of mass, not the center > of the bbox. > > SELECT astext(st_centroid(st_collect(column1))), > FROM (values ('POINT(0 0)'), > ('POINT(0 1)'), > ('POINT(0 2)'), > ('POINT(1 0)')) as foo; > astext > ------------------ > POINT(0.25 0.75) > (1 row) > > Your second post, taking the avg of the x,y does seem to be the nice > approach, and produces the same results as ST_Centroid - the center of mass. > > SELECT astext(st_makepoint(avg(st_x(column1)), avg(st_y(column1)))) > FROM (values ('POINT(0 0)'), > ('POINT(0 1)'), > ('POINT(0 2)'), > ('POINT(1 0)')) as foo; > astext > ------------------ > POINT(0.25 0.75) > (1 row) > > If Dustin is after the center of the collection, then something along your > first suggestion might be more appropriate. > (taking the center of the extents) > > Cheers, > Kevin > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Cheers! Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090914/31afd580/attachment-0001.html> ------------------------------ Message: 7 Date: Mon, 14 Sep 2009 17:25:08 -0500 From: "Dustin Butler" <[email protected]> Subject: Re: [postgis-users] Center of Points Collection To: Paul Ramsey <[email protected]> Cc: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=UTF-8; format=flowed Thanks, that worked great. Dustin Butler Intrcomm Technology Skype: dustinbutler ------ Original Message ------ From: Paul Ramsey <[email protected]> Date: Mon, 14 Sep 2009 12:28:27 -0700 To: Dustin Butler <[email protected]>, PostGIS Users Discussion <[email protected]> Subject: Re: [postgis-users] Center of Points Collection Faster than creating a multipoint is to recognize that ST_Centroid() is just going to return the center of the bbox of the collection anyways, so you can replace it with. SELECT ST_Centroid(ST_Extent(point_geom)) FROM pb_statistics WHERE pg_debit =1; If you want to do it the hard way, then: SELECT ST_Centroid(ST_Collect(point_geom)) FROM pb_statistics WHERE pg_debit =1; P. On Mon, Sep 14, 2009 at 12:24 PM, Dustin Butler <[email protected]> wrote: > Hello, > > Trying to figure out how to find center using a collection of points. ?For > example something like this which doesn't work but you get the idea. > > SELECT ST_AsText(ST_Centriod(SELECT point_geom FROM pb.pb_statistics WHERE > pb_debit=1)); > > I think I need to make a multipoint geom out of the points and pass that but > haven't figure out yet. > > Thanks, > Dustin Butler > Intrcomm Technology > > Skype: dustinbutler > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > ------------------------------ Message: 8 Date: Mon, 14 Sep 2009 15:34:28 -0700 (PDT) From: Ravi <[email protected]> Subject: [postgis-users] No Primary Key To: postgis <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=utf-8 Hi, have a problem with a query resulting in a table without a primary key. Pl suggest a proper SQL Thanks in anticipation Ravi create table coal AS SELECT * from geology where group_='GONDWANA'; >From this SQL a table coal is created from table geology with all its columns as per the argument group_='GONDWANA' But the resultant table coal is not having a 'primary key'. table geology has gid as primary key. Pl give me a way how I can get a primary key on table coal. Table geology has (copy pasted from pgadmin) CREATE TABLE public.geology ( gid integer NOT NULL DEFAULT nextval('geology_gid_seq'::regclass), objectid bigint, group_ character varying(35), geometry geometry, CONSTRAINT geology_pkey PRIMARY KEY (gid), CONSTRAINT enforce_dims_geometry CHECK (ndims(geometry) = 2), CONSTRAINT enforce_geotype_geometry CHECK (geometrytype(geometry) = 'MULTIPOLYGON'::text OR geometry IS NULL), CONSTRAINT enforce_srid_geometry CHECK (srid(geometry) = (-1)) ) WITH (OIDS=FALSE); ALTER TABLE public.geology OWNER TO postgres; The query results table coal without primary key (copy pasted from pgadmin) CREATE TABLE public.coal ( gid integer, objectid bigint, group_ character varying(35), geometry geometry ) WITH (OIDS=FALSE); ALTER TABLE public.coal OWNER TO postgres; Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/ ------------------------------ Message: 9 Date: Mon, 14 Sep 2009 18:12:38 -0500 From: P Kishor <[email protected]> Subject: Re: [postgis-users] No Primary Key To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 14, 2009 at 5:34 PM, Ravi <[email protected]> wrote: > Hi, > have a problem with a query resulting in a table without a primary key. > Pl suggest a proper SQL > Thanks in anticipation > Ravi > > create table coal AS SELECT * from geology where group_='GONDWANA'; > > From this SQL a table coal is created from table geology with all its columns > as per the argument group_='GONDWANA' > > But the resultant table coal is not having a 'primary key'. > table geology has gid as primary key. > > Pl give me a way how I can get a primary key on table coal. > > > Table geology has (copy pasted from pgadmin) > CREATE TABLE public.geology > ( > ?gid integer NOT NULL DEFAULT nextval('geology_gid_seq'::regclass), > ?objectid bigint, > ?group_ character varying(35), > ?geometry geometry, > ?CONSTRAINT geology_pkey PRIMARY KEY (gid), > ?CONSTRAINT enforce_dims_geometry CHECK (ndims(geometry) = 2), > ?CONSTRAINT enforce_geotype_geometry CHECK (geometrytype(geometry) = > 'MULTIPOLYGON'::text OR geometry IS NULL), > ?CONSTRAINT enforce_srid_geometry CHECK (srid(geometry) = (-1)) > ) > WITH (OIDS=FALSE); > ALTER TABLE public.geology OWNER TO postgres; > > The query results table coal without primary key (copy pasted from pgadmin) > > CREATE TABLE public.coal > ( > ?gid integer, > ?objectid bigint, > ?group_ character varying(35), > ?geometry geometry > ) > WITH (OIDS=FALSE); > ALTER TABLE public.coal OWNER TO postgres; > > > Create table "coal" with the correct primary key definition (make the table defintion the same as the "geology" table) and then INSERT INTO coal SELECT FROM geology WHERE group_='GONDWANA'; Step 1: > ? ? ?Looking for local information? Find it on Yahoo! Local > http://in.local.yahoo.com/ > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= Sent from Madison, WI, United States ------------------------------ Message: 10 Date: Mon, 14 Sep 2009 18:25:49 -0700 (PDT) From: [email protected] Subject: Re: [postgis-users] Center of Points Collection To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=us-ascii Hi guys, A bit more difficult, & way out in left field, but if you use PL/R to create a median function for Postgres, you could build your point from the median(X) & (Y) values instead of the average. Where this would actually lie obviously depends on the distribution of the points. The centroid is most affected by (actually defined by) outlying points, the avg somewhat less & the median less still. Of course once you have PL/R to play with, you have much more flexibility to look at returning statistics from datasets than just the median. Cheers, Brent Wood --- On Tue, 9/15/09, Kevin Neufeld <[email protected]> wrote: > From: Kevin Neufeld <[email protected]> > Subject: Re: [postgis-users] Center of Points Collection > To: "PostGIS Users Discussion" <[email protected]> > Date: Tuesday, September 15, 2009, 8:51 AM > Paul Ramsey wrote: > > Faster than creating a multipoint is to recognize that > ST_Centroid() > > is just going to return the center of the bbox of the > collection > > anyways... > > Unfortunately, Paul, ST_Centroid returns the center of > mass, not the center of the bbox. > > SELECT astext(st_centroid(st_collect(column1))), > FROM (values ('POINT(0 0)'), > > ('POINT(0 1)'), > > ('POINT(0 2)'), > > ('POINT(1 0)')) as foo; > astext > ------------------ > POINT(0.25 0.75) > (1 row) > > Your second post, taking the avg of the x,y does seem to be > the nice approach, and produces the same results as > ST_Centroid - the center of mass. > > SELECT astext(st_makepoint(avg(st_x(column1)), > avg(st_y(column1)))) > FROM (values ('POINT(0 0)'), > > ('POINT(0 1)'), > > ('POINT(0 2)'), > > ('POINT(1 0)')) as foo; > astext > ------------------ > POINT(0.25 0.75) > (1 row) > > If Dustin is after the center of the collection, then > something along your first suggestion might be more > appropriate. > (taking the center of the extents) > > Cheers, > Kevin > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > ------------------------------ Message: 11 Date: Mon, 14 Sep 2009 21:25:13 -0600 From: Richard Greenwood <[email protected]> Subject: Re: [postgis-users] multipoint2point To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 You could use st_multi() to cast them al to multi point: ST_Multi(geometry) Returns the geometry as a MULTI* geometry. If the geometry is already a MULTI*, it is returned unchanged. SELECT ST_MULTI(wkb_geometry) FROM table; On Mon, Sep 14, 2009 at 6:22 AM, <[email protected]> wrote: > Hi, > I have a postgistable with different geometrytyps in one table: points and > multipoints (get this information via ST_GeometryType). > UMN Mapserver have no problems to show the geometrys, but if I try to export > this table via ogr2ogr there is an error: > Attempt to write non-poin(MULTIPOINT) to point shapefile. > How can I cast all my geometrys to point? > Jo > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > -- Richard Greenwood [email protected] www.greenwoodmap.com ------------------------------ Message: 12 Date: Tue, 15 Sep 2009 11:52:56 +0530 From: poonam jalwan <[email protected]> Subject: [postgis-users] Pgrouting assign_vertex_id function finding lat lon values of vertexes problem To: [email protected] Message-ID: <[email protected]> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Hi All, I have roads data i run the following function for creating source and target and cost values. SELECT assign_vertex_id(table_name, snapping_range, geometry_column_name, edge_id_column_name) now i want lat lon values of each and every start and end(vrtexes) with respect to roads data.Can anyone help me to resolve this problem. Thanks, Poonam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/d647efea/attachment-0001.html> ------------------------------ Message: 13 Date: Tue, 15 Sep 2009 08:43:10 +0200 From: D?ster Horst <[email protected]> Subject: [postgis-users] st_intersection error To: postgis-users <[email protected]> Message-ID: <h00002eb058418d3.1252996988.srsofaioi6145.ktso...@mhs> Content-Type: text/plain; charset="iso-8859-1" I do have 2 simple linestrings which partly have the same geometry (see attached dump and image). My aim is to detect the common part of these two linestrings with the following query: select st_intersection(a.the_geom, b.the_geom), a.myid from aline1, aline2 But as the result I get a geometrycollection with one POINT and one LINESTING. I expected one linestring. Is it a bug?? I'll appreciate any hints. My system: Postgis 1.4.0 Geos 3.1.1 Postgres 8.3.6 Best regards Dr. Horst D?ster Stv. Amtschef / GIS-Koordinator Kanton Solothurn Bau- und Justizdepartement Amt f?r Geoinformation SO!GIS Koordination R?tistrasse 4 CH-4501 Solothurn Telefon ++41(0)32 627 25 32 Telefax ++41(0)32 627 22 14 mailto:[email protected] http://www.agi.so.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/d3b3b03b/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: aline1.sql Type: application/octet-stream Size: 1199 bytes Desc: not available URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/d3b3b03b/attachment-0003.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: aline2.sql Type: application/octet-stream Size: 1268 bytes Desc: not available URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/d3b3b03b/attachment-0004.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: intersecterror.png Type: application/octet-stream Size: 13093 bytes Desc: not available URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/d3b3b03b/attachment-0005.obj> ------------------------------ Message: 14 Date: Tue, 15 Sep 2009 10:03:58 +0200 From: <[email protected]> Subject: Re: [postgis-users] multipoint2point To: "PostGIS Users Discussion" <[email protected]> Message-ID: <89b0dfa22a7b49eea95f836faf78e...@sven> Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original thank you very much ST_MULTI works fine and solves my problem, is there a function to cast a MULTIPOINT to POINT? ----- Original Message ----- From: "Richard Greenwood" <[email protected]> To: "PostGIS Users Discussion" <[email protected]> Sent: Tuesday, September 15, 2009 5:25 AM Subject: Re: [postgis-users] multipoint2point > You could use st_multi() to cast them al to multi point: > ST_Multi(geometry) > > Returns the geometry as a MULTI* geometry. If the geometry is > already a MULTI*, it is returned unchanged. > > SELECT ST_MULTI(wkb_geometry) FROM table; > > > On Mon, Sep 14, 2009 at 6:22 AM, <[email protected]> wrote: >> Hi, >> I have a postgistable with different geometrytyps in one table: points >> and >> multipoints (get this information via ST_GeometryType). >> UMN Mapserver have no problems to show the geometrys, but if I try to >> export >> this table via ogr2ogr there is an error: >> Attempt to write non-poin(MULTIPOINT) to point shapefile. >> How can I cast all my geometrys to point? >> Jo >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > > > > -- > Richard Greenwood > [email protected] > www.greenwoodmap.com > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > ------------------------------ Message: 15 Date: Tue, 15 Sep 2009 10:07:27 +0200 From: [email protected] Subject: Re: [postgis-users] multipoint2point To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="iso-8859-1" You can use st_dump for that pupose. Then you will get one row per point in your multipoint. select (st_dump(the_multipoint)).geom from thetable /Nicklas 2009-09-15 wrote: thank you very much ST_MULTI works fine and solves my problem, is there a >function to cast a MULTIPOINT to POINT? > > >----- Original Message ----- >From: "Richard Greenwood" >To: "PostGIS Users Discussion" >Sent: Tuesday, September 15, 2009 5:25 AM >Subject: Re: [postgis-users] multipoint2point > > >> You could use st_multi() to cast them al to multi point: >> ST_Multi(geometry) >> >> Returns the geometry as a MULTI* geometry. If the geometry is >> already a MULTI*, it is returned unchanged. >> >> SELECT ST_MULTI(wkb_geometry) FROM table; >> >> >> On Mon, Sep 14, 2009 at 6:22 AM,wrote: >>> Hi, >>> I have a postgistable with different geometrytyps in one table: points >>> and >>> multipoints (get this information via ST_GeometryType). >>> UMN Mapserver have no problems to show the geometrys, but if I try to >>> export >>> this table via ogr2ogr there is an error: >>> Attempt to write non-poin(MULTIPOINT) to point shapefile. >>> How can I cast all my geometrys to point? >>> Jo >>> _______________________________________________ >>> postgis-users mailing list >>> [email protected] >>> http://postgis.refractions.net/mailman/listinfo/postgis-users >>> >> >> >> >> -- >> Richard Greenwood >> [email protected] >> www.greenwoodmap.com >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > >_______________________________________________ >postgis-users mailing list >[email protected] >http://postgis.refractions.net/mailman/listinfo/postgis-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/097326a9/attachment-0001.html> ------------------------------ Message: 16 Date: Tue, 15 Sep 2009 10:27:01 +0200 From: strk <[email protected]> Subject: Re: [postgis-users] st_intersection error To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 On Tue, Sep 15, 2009 at 08:43:10AM +0200, D??ster Horst wrote: > I do have 2 simple linestrings which partly have the same geometry (see > attached dump and image). My aim is to detect the common part of these > two linestrings with the following query: > > select st_intersection(a.the_geom, b.the_geom), a.myid > from aline1, aline2 > > But as the result I get a geometrycollection with one POINT and one > LINESTING. I expected one linestring. Is it a bug?? > I'll appreciate any hints. Could be a bug, or a dimensional collapse. Try posting the geometries, Martin Davis might have a try with JTS. Try also upgrading GEOS. --strk; > > My system: > Postgis 1.4.0 > Geos 3.1.1 > Postgres 8.3.6 > > Best regards > > Dr. Horst D?ster > Stv. Amtschef / GIS-Koordinator > > Kanton Solothurn > Bau- und Justizdepartement > Amt f?r Geoinformation > SO!GIS Koordination > R?tistrasse 4 > CH-4501 Solothurn > > Telefon ++41(0)32 627 25 32 > Telefax ++41(0)32 627 22 14 > > mailto:[email protected] > http://www.agi.so.ch > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users -- Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ------------------------------ Message: 17 Date: Tue, 15 Sep 2009 11:32:48 +0200 From: D?ster Horst <[email protected]> Subject: Re: [postgis-users] st_intersection error To: postgis-users <[email protected]>, strk <[email protected]> Message-ID: <h00002eb058418dd.1253007168.srsofaioi6145.ktso...@mhs> Content-Type: text/plain; charset="iso-8859-1" strk I attached the geometries in my initial mail. Take a look at aline1.sql and aline2.sql regards Horst ------------------------------------------------ Dr. Horst D?ster Stv. Amtschef / GIS-Koordinator Kanton Solothurn Bau- und Justizdepartement Amt f?r Geoinformation SO!GIS Koordination R?tistrasse 4 CH-4501 Solothurn Telefon ++41(0)32 627 25 32 Telefax ++41(0)32 627 22 14 mailto:[email protected] http://www.agi.so.ch -----Urspr?ngliche Nachricht----- Von: strk [mailto:[email protected]] Gesendet am: Dienstag, 15. September 2009 10:27 An: PostGIS Users Discussion Betreff: Re: [postgis-users] st_intersection error On Tue, Sep 15, 2009 at 08:43:10AM +0200, D??ster Horst wrote: > I do have 2 simple linestrings which partly have the same geometry (see > attached dump and image). My aim is to detect the common part of these > two linestrings with the following query: > > select st_intersection(a.the_geom, b.the_geom), a.myid > from aline1, aline2 > > But as the result I get a geometrycollection with one POINT and one > LINESTING. I expected one linestring. Is it a bug?? > I'll appreciate any hints. Could be a bug, or a dimensional collapse. Try posting the geometries, Martin Davis might have a try with JTS. Try also upgrading GEOS. --strk; > > My system: > Postgis 1.4.0 > Geos 3.1.1 > Postgres 8.3.6 > > Best regards > > Dr. Horst D?ster > Stv. Amtschef / GIS-Koordinator > > Kanton Solothurn > Bau- und Justizdepartement > Amt f?r Geoinformation > SO!GIS Koordination > R?tistrasse 4 > CH-4501 Solothurn > > Telefon ++41(0)32 627 25 32 > Telefax ++41(0)32 627 22 14 > > mailto:[email protected] > http://www.agi.so.ch > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users -- Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/202c8a98/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: aline1.sql Type: application/octet-stream Size: 1199 bytes Desc: not available URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/202c8a98/attachment-0002.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: aline2.sql Type: application/octet-stream Size: 1268 bytes Desc: not available URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/202c8a98/attachment-0003.obj> ------------------------------ Message: 18 Date: Tue, 15 Sep 2009 11:53:54 +0200 From: strk <[email protected]> Subject: Re: [postgis-users] st_intersection error To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=iso-8859-1 On Tue, Sep 15, 2009 at 11:32:48AM +0200, D??ster Horst wrote: > strk > > I attached the geometries in my initial mail. > > Take a look at aline1.sql and aline2.sql I confirm a POINT and a LINESTRING in a COLLECTION is returned by ST_Intersection() with latest version: POSTGIS="1.5.0SVN" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.0, 21 Dec 2007" USE_STATS Martin, how about JTS ? --strk; Free GIS & Flash consultant/developer () ASCII Ribbon Campaign http://foo.keybit.net/~strk/services.html /\ Keep it simple! ------------------------------ Message: 19 Date: Tue, 15 Sep 2009 12:50:09 +0200 From: [email protected] Subject: Re: [postgis-users] st_intersection error To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset="iso-8859-1" The problem is the vertex represented only in line 2 between your resulting line and point 'POINT(618971.85092967 251568.179431664) . Because of precision aspects it will never be exactly on the line causing st_intersection find only the point and line to be exactly the same place. /Nicklas 2009-09-15 D??ster Horst wrote: > I do have 2 simple linestrings which partly have the same geometry (see attached dump and image). My aim is to detect the common part of these two linestrings with the following query: >> select st_intersection(a.the_geom, b.the_geom), a.myid >from aline1, aline2 >> But as the result I get a geometrycollection with one POINT and one LINESTING. I expected one linestring. Is it a bug?? >I'll appreciate any hints. >> My system: >Postgis 1.4.0 >Geos 3.1.1 >Postgres 8.3.6 >> Best regards >> Dr. Horst D?ster >Stv. Amtschef / GIS-Koordinator >> Kanton Solothurn >Bau- und Justizdepartement >Amt f?r Geoinformation >SO!GIS Koordination >R?tistrasse 4 >CH-4501 Solothurn >> Telefon ++41(0)32 627 25 32 >Telefax ++41(0)32 627 22 14 >> mailto:[email protected] >www.agi.so.ch > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://postgis.refractions.net/pipermail/postgis-users/attachments/20090915/ee7cc43b/attachment-0001.html> ------------------------------ Message: 20 Date: Tue, 15 Sep 2009 08:23:52 -0700 From: Kevin Neufeld <[email protected]> Subject: Re: [postgis-users] No Primary Key To: [email protected], PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed P Kishor wrote: >> create table coal AS SELECT * from geology where group_='GONDWANA'; >> >> But the resultant table coal is not having a 'primary key'. >> table geology has gid as primary key. >> >> Pl give me a way how I can get a primary key on table coal. >> ALTER TABLE coal ADD PRIMARY KEY (gid); ANALYZE coal; ------------------------------ Message: 21 Date: Tue, 15 Sep 2009 08:54:03 -0700 From: Martin Davis <[email protected]> Subject: Re: [postgis-users] st_intersection error To: PostGIS Users Discussion <[email protected]>, Martin Davis <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Same result in JTS. As Nicklas points out, this is a problem of precision. The software is working as designed, but it's not designed to use it to perform intersections with a tolerance. Some more sophisticated approach is required, such as vertex snapping the lines to a given tolerance, or perhaps using a narrow buffer and some sort of segment-based containment tests. strk wrote: > On Tue, Sep 15, 2009 at 11:32:48AM +0200, D??ster Horst wrote: > >> strk >> >> I attached the geometries in my initial mail. >> >> Take a look at aline1.sql and aline2.sql >> > > I confirm a POINT and a LINESTRING in a COLLECTION > is returned by ST_Intersection() with latest version: > > POSTGIS="1.5.0SVN" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.0, 21 Dec 2007" > USE_STATS > > Martin, how about JTS ? > > --strk; > > Free GIS & Flash consultant/developer () ASCII Ribbon Campaign > http://foo.keybit.net/~strk/services.html /\ Keep it simple! > > -- Martin Davis Senior Technical Architect Refractions Research, Inc. (250) 383-3022 ------------------------------ Message: 22 Date: Tue, 15 Sep 2009 19:20:38 +0200 From: Stefan Keller <[email protected]> Subject: Re: [postgis-users] PostGIS to DXF output To: PostGIS Users Discussion <[email protected]> Message-ID: <[email protected]> Content-Type: text/plain; charset=ISO-8859-1 I think that Frank Wamerdam is working on a DXF in/out driver for OGR without dependencies. Not sure if it's out before end of year. If you anyone has any DXF test samples that would be helpful. Yours, S. 2009/9/9 Paul Ramsey <[email protected]>: > Not that I know of opensource-wise. FMEServer from Safe Software > (www.safe.com) will give you every format under the sun and can read > from PostGIS. > > P. > > On Tue, Sep 8, 2009 at 5:50 PM, GIS<[email protected]> wrote: >> >> Hi, I have a question concerning DXF/DWG output. >> On our mapping website http://en.nunagis.gl users can download our postgis >> data as TAB, DGN, SHP, GML and other formats supported by ogr. However, we >> would like them to be able to download dxf files, too. As far as I know, >> this is not possible through ogr. >> Any other possibilities at hand? >> >> Karl >> >> >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> >> > _______________________________________________ > postgis-users mailing list > [email protected] > http://postgis.refractions.net/mailman/listinfo/postgis-users > ------------------------------ _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users End of postgis-users Digest, Vol 85, Issue 15 ********************************************* _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
