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.

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?

share|improve this question
    
What version of postgis are you using? –  Mapperz May 24 '11 at 16:23
    
Postgis 1.5 for PostgreSQL 8.4 –  againstflow May 24 '11 at 16:28
1  
Try postgis.refractions.net/documentation/manual-1.5SVN/… - Note: PostGIS 2.0 adds extensive support for 3D –  Mapperz May 24 '11 at 16:39
1  
There's already a QGIS ticket: trac.osgeo.org/qgis/ticket/747 –  underdark May 24 '11 at 17:50
add comment

1 Answer

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
share|improve this answer
    
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
    
thanks, I've added it to the list –  Mike T May 25 '11 at 20:04
add comment

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.