5

I have 3D line which I exported from GRASS in .shp format. When I try to insert this line to Postgis database with QuantumGIS, it gives an error:

ERROR: Invalid type name - valid ones are: POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, CIRCULARSTRING, COMPOUNDCURVE, MULTICURVE, CURVEPOLYGON, MULTISURFACE, GEOMETRY, GEOMETRYCOLLECTION, POINTM, MULTIPOINTM, LINESTRINGM, MULTILINESTRINGM, POLYGONM, MULTIPOLYGONM, CIRCULARSTRINGM, COMPOUNDCURVEM, MULTICURVEM CURVEPOLYGONM, MULTISURFACEM, or GEOMETRYCOLLECTIONM CONTEXT: SQL statement "SELECT AddGeometryColumn('', $1 , $2 , $3 , $4 , $5 , $6 )" PL/pgSQL function "addgeometrycolumn" line 4 at SQL statement

Can someone help me? How can I insert this 3d line into postgis database?

2

SPIT can't do this (due to bug #747 mentioned above), so you will need a different method.

Here are a few tools that you can try (and as far as I know, they all work with 3D geometries):

  • shp2pgsql: command-line program, installed with PostGIS
  • shp2pgsql-gui / PostGIS Shapefile and DBF loader: installed with PostGIS, look for it in either pgAdmin III plugins (puzzle icon) or (on MS Windows) Start > Programs > PostGIS for PostgreSQL
  • PostGIS Manager: Python plugin for Quantum GIS, GUI built for shp2pgsql
  • ogr2ogr: command-line program, installed with GDAL/OGR, good for converting other types of files (other than just Shapefiles)
  • ogr2ogr-gui: a nice GUI by Inventis
  • If shp2pgsql can import 3D shapefiles, you can also try QGIS plugin "PostGIS Manager". It offers a GUI for shp2pgsql. – underdark May 25 '11 at 14:01

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.