1

I have tables like this:

CREATE TABLE postcode_area_boundaries
(
    ogc_fid INTEGER,
    wkb_geometry GEOMETRY(MultiPolygon,3857),
    postarea VARCHAR(2),
    area_km DOUBLE PRECISION,
    area_mi DOUBLE PRECISION,
);

CREATE TABLE postcode_area_points
(
    ogc_fid INTEGER PRIMARY KEY NOT NULL,
    wkb_geometry GEOMETRY(Point,3857),
    postcodearea VARCHAR(254),
    postcodeareaname VARCHAR(254)
);

I have also 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)

I probably should use ogr2ogr but have no idea how. I am trying with commands like this:

ogr2ogr -f PostgreSQL PG:"<dbconn>" "Postcode Area Boundaries.MIF" -t_srs EPSG:3857 -nlt MULTIPOLYGON -overwrite -nln postcode_area_boundaries

But I have errors like this:

Warning 1: Geometry to be inserted is of type Point, whereas the layer geometry type is Multi Polygon. Insertion is likely to fail ERROR 1: INSERT command for new feature failed. ERROR: Geometry type (Point) does not match column type (MultiPolygon)

Can anyone help me with this?

Your Answer

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

Browse other questions tagged or ask your own question.