[Tile-serving] [osm2pgsql-dev/osm2pgsql] Missing OSM Restrictions in Bounding Box Query After Importing with osm2pgsql (Discussion #2215)

Andreas notifications at github.com
Sat Jul 27 13:33:17 UTC 2024


Hi I’m using osm2pgsql to import OpenStreetMap (OSM) data into a PostgreSQL database for analysis. 
Sadly I’m not seeing all the expected turn restrictions within a specified bounding box.

**osm2pgsql Command:**

`osm2pgsql -U postgres -W -d osm_data -H localhost -s -G --number-processes 30 -C 102400 dach-latest.osm.pbf
`

**Modifications to default.style:**

```
node,way   restriction                    text         linear
node,way   restriction:conditional        text         linear
```

**SQL Query:**

```
SELECT DISTINCT restriction, "restriction:conditional"
FROM planet_osm_line
WHERE highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified',
                  'residential', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link')
AND ST_Intersects(way, ST_Transform(ST_MakeEnvelope(10.91492, 47.41136, 13.41705, 49.07207, 4326), 3857));

```

```
restriction   |              restriction:conditional               
-----------------+----------------------------------------------------
 only_right_turn | 
                 | restriction:conditional=no_parking @ (19:00-06:00)
                 | 
(3 rows)
```

I have verified the presence of more restrictions within this bounding box using  https://ahorn.lima-city.de/tr/ 
which shows a greater variety of restrictions.

**What I’ve Tried:**

Updating Data: Ensured my database is up-to-date with the latest OSM data.
Query Adjustments: Simplified and expanded the query to include all potential restrictions without the highway filter.


**Question:**

What could be causing the discrepancy between the restrictions visible in the external tool and those retrieved from my PostgreSQL database? 

Are there any additional configurations or steps I should consider to ensure all relevant restrictions are captured?

Any insights or suggestions would be greatly appreciated!

Thank you!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2215
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2215 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20240727/4e770103/attachment.htm>


More information about the Tile-serving mailing list