As suggested by other answers, the problem is related with the POINT and MULTIPOINT types. shp2pgsql (and ogrinfo) detects the geometry type as MULTIPOINT, but then, when creating the EWKB representation of the geometry (the value to insert in the_geom column), it seems to be generating a POINT geometry:
select geometrytype('0101000020346C000000000000302A0A4100000000304F1C41');
--POINT
(I took the first generated record)
According to the shp2pgsql man page, there is a flag that should force new geometries to be created simple, but apparently, it does not work on points:
-S Generate simple Geometries instead of MULTIgeometries. Shape files don't differ between LINESTRINGs and MULTILINESTRINGs, so shp2pgsql generates MUL‐
TILINESTRINGs by default. This switch will produce LINESTRINGs instead, but shp2pgsql will fail when it hits a real MULTILINESTRING. The same works
for POLYGONs vs. MULTIPOLYGONs.
Instead of dropping the offending constraint, I will suggest changing the geometry column in the generated SQL script before executing it with psql:
SELECT AddGeometryColumn('','strategi_point','the_geom','27700','POINT',2);
This way you will get your records loaded, and at the same time keep a constrain that may ensure your data integrity in the future.
You can use the REST API of GeoServer.
The REST extension provides a RESTful interface through which clients
can configure a GeoServer instance through simple HTTP calls. With it
clients can programatically configure the data served by GeoServer.
This example explains how to upload a shapefile in GeoServer using cURL.
Best Answer
Theoretically, a shapefile can contain about 70 million point features. The size of either the
.shp
or.dbf
files must not exceed 2GB.Also, why bother creating a shapefile to insert to PostGIS? Try directly inserting the data using something like psycopg2, which makes the whole import process simpler, faster, and more direct.
Here are a few short examples to directly insert to PostGIS. First with simple point data, then with more complicated polygon data (a similar geometry construction and WKB export can also be done with OGR).