Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

All,

We're loading City and County data into our database, but looking to remove several fields we don't use.

Those fields we do use I'd like our users to simply highlight on a printout I give them based on a schema report from the .SHP we're getting the data from.

Is there a way to get a list of the fields in a SHP or PostGIS layer in a format such as a spreadsheet I can print off and give to users?

Thanks!

-m

share|improve this question
2  
You want to do this from QGIS? Here's how you could get the schema information on a Shapefile from the command line: ogrinfo my_shapefile.shp -al -fid 1 where 1 or some valid fid is given (so that only one feature is described). –  Arthur Sep 4 '13 at 18:50
    
Any particular GIS software you want to, or won't use? How about programming languages? Or are you looking for a generic option? –  RyanDalton Sep 5 '13 at 16:46
    
Generic option short of taking a screen capture...or even short of PGModeler or ArcGIS diagrammer I suppose...nothing custom unless there's no other way...just wondering what's out there... –  mapBaker Sep 6 '13 at 19:06

1 Answer 1

up vote 1 down vote accepted

You can query your database's information schema using pgAdmin to get a list of columns in a particular table, then copy-paste the results into a spreadsheet to distribute. Here's an example of one kind of report you can get:

SELECT column_name, data_type, character_maximum_length
  FROM information_schema.columns 
  WHERE table_schema = 'mySchema'
  AND table_name = 'myTable'
  ORDER BY ordinal_position
share|improve this answer
    
Thank you @dbaston, that did the trick best I've seen so far!!! –  mapBaker Sep 12 '13 at 19:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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