Is there a way to import a relation using the flex style when that relation doesn't have any related geometry data? I'm trying to import a list of ski resorts in Scotland but one is not being imported correctly. I've done some digging and found that there is a relation which has a lot of ways as members, allowing me to group all those ways, but as there is no geometry field associated with that relation it doesn't appear in the database after I call add_row. In a reduced test case I've found that if I remove the geometry field from the relevant database table, the relation is added correctly. inspect = require('inspect') local tables = {} tables.relations_test = osm2pgsql.define_table({ name = 'relations_test', ids = { type = 'area', id_column = "id"}, columns = { { column = 'name', type = 'text' }, --{ column = 'geom', type = 'geometry' }, } }) function osm2pgsql.process_relation(object) if object:grab_tag('type') == "site" then
end If I remove the commented out lines in the above, my relation is not imported into the table. This suggests to me that each row requires a geometry. If there any way to maintain the geometry field in the row (it's populated for other relations and ways) but allow it to be NULL? asked 24 Aug '22, 15:15 DarkSnow |
It is not possible to have an empty geometry column with the answered 25 Aug '22, 06:35 Jochen Topf |
That's perfect Jochen, I've compiled the new version of osm2pgsql and I can now get the relation with a NULL geometry. Perfect timing on the new version. Thanks for the help. answered 26 Aug '22, 14:34 DarkSnow |