当我尝试使用路段之间的点的坐标将数据插入到线表中时,出现此错误消息。
ERROR: parse error - invalid geometry
HINT: "SRID=27700;LINESTRING((5" <-- parse error at position 24 within geometry
SQL state: XX000
部分代码:
NSERT INTO public."RoadSegments"("no", "seg_ID", "description", "location", "length", "the_geom")
VALUES
(1,'Seg_1','Shephards Bush to Royal Crescent','Shephards Bush','540',ST_GeomFromEWKT('SRID=27700;LINESTRING((51.504593 -0.220437),(51.505233 -0.214105))')),
(2,'Seg_2','Royal Crescent to Norland Square','Notting Hill','306',ST_GeomFromEWKT('SRID=27700;LINESTRING((51.505233 -0.214105),(51.506053 -0.209956))')),
(3,'Seg_3','Norland Square to Holland Park','Notting Hill','383',ST_GeomFromEWKT('SRID=27700;LINESTRING((51.506053 -0.209956),(51.507575 -0.204795))')),
(4,'Seg_4','Holland Park to Notting Hill Gate','Notting Hill','477',ST_GeomFromEWKT('SRID=27700;LINESTRING((51.507575 -0.204795),(51
答案 0 :(得分:0)
您的LINESTRING参数中括号似乎过多。请尝试以下操作:
INSERT INTO public."RoadSegments"("no", "seg_ID", "description", "location", "length", "the_geom")
VALUES
(1,'Seg_1','Shephards Bush to Royal Crescent', 'Shephards Bush','540',ST_GeomFromEWKT('SRID=27700;LINESTRING(51.504593 -0.220437,51.505233 -0.214105)')),
(2,'Seg_2','Royal Crescent to Norland Square', 'Notting Hill', '306',ST_GeomFromEWKT('SRID=27700;LINESTRING(51.505233 -0.214105,51.506053 -0.209956)')),
(3,'Seg_3','Norland Square to Holland Park', 'Notting Hill', '383',ST_GeomFromEWKT('SRID=27700;LINESTRING(51.506053 -0.209956,51.507575 -0.204795)')),
(4,'Seg_4','Holland Park to Notting Hill Gate','Notting Hill', '477',ST_GeomFromEWKT('SRID=27700;LINESTRING(51.507575 -0.204795,51 ... '))
这应该是正确的语法(坐标周围没有多余的括号)