I am trying to export as GeoJson the boundary of the regions of Ghana. My simple query is the following:
My challenge is that when exporting it to GeoJson I do not only get the contour but also a point or two in each region. Is there a way to get rid of it in the query? Right now, my only workaround is to remove it manually which is very slow. asked 11 Nov '22, 20:42 gmacia |
Those points are the administrative centre of each region and the label of each region. The first are nodes with role admin_centre, and the second are nodes with the role label. See this wiki page for more info about type=boundary relation members. You have to use recurse statements to get rid of those two nodes. One query that works is the following one, but there might be simpler ones:
Note 1: You can't use out geom; here, because out geom; adds, among others, a sequence of "nd" members with coordinates to all relations, and therefore you would get those nodes you want to get rid of. Note 2: We could use out body; instead of out meta; if we are not interested in metadata, like version of objets, changeset id, timestamp, and the user data of the user that last touched the object. See this wiki page section for more info about the out standalone statement. answered 07 Jan '23, 18:39 edvac |