Hello!
I'm running osm2pgsql with a flex output for the planet file (77GB PBF). I'm
running this on a VPS with a mounted volume, where I pay by the GB. I'm
wondering how much space PostgreSQL needs to run:
```
osm2pgsql --create --verbose -U postgres -H localhost --slim --output=flex -S
/osm2pgsql.lua /extract.osm.pbf
```
The flex output I'm using is meant to extract all restaurants (nodes, ways, or
relations) from the planet.
I've done something similar by running `osmium tags-filter` with
`nwr/amenity=restaurant` and the output is only ~300MB. But now that I'm
running osm2pgsql directly on the planet file, I'm trying to figure out how
much disk space is needed to run osm2pgsql directly.
## Appendix
/osm2pgsql.lua
```
local restaurants = osm2pgsql.define_table({
name = 'restaurants',
ids = { type = 'any', type_column = 'osm_type', id_column = 'osm_id' },
columns = {
{ column = 'name', type = 'text' },
{ column = 'cuisine', type = 'text' },
{ column = 'amenity', type = 'text' },
{ column = 'tags', type = 'jsonb' },
{ column = 'geom', type = 'point', projection = '4326' }
}})
function process_poi(object, geom)
local r = {
name = object.tags.name,
cuisine = object.tags.cuisine,
amenity = object.tags.amenity,
tags = object.tags,
geom = geom
}
if object.tags.amenity == "restaurant" then
restaurants:insert(r)
end
end
function osm2pgsql.process_node(object)
process_poi(object, object:as_point())
end
function osm2pgsql.process_way(object)
if object.is_closed and object.tags.building then
process_poi(object, object:as_polygon():centroid())
end
end
```
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2262
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/[email protected]>_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving