pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Need a little help with geometric query
2+ messages / 2 participants
[nested] [flat]

* Need a little help with geometric query
@ 2011-08-25 22:56  lxnf98mm@comcast.net
  0 siblings, 1 reply; 2+ messages in thread

From: lxnf98mm@comcast.net @ 2011-08-25 22:56 UTC (permalink / raw)
  To: pgsql-sql

This is my first shot at using postgresql's geometric functions
I have a passel of lines defined by x1 y1 x2 y2
I created a table with type lseg and loaded it
I start by finding the line that has an end closest to 0,0
Now I want to find the next line that has an end closest to the first line's other end and so on
I want to find the shortest path
I see there are a lot of geometric operators but I am a bit baffled
Can someone offer suggestions or reading references

Thanks
Richard



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Need a little help with geometric query
@ 2011-08-26 00:08  Samuel Gendler <sgendler@ideasculptor.com>
  parent: lxnf98mm@comcast.net
  0 siblings, 0 replies; 2+ messages in thread

From: Samuel Gendler @ 2011-08-26 00:08 UTC (permalink / raw)
  To: lxnf98mm@comcast.net; +Cc: pgsql-sql

On Thu, Aug 25, 2011 at 3:56 PM, <lxnf98mm@comcast.net> wrote:

> This is my first shot at using postgresql's geometric functions
> I have a passel of lines defined by x1 y1 x2 y2
> I created a table with type lseg and loaded it
> I start by finding the line that has an end closest to 0,0
> Now I want to find the next line that has an end closest to the first
> line's other end and so on
> I want to find the shortest path
> I see there are a lot of geometric operators but I am a bit baffled
> Can someone offer suggestions or reading references
>

Forget about the built-in geometry types and operators in postgres.  You
really want to take a look at postGIS for doing geometric calculations.  It
has a much more diverse set of operators and functions and adheres to
various GIS standards which will allow your db to interact with other GIS
tools as well. It is quite easy to learn and there is an excellent book
which, I believe, also has an electronic edition available so you can start
reading immediately.  Finding a geometry that is 'closest' to a particular
point or to another 2D geometry (or even 3D in the upcoming version) is
relatively trivial.  I'm sure there is a function, or at least a common
technique, for finding a shortest path between 2 points, since GIS is often
used for mapping applications. It's not my specialty, so I'll leave the
details to your research.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-08-26 00:08 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 22:56 Need a little help with geometric query lxnf98mm@comcast.net
2011-08-26 00:08 ` Samuel Gendler <sgendler@ideasculptor.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox