I created two tables with PostGIS, within which I have inserted a shapefile of an Italian region (Apulia) in the first, and the coordinates in the second table.
In both tables are set with the geometry srid 4326, but by importing layers into QGIS, layers are not properly overlapped.
The procedure I followed is the following : I downloaded the following shapefile (link), and I created the sql script with command
$ shp2pgsql -a -c -D -s 4326 -I R16_01 public.puglia > puglia.sql
within the script, the geometry is added to the table in this way:
ALTER TABLE "public"."puglia" ADD PRIMARY KEY (gid);
SELECT AddGeometryColumn('public','puglia','geom','4326','MULTIPOLYGON',2);
similarly, for the table coordinates
SELECT AddGeometryColumn('public','coord','geom','4326','POINT',2);
then I insert into the table coord some coordinates, also occurred via google maps ...
INSERT INTO mapp (gid, cod_istat, geom)
VALUES (2,3, ST_SetSRID (ST_MakePoint (41.8976987992015, 16.121389858102294), 4326));
When I import the layers in QGIS , the overlap is not what I expect . The coordinates that I post are far away from where they should be.
what's wrong ?
EPSG:23032
. Do you useogrinfo -al -so
to check your metadata?ogr2ogr -f "ESRI Shapefile" output.shp input.shp -s_srs EPSG:23032 -t_srs EPSG:4326
ogr2ogr -f "ESRI Shapefile" R16_012.shp R16_01.shp -s_srs EPSG:23032 -t_srs EPSG:4326
and then to insert it into PostGIS, but the result is still wrong in QGIS. The projection in QGIS is 4326