Uploading shapefile into postgis

المشرف العام

Administrator
طاقم الإدارة
Dear people of stackoverflow.

I am trying to import some shapefiles into postgis. Now I have an example database within my download of postgis. In this database I can import the shapefile by changing the DBF file character encoding to LATIN1, from the default UTF-8.

When I create my own database and schema the same pattern does not work. The error message received when I use LATIN1 is:

Importing with configuration: gem_2014, public, geom, C:\Users\Sven\Folderstructuur_GIS_Viewer\Brondata_CBS\gem_2014.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=28992Shapefile type: PolygonPostGIS type: MULTIPOLYGON[2]Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;SET STANDARD_CONFORMING_STRINGS TO ON;BEGIN;CREATE TABLE "public"."gem_2014" (gid serial,"gm_code" varchar(6),"gm_naam" varchar(60),"water" varchar(4),"aant_inw" numeric(10,0),"aant_man" numeric(10,0),"aant_vrouw" nume"Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not existLINE 46: SELECT AddGeometryColumn('public','gem_2014','geom','28992',... ^HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Shapefile import failed.

When I use UTF-8 it gives:

Importing with configuration: gem_2014, public, geom, C:\Users\Sven\Folderstructuur_GIS_Viewer\Brondata_CBS\gem_2014.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=28992Shapefile type: PolygonPostGIS type: MULTIPOLYGON[2]Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;SET STANDARD_CONFORMING_STRINGS TO ON;BEGIN;CREATE TABLE "public"."gem_2014" (gid serial,"gm_code" varchar(6),"gm_naam" varchar(60),"water" varchar(4),"aant_inw" numeric(10,0),"aant_man" numeric(10,0),"aant_vrouw" nume"Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not existLINE 46: SELECT AddGeometryColumn('public','gem_2014','geom','28992',... ^HINT: No function matches the given name and argument types. You might need to add explicit type casts.

Shapefile import failed.

For anyone trying to reproduce the situation I am using the following dataset: gem_2014 which can be downloaded from the Dutch national bureau for statistics: http://www.cbs.nl/nl-NL/menu/themas.../archief/2015/wijk-en-buurtkaart-2014-art.htm

I have postgres/gis 9.2

I am especially curious to why it does not work. Because I am planning to work more with Postgis I'd like to understand the problem I have now.



أكثر...
 
أعلى