Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a csv of UK postcodes from Ordnance Survey that looks like

SE1 0AA,10,531869,179427,E92000001,E19000003,E18000007,E09000028,E05000536

When I import to QGIS using 'Add Delimited Text Layer', I can declare columns 3 and 4 as x and y and everything plots nicely with a new layer created.

I want to store the same data in PostGIS so I can join other data on the postcode and then plot resulting attributes in QGIS. The postcode table, with the same fields, has no geometry and I can't see a way to declare the x and y columns as coordinates, so it is shown in QGIS as just an attribute table.

Can anyone explain what I have missed? I apologise for any mangled terminology - this may be why I haven't found any solution on the web yet.

share|improve this question

Having loaded the data into QGIS using 'Add Delimited Text Layer' I think the easy way would be to save the layer as a shapefile and then import this to PostGIS using Spit or the DB Manager.

Or am I missing something?

share|improve this answer

If you're putting your delimited text file into a database and then into any GIS, you need an intermediate step. Create a new field (e.g. "Location") of type "geography" (or possibly "geometry"? my database experience is not in PostGIS!), then update it from your X & Y columns. Then when you import it into QGIS, that "Location" field should be automatically recognized as point data, and properly plotted.

I think this is the relevant syntax: PostGIS documentation

share|improve this answer

Your Answer


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.