0

I am new to PostGIS. How can I store 2D elevation data? I have uniform raster and for every [x,y], height is set. I want to be able to use this in my queries (something like SELECT height FROM data WHERE index = [10, 15]). I also need to write this data from my C++ application (it is not earth elevation data, it is some "planet" surface, that will be modified) and data retrieval must be realtime to be used on website.

So far I have come up with 2 ideas:

  1. Use geometry and store 3D data 2)
  2. Create "2D table" with N columns and N rows (not PostGIS, but classic Postgre solution)

Any better ideas or ways how this should be solved?

My data are approx. 3000x1500

Martin Perry
  • 491
  • 2
  • 14

2 Answers2

1

How big is your dataset?
You could create a fishnet grid in postgis See here
Then you could interpolate your raster with your grid with various tools (gdal/qgis): see here

Dont forget to index your grid to optimize speed. Good luck

julsbreakdown
  • 1,496
  • 10
  • 21
0

At the end I have used Raster, that is supported by PostGIS directly (but with GDAL extension installed).

It has functions, that suits my needs - see http://postgis.net/docs/manual-2.1/RT_reference.html

I can select value at a certain position directly, also update this value very easy. All operations seems fast enough in read mode (in times of ms).

Martin Perry
  • 491
  • 2
  • 14