Обсуждение: Postgres && GIS

Поиск
Список
Период
Сортировка

Postgres && GIS

От
Paul Ramsey
Дата:
I am exploring the possibility of using PostGreSQL for GIS applications
(as I am sure many have before me) and am wondering if there are ready
answers to a few simple questions (the FAQ seems still in it's infancy):

- there are geometric types described in the documentation, is anyone
making substantial use of them and the query tools described also? if
so, for what purpose and using what as an interface layer?

- is the JDBC interface compatible with the geometric types? could it
return a polygon if that was the result of a query, and what would it
look like when returned? conversely, how would one insert a polygon into
a database? it is something I haven't wrapped my head around yet, how
one would insert several hundred vertices of data into a dbase using
standard SQL. Just a great big well formatted text string?

Thanks for your help, I'll try and compile for future generations, of
course.

Paul Ramsey

Re: [GENERAL] Postgres && GIS

От
Peter T Mount
Дата:
Just clearing a small backlog of email, and found this...

On Sun, 9 Aug 1998, Paul Ramsey wrote:

> I am exploring the possibility of using PostGreSQL for GIS applications
> (as I am sure many have before me) and am wondering if there are ready
> answers to a few simple questions (the FAQ seems still in it's infancy):
>
> - there are geometric types described in the documentation, is anyone
> making substantial use of them and the query tools described also? if
> so, for what purpose and using what as an interface layer?

I don't use them as much as I'd like (yet), but I tend to use them for
storing Astronomical Data (think GIS but looking upwards rather than
downwards).

> - is the JDBC interface compatible with the geometric types? could it
> return a polygon if that was the result of a query, and what would it
> look like when returned? conversely, how would one insert a polygon into
> a database? it is something I haven't wrapped my head around yet, how
> one would insert several hundred vertices of data into a dbase using
> standard SQL. Just a great big well formatted text string?

Since 6.2, the Geometric types have been supported with a set of classes.
In 6.3, these were split from the main package, and now the
postgresql.geometric package handles them.

To read a geometric type, use the getObject() method which will return the
appropriate class for the type.

To set, you have two methods:
  * PreparedStatement allows you to use the setObject() method
  * Statement can support the geometric types. The toString() method of
    each class will return the correct SQL value for inserting into a
    query.

> Thanks for your help, I'll try and compile for future generations, of
> course.
>
> Paul Ramsey
>

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf