Re: Storing data on a regular lat/lon grid

Поиск
Список
Период
Сортировка
От Mike Charles
Тема Re: Storing data on a regular lat/lon grid
Дата
Msg-id m2nbced44b41004141447y7ee6c2c1i54aaccf7ff7c5ca7@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Storing data on a regular lat/lon grid  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Basically, has anyone done any work with storing gridded spatial data? I see
lot's of info on Geospatial data, but it's usually cities, stations, etc.,
not a regular grid that doesn't change...

well, you could play around with storing information in arrays.
storing record for each point gives you the most flexibility of
querying and indexing but is extremely inefficient from storage
perspective.   arrays are better from that point of view and can work
pretty well as long as you read/write the data in blocks in a fairly
regular way (and hopefully the layout of your grid doesn't change that
often).

Thanks for your help, I've stored a 2-dimensional array in Postgres, inserted like this:

{{1,1,3},{2,2,1},{3,1,2}}

But I'm having trouble retrieving it from Java. My jdbc driver is loaded fine and I'm connecting to the database, but I don't know how to get from a java.sql Array to an int[] array in Java. I'm using this piece of code to pull the data from the ResultSet:

Array categoryArray = rs.getArray("category").getArray();

But I don't know what to do with this. I want to end up with an int[] array. Can anyone suggest something?

Thanks a lot,

--
Mike

В списке pgsql-general по дате отправления:

Предыдущее
От: Damian Carey
Дата:
Сообщение: Re: pl/java status
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Unique cosntraint based on contents of a field?