Answers:
我不知道OSM表的架构,但是您要求这样的查询:
DELETE FROM labels WHERE label_id IN (
SELECT label_id_2 FROM (
SELECT a.label_id AS label_id_1, b.label_id AS label_id_2
FROM labels AS a, labels AS b WHERE STDWithin(a.the_geom,b.the_geom, 0.001) and a.street = b.street and a.label_id != b.label_id
)
)
这可能有效,但最好是为不同方向的同一标签设置一个ID,然后此查询可以100%起作用:
DELETE FROM labels WHERE label_id IN (
SELECT label_id_2 FROM (
SELECT a.label_id AS label_id_1, b.label_id AS label_id_2
FROM labels AS a, labels AS b WHERE a.same_road_label_id = b.same_road_label_id;
)
)