I ceated my table (borne) in PostGIS
id_borne serial NOT NULL,
num_borne character varying,
shape_borne geometry
I successfully changed the SRID of my table using
select UpdateGeometrySRID('public', 'borne', 'shape_borne', 26191) ;
The old SRID was 0.
The problem is that when I try to add a new element to my table borne
I have this message error:
geometry srid (0) does not match column srid (26191)
That is my problem! The SRID is updated but when I try to add a new point, I get this message.
Answer
What's happening is that the data you are trying to insert does not have an SRID assigned. To assign one, try wrapping the inserted geometry in your insert statement with ST_SetSRID(). E.g.,
INSERT INTO public.borne (num_borne, shape_borne)
(SELECT num_borne, ST_SetSRID(shape_borne, 26191)
FROM public.sometable);
or
INSERT INTO public.borne (num_borne, shape_borne)
VALUES (1, ST_SetSRID(ST_MakePoint(25800 , 256000), 26191));
No comments:
Post a Comment