Question

Import raster image to Postgis

  • 5 September 2014
  • 9 replies
  • 36 views

Badge +5
Hi everybody,

 

 

I have a raster image(TIFF file). I want to import it to Postgis.

 

How can I do?

 

I tried it : - Reader: read tiff file , - Writer: PostGIS Raster.

 

But I got error. Could you tell me please how can I do?

 

Thank you

 

 

 

 

 


9 replies

Userlevel 2
Badge +17
There should be more detailed error messages above that.

 

Paste all the error messages.
Badge +5
Yes. I tried Reader from Postgis and I got it:

 

 

 

Userlevel 2
Badge +17
The "fme" database could be a non-spatial database. Did you create it as a spatial database (i.e. PostGIS DB)? If you didn't, you have to extend it as a spatial database at first.

 

If you are using pgAdmin III tool, the way described in this page would be a quickest one.

 

Creating a spatial database (http://www.amipci.org.mx:8080/opengeo-docs/dataadmin/pgGettingStarted/createdb.html)
Badge +5
Thank you. The problem is create a spatial database. I can do it :)
Badge +5
I imported in postgis but when I view it in inspect, I saw it has not attribute, It means it is not value. For example: temperature, I dont see value.

 

 

Could you tell me how can I do? Thanks

 

 

 

Userlevel 2
Badge +17
A raster has pixel values but cannot have attributes like vector features. The image looks like a geographic feature of northern Vietnam. I guess the raster have elevation as its pixel value, that's a typical use case of raster on GIS.

 

What kind of result do you expect?
Badge +5
Exactly. It's northern of VietNam :-). Thank you cared Vietnam.

 

I am connecting temperature image to Postgis.

 

When I connected, I check in inspector. I saw It has not value.

 

When I connect postgis to QGIS. I cant open this raster.

 

I saw in this example, it has Value of each pixel:

 

 

 

 

Userlevel 2
Badge +17
Solution depends on the temperature data and your requirement.

 

Just one example. If the data consists of points each of which has temperature as its attribute, this process might work as expected.

 

1) Assign temperature into z-coordinate for each point (3DForcer).

 

2) Create a DEM raster based on the points (RasterDEMGenerator).

 

3) Clip the raster by the interest area (Clipper).

 

4) Write the raster into the database.
Badge +5
Yes. My requirement is transfer Geotiff image to store Postgis.

Reply