How to filter data down to a single location

Hello, I am trying to updated my OSM database and map tiles as it has been 5+ years since my last update. My map tiles are pretty simple, in that they only display airports (aerodrome). My old and outdate maps have a single point on the map for O’Hare International Airport. However, when I import the new OSM data, and start rendering the map tiles, I am seeing the multiple points on the map for the same airport.

How can I consolidate the number of locations for O’Hare International Airport (and other airports) down to a single location on the map?

When I download the latest Plant OSM file, I run it through osmfilter with the following options:

osmfilter planet.osm --keep=“aeroway=aerodrome” --keep=“boundary=administrative and admin_level<=4” --keep=“natural=water” -o=planet-min.osm

I am using the Apache with mod_tile, renderd and the OSM Carto Stylesheet’s.

Thank you!

https://overpass-turbo.eu/s/2fTA

There is only one such airport.

From this taginfo link you can click through to all the objects in OSM with that name as a value. As has already been said, only one has that as a name.

What’s in your database?

gis=> select osm_id from planet_osm_point where name like '%Hare International Airport';
 osm_id 
--------
(0 rows)

gis=> select osm_id from planet_osm_line where name like '%Hare International Airport';
 osm_id 
--------
(0 rows)

gis=> select osm_id from planet_osm_polygon where name like '%Hare International Airport';
 osm_id 
--------
(0 rows)

Obviously I don’t have that airport in mine, but what’s in yours?

1 Like

Here is what I see in my database.

psql (13.22)
Type "help" for help.

gis=# select osm_id from planet_osm_point where name like '%Hare International Airport';
 osm_id 
--------
(0 rows)

gis=# select osm_id from planet_osm_line where name like '%Hare International Airport';
 osm_id 
--------
(0 rows)

gis=# select osm_id from planet_osm_polygon where name like '%Hare International Airport';
  osm_id   
-----------
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
 -13423944
(10 rows)

Could there be an issue with the way that I am importing the OSM data into the database? I am using the osm2pgsql docker container.

Probably? I don’t think you shouldn’t have 7 of those…

Edit: To make it clearer “7 of those duplicate entries of the same relation ID”.

This aeroway=aerodrome is a multipolygon relation that contains several polygons.
It looks like you are rendering every single (outer) polygon with the name of the airport-relation.

762081231
1026560350
1201168837

Thanks for the help. I just ended up writing a script to delete the duplicate entries. I ended up keeping the point with the largest way_area figuring bigger is better in this case.