pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedpostgres for spatial data
4+ messages / 4 participants
[nested] [flat]
* postgres for spatial data
@ 1998-07-10 09:05 David Gross <David.Gross@lri.fr>
1998-07-10 17:49 ` Re: [INTERFACES] postgres for spatial data Peter T Mount <peter@retep.org.uk>
0 siblings, 1 reply; 4+ messages in thread
From: David Gross @ 1998-07-10 09:05 UTC (permalink / raw)
To: pgsql-interfaces
Hello,
I want to use postgres as a spatial database manager.
I'm looking for a graphical interface that can display the
geometric types like polygon,...
I'm also looking for SQL extension in order to make
spatial queries (for example, a function that tells if a point
belongs to the interior of a polygon)
Thanks for your help,
David
dgross@lri.fr
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] postgres for spatial data
1998-07-10 09:05 postgres for spatial data David Gross <David.Gross@lri.fr>
@ 1998-07-10 17:49 ` Peter T Mount <peter@retep.org.uk>
0 siblings, 0 replies; 4+ messages in thread
From: Peter T Mount @ 1998-07-10 17:49 UTC (permalink / raw)
To: David Gross <David.Gross@lri.fr>; +Cc: pgsql-interfaces
On Fri, 10 Jul 1998, David Gross wrote:
> Hello,
>
> I want to use postgres as a spatial database manager.
> I'm looking for a graphical interface that can display the
> geometric types like polygon,...
The reason I started working on the JDBC driver was so that I could use
postgres for Spatial work with another project of mine. (I've been working
partly with GIS for the last four years).
Anyhow, on the java front, the other project is an astronomical toolkit
that uses postgres as a storage medium, and employs several GIS techniques
for chart generation.
Any how, I'm hoping to have the initial release of it to be out around the
same time as postgresql 6.4 is out.
> I'm also looking for SQL extension in order to make
> spatial queries (for example, a function that tells if a point
> belongs to the interior of a polygon)
I haven't got that far on the spatial queries yet (most of the work I've
done so far uses just points).
Also, the available functions are all two dimensional, and I will need
to handle spherical geometry in queries at some point.
--
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] postgres for spatial data
@ 1998-07-11 14:09 Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1998-07-12 04:53 ` Re: [INTERFACES] postgres for spatial data Stephen Davies <scldad@sdc.com.au>
0 siblings, 1 reply; 4+ messages in thread
From: Thomas G. Lockhart @ 1998-07-11 14:09 UTC (permalink / raw)
To: dgross@lri.fr; +Cc: pgsql-interfaces
> I'm looking for a graphical interface that can display the
> geometric types like polygon,...
Don't know about pre-built utilities for graphical display of geometric
objects. Let us know what you discover.
> I'm also looking for SQL extension in order to make
> spatial queries (for example, a function that tells if a point
> belongs to the interior of a polygon)
There are already some operators available; for example, the "@"
operator is for "on or inside":
postgres=> select '(0,0)'::point
postgres-> @ '((0,1),(1,0),(0,-1),(-1,0))'::polygon;
?column?
--------
t
(1 row)
Look in the hardcopy or html doc set which is included in v6.3.x. You
need to do a "make install" from the doc directory to get them unpacked.
Good luck...
- Tom
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [INTERFACES] postgres for spatial data
1998-07-11 14:09 Re: [INTERFACES] postgres for spatial data Thomas G. Lockhart <lockhart@alumni.caltech.edu>
@ 1998-07-12 04:53 ` Stephen Davies <scldad@sdc.com.au>
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Davies @ 1998-07-12 04:53 UTC (permalink / raw)
To: Thomas G. Lockhart <lockhart@alumni.caltech.edu>; +Cc: pgsql-interfaces
> > I'm looking for a graphical interface that can display the
> > geometric types like polygon,...
>
> Don't know about pre-built utilities for graphical display of geometric
> objects. Let us know what you discover.
>
> > I'm also looking for SQL extension in order to make
> > spatial queries (for example, a function that tells if a point
> > belongs to the interior of a polygon)
>
> There are already some operators available; for example, the "@"
> operator is for "on or inside":
>
> postgres=> select '(0,0)'::point
> postgres-> @ '((0,1),(1,0),(0,-1),(-1,0))'::polygon;
> ?column?
> --------
> t
> (1 row)
>
> Look in the hardcopy or html doc set which is included in v6.3.x. You
> need to do a "make install" from the doc directory to get them unpacked.
> Good luck...
>
> - Tom
The "point in poly" code in the release package looks rather complicated and
uses lots of calls. The fastest PinP that I have found is the following (coded
here in basic but readily translatable to anything else).
(The underlying algorithms are the same - just the coding differs).
Cheers,
Stephen.
Function TestPoly(X As Double, Y As Double) As Boolean
' check if point X,Y is inside a polygon. Return true if ins%<>0
'
' Polygon coordinates are in global arrays PX and PY.
' The number of coordinates is in global nP.
'
Dim X1 As Double, X2 As Double, Y1 As Double, Y2 As Double
Dim ins As Boolean
ins = False
j% = nP - 1
For i% = 0 To nP - 1
X1 = PX(j%)
X2 = PX(i%)
Y1 = PY(j%)
Y2 = PY(i%)
If X1 < X And X <= X2 Then
If (Y - Y1) * (X2 - X1) < (Y2 - Y1) * (X - X1) Then
ins = Not ins
End If
ElseIf X2 < X And X <= X1 Then
If (Y - Y2) * (X1 - X2) < (Y1 - Y2) * (X - X2) Then
ins = Not ins
End If
End If
j% = i%
Next i%
TestPoly = ins
End Function
========================================================================
Stephen Davies Consulting scldad@sdc.com.au
Adelaide, South Australia. Voice: 61-8-82728863
Computing & Network solutions. Fax: 61-8-82741015
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~1998-07-12 04:53 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-10 09:05 postgres for spatial data David Gross <David.Gross@lri.fr>
1998-07-10 17:49 ` Peter T Mount <peter@retep.org.uk>
1998-07-11 14:09 Re: [INTERFACES] postgres for spatial data Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1998-07-12 04:53 ` Stephen Davies <scldad@sdc.com.au>
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