0

I have files:

Postcode Area Boundaries.MID

"AB","Aberdeen"
POLYGON((383707 866131,383465 866240,383302 866387,383202 866505,383089 866586,.....))
"AL","St Albans"
POLYGON((526248 203348,....))
.......

Postcode Area Boundaries.MIF

VERSION 300
DELIMITER ","
COORDSYS EARTH PROJECTION 8,79,"m",-2,49,0.99960127,400000,-100000
COLUMNS 2
  POSTCODEAREA CHAR (0)
  POSTCODEAREANAME CHAR (0)
DATA
POINT 384222.000 819125.000
POINT 518661.000 209809.000
POINT 407763.000 285514.000
POINT 371106.000 147748.000
.... as many points as many was areas in MID file (about 126)

Does anyone know how I can import it into PostGIS? What tables should I create?

nospor
  • 4,190
  • 1
  • 16
  • 25

1 Answers1

0

If you don't specify a target table ogr2ogr will create the target table for you. This should create a new table in your db.

ogr2ogr -f PostgreSQL PG:"<dbconn>" "Postcode Area Boundaries.MIF"
mlinth
  • 2,968
  • 6
  • 30
  • 30
  • Yes, I've noticed that yesterday but still I had problems with loading POLYGON geometry because it is in a new line and ogr2ogr treated it as another record like `"AB","Aberdeen"`. So I gave up and wrote my own script to import this data – nospor Mar 01 '17 at 14:39