[postgis-users] Re: postgis-users Digest, Vol 35, Issue 20

orkun temiz at deprem.gov.tr
Thu Sep 15 07:10:48 PDT 2005


postgis-users-request at postgis.refractions.net wrote:

>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. RE: Windows installer and 8.1-dev1 (Mark Cave-Ayland)
>   2. Re: Gentoo/Debian Packages using 1.1.0CVS? (david techer)
>   3. a line' s direction (Hartmut Tschauner)
>   4. Re: Gentoo/Debian Packages using 1.1.0CVS? (strk at refractions.net)
>   5. a line' s direction (Hartmut Tschauner)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Thu, 15 Sep 2005 09:46:00 +0100
>From: "Mark Cave-Ayland" <m.cave-ayland at webbased.co.uk>
>Subject: RE: [postgis-users] Windows installer and 8.1-dev1
>To: "'PostGIS Users Discussion'"
>	<postgis-users at postgis.refractions.net>
>Message-ID:
>	<9EB50F1A91413F4FA63019487FCD251D23925A at WEBBASEDDC.webbasedltd.local>
>Content-Type: text/plain;	charset="US-ASCII"
>
>
>  
>
>>-----Original Message-----
>>From: postgis-users-bounces at postgis.refractions.net
>>[mailto:postgis-users-bounces at postgis.refractions.net] On 
>>Behalf Of Darryl Watson
>>Sent: 13 September 2005 17:09
>>To: PostGIS Users Discussion
>>Subject: Re: [postgis-users] Windows installer and 8.1-dev1
>>
>>
>>This newbie is unclear about the upgrade procedure from
>>PostGIS 1.0.3 to 
>>1.0.4.
>>
>>Do we 1.0.4 over the existing version, or do we need to uninstall
>>1.0.3?  I assume a database dump would be prudent also! 
>>    
>>
>
>
>Hi Darryl,
>
>The rule of thumb is that minor upgrades (e.g. 1.0.3 to 1.0.4) do not
>require a database dump/restore; however there may be a few rare cases where
>it is necessary to dump/restore or execute SQL commands in the database
>depending upon the nature of any bugs - the release notes will contain more
>information on this.
>
>At the moment, I must confess that I just recreate a new database and reload
>any SQL/shape files into the new version directly. However, when I have had
>to upgrade I tend to pg_dump the whole database and then use pg_restore with
>the -L option to restore just the geometry_columns table data, plus any
>tables and indices I have created. It's defintely an area that could be
>improved, especially under Win32 which can't natively run any of the PERL
>update scripts :(
>
>
>Kind regards,
>
>Mark.
>
>------------------------
>WebBased Ltd
>17 Research Way
>Tamar Science Park
>Plymouth
>PL6 8BT 
>
>T: +44 (0)1752 797131
>F: +44 (0)1752 791023
>W: http://www.webbased.co.uk
>
>
>
>
>------------------------------
>
>Message: 2
>Date: Thu, 15 Sep 2005 12:52:37 +0200
>From: david techer <davidtecher at yahoo.fr>
>Subject: Re: [postgis-users] Gentoo/Debian Packages using 1.1.0CVS?
>To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
>Message-ID: <43295275.9000605 at yahoo.fr>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>Hi Mark,
>
>I think my friend Gerald FENOY will answer U as soon as possible.
>
>I hope I don't make mistake...So excuse-me I'll say something wrong
>
>So Why using 1.1.0CVS instead of 1.0.X?
>
>Because 1.1.0CVS, as U know doesn't require PostgreSQL Sources...
>
>On Gentoo If U already have PostgerSQL installed with example thanks to 
>emerge command
>
>when U want to compil/build postgis 1.0.X U will have to download again 
>PostgreSQL sources
>and to compil it again.
>
>(emerge requires it automatically..) before compiling PostGIS.
>
>So it seems not to be interesting to have to compil PostgreSQL one more 
>times if U have a binary distrib already installed...This is the technic 
>from series 1.0.X of PostGIS
>
>Whereas with 1.1.0CVS, PostGIS doesn't need PostgreSQL sources..So in 
>Gentoo, emerge only PostGIS 1.1.0 CVS
>by CVS or tarball....U have to compil it and install it. It doesn't 
>require a second PostgerSQL download, compil, install and so on....
>
>By the way since Gerald FENOY automatically does a postgis 1.1.0 cvs 
>tarball
>when he want to build a PosTGIS ebuild for Gentoo...
>
>I hope what I said is enough understandable :-)
>
>Regards David
>
>
>Mark Cave-Ayland wrote:
>
>  
>
>>Hi everyone,
>>
>>Just looking at some of the reports coming into the mailing list, (in
>>particular Nicol's and Christo's), it appears that the Gentoo and Debian
>>builds are using PostGIS 1.1.0CVS instead of the latest 1.0.x release. Is
>>there any reason why this is so? Would anyone like to volunteer to look
>>after these packages and make sure they reflect the latest 1.0.x stable
>>releases?
>>
>>
>>Kind regards,
>>
>>Mark. 
>>
>>------------------------
>>WebBased Ltd
>>South West Technology Centre
>>Tamar Science Park
>>Plymouth
>>PL6 8BT 
>>
>>T: +44 (0)1752 791021
>>F: +44 (0)1752 791023
>>W: http://www.webbased.co.uk
>>
>>
>>
>>_______________________________________________
>>postgis-users mailing list
>>postgis-users at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>> 
>>
>>    
>>
>
>	
>
>	
>		
>___________________________________________________________________________ 
>Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
>Téléchargez cette version sur http://fr.messenger.yahoo.com
>
>
>------------------------------
>
>Message: 3
>Date: Thu, 15 Sep 2005 18:15:22 +0900
>From: Hartmut Tschauner <hartmut.tschauner at gmail.com>
>Subject: [postgis-users] a line' s direction
>To: postgis-users at postgis.refractions.net
>Message-ID: <97c039f7050915021558734abc at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Skipped content of type multipart/alternative-------------- next part --------------
>-- Function: public.azimuth(geometry, geometry)
>
>-- DROP FUNCTION public.azimuth(geometry, geometry);
>
>CREATE OR REPLACE FUNCTION public.azimuth(geometry, geometry)
>  RETURNS float8 AS
>'
>DECLARE
>   geom1 ALIAS FOR $1;
>   geom2 ALIAS FOR $2;
>   geom2trans geometry;
>
>
>BEGIN
>   IF geom1 IS NULL OR geom2 IS NULL THEN
>
>      RETURN NULL;
>
>   ELSE
>
>      IF isempty(geom1) OR isempty(geom2) OR geometrytype(geom1) != \'POINT\' OR geometrytype(geom2) != \'POINT\' THEN 
>         RETURN NULL;
>      END IF;
>
>   END IF;
>
>
>   IF srid(geom1) != -1 AND srid(geom2) != srid(geom1) THEN
>
>      geom2trans := transform(geom2, srid(geom1));
>
>   ELSE
>
>      geom2trans := geom2;
>
>   END IF;
>
>
>
>   IF x(geom1) = x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>
>      RETURN 0;
>
>   ELSIF x(geom1) = x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>
>      RETURN 180;
>
>   ELSIF y(geom1) = y(geom2trans) AND x(geom1) < x(geom2trans) THEN 
>
>      RETURN 90;
>
>   ELSIF y(geom1) = y(geom2trans) AND x(geom1) > x(geom2trans) THEN 
>
>      RETURN 270;
>
>   ELSIF x(geom1) < x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>
>      RETURN degrees(atan(abs(x(geom1) - x(geom2trans)) / abs(y(geom1) - y(geom2trans))));
>
>   ELSIF x(geom1) < x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>
>      RETURN degrees(atan(abs(y(geom1) - y(geom2trans)) / abs(x(geom1) - x(geom2trans)))) + 90;
>
>   ELSIF x(geom1) > x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>
>      RETURN degrees(atan(abs(x(geom1) - x(geom2trans)) / abs(y(geom1) - y(geom2trans)))) + 180;
>
>   ELSIF x(geom1) > x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>
>      RETURN degrees(atan(abs(y(geom1) - y(geom2trans)) / abs(x(geom1) - x(geom2trans)))) + 270;
>
>   ELSE
>
>      RETURN 0;
>
>   END IF;
>
>
>
>END;
>'
>  LANGUAGE 'plpgsql' VOLATILE;
>
>------------------------------
>
>Message: 4
>Date: Thu, 15 Sep 2005 11:15:28 +0200
>From: strk at refractions.net
>Subject: Re: [postgis-users] Gentoo/Debian Packages using 1.1.0CVS?
>To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
>Message-ID: <20050915091528.GA85373 at keybit.net>
>Content-Type: text/plain; charset=iso-8859-1
>
>David, I understand the will to switch to 1.1.X, but users
>are reporting packages to be versioned 1.0.X ! Also no 1.1.X
>release is out yet, distributing packages for it would increase
>confusion (what version would users be referring to when saying
>1.1.0CVS ?).
>
>I suggest you clearly state the package contains a CVS snapshot and
>patch the Version.config file to include update time in version
>(like 1.1.0CVS-20050915), using same naming convention for the package
>itself.
>
>--strk;
>
>On Thu, Sep 15, 2005 at 12:52:37PM +0200, david techer wrote:
>  
>
>>Hi Mark,
>>
>>I think my friend Gerald FENOY will answer U as soon as possible.
>>
>>I hope I don't make mistake...So excuse-me I'll say something wrong
>>
>>So Why using 1.1.0CVS instead of 1.0.X?
>>
>>Because 1.1.0CVS, as U know doesn't require PostgreSQL Sources...
>>
>>On Gentoo If U already have PostgerSQL installed with example thanks to 
>>emerge command
>>
>>when U want to compil/build postgis 1.0.X U will have to download again 
>>PostgreSQL sources
>>and to compil it again.
>>
>>(emerge requires it automatically..) before compiling PostGIS.
>>
>>So it seems not to be interesting to have to compil PostgreSQL one more 
>>times if U have a binary distrib already installed...This is the technic 
>>from series 1.0.X of PostGIS
>>
>>Whereas with 1.1.0CVS, PostGIS doesn't need PostgreSQL sources..So in 
>>Gentoo, emerge only PostGIS 1.1.0 CVS
>>by CVS or tarball....U have to compil it and install it. It doesn't 
>>require a second PostgerSQL download, compil, install and so on....
>>
>>By the way since Gerald FENOY automatically does a postgis 1.1.0 cvs 
>>tarball
>>when he want to build a PosTGIS ebuild for Gentoo...
>>
>>I hope what I said is enough understandable :-)
>>
>>Regards David
>>
>>
>>Mark Cave-Ayland wrote:
>>
>>    
>>
>>>Hi everyone,
>>>
>>>Just looking at some of the reports coming into the mailing list, (in
>>>particular Nicol's and Christo's), it appears that the Gentoo and Debian
>>>builds are using PostGIS 1.1.0CVS instead of the latest 1.0.x release. Is
>>>there any reason why this is so? Would anyone like to volunteer to look
>>>after these packages and make sure they reflect the latest 1.0.x stable
>>>releases?
>>>
>>>
>>>Kind regards,
>>>
>>>Mark. 
>>>
>>>------------------------
>>>WebBased Ltd
>>>South West Technology Centre
>>>Tamar Science Park
>>>Plymouth
>>>PL6 8BT 
>>>
>>>T: +44 (0)1752 791021
>>>F: +44 (0)1752 791023
>>>W: http://www.webbased.co.uk
>>>
>>>
>>>
>>>_______________________________________________
>>>postgis-users mailing list
>>>postgis-users at postgis.refractions.net
>>>http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>>
>>>
>>>      
>>>
>>	
>>
>>	
>>		
>>___________________________________________________________________________ 
>>Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
>>Téléchargez cette version sur http://fr.messenger.yahoo.com
>>_______________________________________________
>>postgis-users mailing list
>>postgis-users at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-users
>>    
>>
>
>
>------------------------------
>
>Message: 5
>Date: Thu, 15 Sep 2005 18:27:49 +0900
>From: "Hartmut Tschauner" <hartmut.tschauner at gmail.com>
>Subject: [postgis-users] a line' s direction
>To: <postgis-users at postgis.refractions.net>
>Message-ID: <43293e98.5ca403e9.4942.137e at mx.gmail.com>
>Content-Type: text/plain; charset="us-ascii"
>
>
>Hi Ahmet,
>In an earlier message that didn't arrive as part of this thread and with its
>body scrapped, I posted a function (see below) that will calculate azimuth
>between two points. You would pass the start and end points to get the
>direction of a line.
>Cheers,
>Hartmut
>Hartmut Tschauner
>Department of Archaeology
>Seoul National University
>Gwanak-Gu Sillim 9-dong San 56-1
>Seoul, 151-742
>Korea
>ph. +82 (2) 880-9260
>
>
>CREATE OR REPLACE FUNCTION public.azimuth(geometry, geometry)
>  RETURNS float8 AS
>'
>DECLARE
>   geom1 ALIAS FOR $1;
>   geom2 ALIAS FOR $2;
>   geom2trans geometry;
>
>BEGIN
>   IF geom1 IS NULL OR geom2 IS NULL THEN
>      RETURN NULL;
>   ELSE
>      IF isempty(geom1) OR isempty(geom2) OR geometrytype(geom1) !=
>\'POINT\' OR geometrytype(geom2) != \'POINT\' THEN 
>         RETURN NULL;
>      END IF;
>   END IF;
>
>   IF srid(geom1) != -1 AND srid(geom2) != srid(geom1) THEN
>      geom2trans := transform(geom2, srid(geom1));
>   ELSE
>      geom2trans := geom2;
>   END IF;
>
>   IF x(geom1) = x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>      RETURN 0;
>   ELSIF x(geom1) = x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>      RETURN 180;
>   ELSIF y(geom1) = y(geom2trans) AND x(geom1) < x(geom2trans) THEN 
>      RETURN 90;
>   ELSIF y(geom1) = y(geom2trans) AND x(geom1) > x(geom2trans) THEN 
>      RETURN 270;
>   ELSIF x(geom1) < x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>      RETURN degrees(atan(abs(x(geom1) - x(geom2trans)) / abs(y(geom1) -
>y(geom2trans))));
>   ELSIF x(geom1) < x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>      RETURN degrees(atan(abs(y(geom1) - y(geom2trans)) / abs(x(geom1) -
>x(geom2trans)))) + 90;
>   ELSIF x(geom1) > x(geom2trans) AND y(geom1) > y(geom2trans) THEN 
>      RETURN degrees(atan(abs(x(geom1) - x(geom2trans)) / abs(y(geom1) -
>y(geom2trans)))) + 180;
>   ELSIF x(geom1) > x(geom2trans) AND y(geom1) < y(geom2trans) THEN 
>      RETURN degrees(atan(abs(y(geom1) - y(geom2trans)) / abs(x(geom1) -
>x(geom2trans)))) + 270;
>   ELSE
>      RETURN 0;
>   END IF;
>
>END;
>'
>  LANGUAGE 'plpgsql' VOLATILE;
>
>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://lists.refractions.net/pipermail/postgis-users/attachments/20050915/d339e72c/attachment.html
>
>------------------------------
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>End of postgis-users Digest, Vol 35, Issue 20
>*********************************************
>
>
>  
>
thank you for your help about line direction.

I tested:

bzk=> select astext(wkb_geometry) from bartin_fay limit 1;
                          astext
-----------------------------------------------------------
 LINESTRING(458329.385 4604735.295,458326.082 4604735.287)
(1 row)

bzk=> select public.azimuth('point(458329.385 4604735.295)', 
'point(458326.082 4604735.287)');      azimuth
------------------
 269.861227562345
(1 row)

~~~~~~~~~~~~~~~~~~

which function can I use to get end points of lines to input function ?
I have a huge dataset containing linestring geometric data.

kind regards




______________________________________
XamimeLT - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster at deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.




More information about the postgis-users mailing list