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

2 Answers 2

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

6
  • The resolution of my dataset is approx. 3000x1500 Jul 27, 2015 at 12:12
  • Then creating a vector grid is the best bet, I've done this in the past. Jul 27, 2015 at 12:14
  • By vector grid you mean fishnet? Jul 27, 2015 at 12:15
  • Yes, sorry. If it is a oneshot, i would recommend using Qgis. Both tools (fishnet, and pointsamplingtool) are available and easy to use Jul 27, 2015 at 12:19
  • It is not oneshot. Data will be updated from C++ application several times a day. Jul 27, 2015 at 12: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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.