[postgis-users] PostGIS to DXF output
GIS
GIS at asiaq.gl
Wed Sep 16 04:41:24 PDT 2009
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: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] På vegne af postgis-users-request at postgis.refractions.net
Sendt: 15. september 2009 16:00
Til: postgis-users at postgis.refractions.net
Emne: postgis-users Digest, Vol 85, Issue 15
Send postgis-users mailing list submissions to
postgis-users at postgis.refractions.net
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
postgis-users-request at postgis.refractions.net
You can reach the person managing the list at
postgis-users-owner at postgis.refractions.net
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 (pcreso at pcreso.com)
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 (jj.wag at gmx.de)
15. Re: multipoint2point (nicklas.aven at jordogskog.no)
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 (nicklas.aven at jordogskog.no)
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" <dustin at intrcomm.net>
Subject: [postgis-users] Center of Points Collection
To: postgis-users at postgis.refractions.net
Message-ID: <20090914192407.3740B80CAB3 at webmail.intrcomm.net>
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 <pramsey at cleverelephant.ca>
Subject: Re: [postgis-users] Center of Points Collection
To: Dustin Butler <dustin at intrcomm.net>, PostGIS Users Discussion
<postgis-users at postgis.refractions.net>
Message-ID:
<30fe546d0909141228t2e5801d8s766152fe7695049 at mail.gmail.com>
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 <dustin at intrcomm.net> 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
------------------------------
Message: 3
Date: Mon, 14 Sep 2009 16:03:11 -0400
From: Rick <graham.rick at gmail.com>
Subject: Re: [postgis-users] Center of Points Collection
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<18569e000909141303q297c10d9r7c133f712305236a at mail.gmail.com>
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 <pramsey at cleverelephant.ca>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 <dustin at intrcomm.net>
> 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
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> 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 <pramsey at cleverelephant.ca>
Subject: Re: [postgis-users] Center of Points Collection
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<30fe546d0909141313g680b7170jf75bc9cfbc94ed28 at mail.gmail.com>
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 <graham.rick at gmail.com> 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 <pramsey at cleverelephant.ca>
> 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 <dustin at intrcomm.net>
>> 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
>> > postgis-users at postgis.refractions.net
>> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>> >
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> --
> Cheers!
> Rick
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
------------------------------
Message: 5
Date: Mon, 14 Sep 2009 13:51:11 -0700
From: Kevin Neufeld <kneufeld at refractions.net>
Subject: Re: [postgis-users] Center of Points Collection
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <4AAEACBF.9060209 at refractions.net>
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 <graham.rick at gmail.com>
Subject: Re: [postgis-users] Center of Points Collection
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<18569e000909141523q43880f59qc2ae75b04c23e3de at mail.gmail.com>
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 <kneufeld at refractions.net>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
> postgis-users at postgis.refractions.net
> 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" <dustin at intrcomm.net>
Subject: Re: [postgis-users] Center of Points Collection
To: Paul Ramsey <pramsey at cleverelephant.ca>
Cc: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <20090914222508.66CF980CAEE at webmail.intrcomm.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Thanks, that worked great.
Dustin Butler
Intrcomm Technology
Skype: dustinbutler
------ Original Message ------
From: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon, 14 Sep 2009 12:28:27 -0700
To: Dustin Butler <dustin at intrcomm.net>, PostGIS Users Discussion <postgis-users at postgis.refractions.net>
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 <dustin at intrcomm.net> 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
------------------------------
Message: 8
Date: Mon, 14 Sep 2009 15:34:28 -0700 (PDT)
From: Ravi <ravivundavalli at yahoo.com>
Subject: [postgis-users] No Primary Key
To: postgis <postgis-users at postgis.refractions.net>
Message-ID: <674439.74509.qm at web65609.mail.ac4.yahoo.com>
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 <punk.kish at gmail.com>
Subject: Re: [postgis-users] No Primary Key
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<cdf6db500909141612p5962b097nff813ff0955d5bb4 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Sep 14, 2009 at 5:34 PM, Ravi <ravivundavalli at yahoo.com> 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
> postgis-users at postgis.refractions.net
> 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: pcreso at pcreso.com
Subject: Re: [postgis-users] Center of Points Collection
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <536453.95341.qm at web33208.mail.mud.yahoo.com>
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 <kneufeld at refractions.net> wrote:
> From: Kevin Neufeld <kneufeld at refractions.net>
> Subject: Re: [postgis-users] Center of Points Collection
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
------------------------------
Message: 11
Date: Mon, 14 Sep 2009 21:25:13 -0600
From: Richard Greenwood <richard.greenwood at gmail.com>
Subject: Re: [postgis-users] multipoint2point
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<ae9185aa0909142025l179d5822t888f5fd38bea4f79 at mail.gmail.com>
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, <jj.wag at gmx.de> 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
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com
------------------------------
Message: 12
Date: Tue, 15 Sep 2009 11:52:56 +0530
From: poonam jalwan <poonam.jalwan at orkash.com>
Subject: [postgis-users] Pgrouting assign_vertex_id function finding
lat lon values of vertexes problem
To: postgis-users at postgis.refractions.net
Message-ID: <4AAF32C0.6060809 at orkash.com>
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 <Horst.Duester at bd.so.ch>
Subject: [postgis-users] st_intersection error
To: postgis-users <postgis-users at postgis.refractions.net>
Message-ID: <H00002eb058418d3.1252996988.srsofaioi6145.ktso.ch at 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:horst.duester at bd.so.ch
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: <jj.wag at gmx.de>
Subject: Re: [postgis-users] multipoint2point
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
Message-ID: <89B0DFA22A7B49EEA95F836FAF78EAB4 at 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" <richard.greenwood at gmail.com>
To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
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, <jj.wag at gmx.de> 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
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
>
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
------------------------------
Message: 15
Date: Tue, 15 Sep 2009 10:07:27 +0200
From: nicklas.aven at jordogskog.no
Subject: Re: [postgis-users] multipoint2point
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <200909150807.n8F87Ri6011714 at mail-core.space2u.com>
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
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>
>>
>>
>> --
>> Richard Greenwood
>> richard.greenwood at gmail.com
>> www.greenwoodmap.com
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>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 <strk at keybit.net>
Subject: Re: [postgis-users] st_intersection error
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <20090915082701.GB30456 at keybit.net>
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:horst.duester at bd.so.ch
> http://www.agi.so.ch
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> 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 <Horst.Duester at bd.so.ch>
Subject: Re: [postgis-users] st_intersection error
To: postgis-users <postgis-users at postgis.refractions.net>, strk
<strk at keybit.net>
Message-ID: <H00002eb058418dd.1253007168.srsofaioi6145.ktso.ch at 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:horst.duester at bd.so.ch
http://www.agi.so.ch
-----Urspr?ngliche Nachricht-----
Von: strk [mailto:strk at keybit.net]
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:horst.duester at bd.so.ch
> http://www.agi.so.ch
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> 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
postgis-users at postgis.refractions.net
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 <strk at keybit.net>
Subject: Re: [postgis-users] st_intersection error
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <20090915095354.GC30456 at keybit.net>
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: nicklas.aven at jordogskog.no
Subject: Re: [postgis-users] st_intersection error
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID: <200909151050.n8FAo9DN018385 at mail-core.space2u.com>
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:horst.duester at bd.so.ch
>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 <kneufeld at refractions.net>
Subject: Re: [postgis-users] No Primary Key
To: punkish at eidesis.org, PostGIS Users Discussion
<postgis-users at postgis.refractions.net>
Message-ID: <4AAFB188.6080303 at refractions.net>
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 <mbdavis at refractions.net>
Subject: Re: [postgis-users] st_intersection error
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>,
Martin Davis <mbdavis at refractions.net>
Message-ID: <4AAFB89B.9080709 at refractions.net>
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 <sfkeller at gmail.com>
Subject: Re: [postgis-users] PostGIS to DXF output
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Message-ID:
<25bc040b0909151020r2199b87o79d85310c645f60 at mail.gmail.com>
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 <pramsey at cleverelephant.ca>:
> 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<GIS at asiaq.gl> 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
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
------------------------------
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
End of postgis-users Digest, Vol 85, Issue 15
*********************************************
More information about the postgis-users
mailing list