im using php/postgres/postgis in a webapp, im wondering if its possible to get metadata from the db about all shp/geotiff table like (name, projection, type(ship/tiff), date, desc, owner etc ...) i already using geometry_columns table to get some of this data but is not enough for me.

i use this query :

SELECT f_table_catalog, f_table_schema, f_table_name, f_geometry_column, 
   coord_dimension, srid, type
FROM geometry_columns;

Is that data need to be put in the file (shp/tiff) by the file owner (in production time) or is there a table that contain all this stuff ?

  • Have I misunderstood what you were asking? – John Powell Dec 10 '14 at 13:47
  • No your answer is correct im a little bit busy this time sorry for that – noobdev Dec 10 '14 at 13:51
  • 1
    Sorry, I will let you get back to work :D – John Powell Dec 10 '14 at 13:53

The short answer is at production time.

The loaders that I am aware of (shp2pgsql, for example) will load the projection (prj), geometry and attributes (dbf), but things like data and file owner are not part of the shp spec, directly, so there is no way for a loader to know about them.

For tiffs, if you look at the source code for raster2pgsql, there is no mention of metadata or attributes other than the SRID. This is to be expected, as the tiff format allows for arbitrary attributes (meta data) to be created in the header, so coding a correspondence between unknown header attributes and Postgres would be problematic -- unless you used some key/value store like hstore (as osm does for rarely used tags).

Anyway, I digress. Beyond standard metadata that is required for many spatial functions, such as the SRID, there is no mechanism within either shp or tiff loaders for arbitrary metadata and no hidden system tables containing this information. You would have to add them at load time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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