Re: [OSM-dev] Import type=site relations or propagate relation tags to members with osm2pgsql

2020-01-09 Thread Andy Townsend

On 09/01/2020 14:07, François Lacombe wrote:


What would be the best solution to get information about type=site 
relations when loading osm data with osm2pgsql?


I'd try first to load type=site objects just like multipolygon but I 
don't really know how to achieve that and what would I get in the DB 
exactly.


The challenge I suspect with "just like multipolygons" is what sort of 
geometry are you expecting from them?    When I last looked near me 
typical usage included things like:


https://www.openstreetmap.org/relation/259892

(just a pair of bus stops)

https://www.openstreetmap.org/relation/8400580

(a collection of nodes and a way that together make up a wind farm)

https://www.openstreetmap.org/relation/5338548/history

(introduced by someone who didn't want to spend the time understanding 
the underlying data)


About the only thing I can think of that does try and process these is 
OpenInfraMap - see https://openinframap.org/#15.2/53.086391/-1.629313 
for the wind farm mentioned above.


In the context of an infrastructure map it's clearly "correct" to draw a 
polygon around the "outside edge" of the relation components, but if you 
were drawing some other sort of map that might not be what you want to 
do at all.


What'd be interesting (to me at least) would be a solution to 
https://github.com/openstreetmap/osm2pgsql/issues/791 (which got closed 
in favour of https://github.com/openstreetmap/osm2pgsql/issues/230 , 
which is essentially the same issue).  It's on the site relation member 
where you'd want to be able to do things based on site relation 
membership, (e.g. "colour it blue if it's part of a wind farm") not on 
the site relation itself.


Best Regards,

Andy



___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] Import type=site relations or propagate relation tags to members with osm2pgsql

2020-01-09 Thread Jochen Topf
Hi!

I am currently working on a new "flex" backend for osm2pgsql that will
make it possible to do what you want. You can read more about it in this
issue: https://github.com/openstreetmap/osm2pgsql/issues/1036

Working code is here: https://github.com/openstreetmap/osm2pgsql/pull/1037

While this work isn't finished, it is good enough to give it a try. In
fact it would be great if you (and others) tried it and gave me some
feedback on how well it works with their use cases.

Jochen

On Thu, Jan 09, 2020 at 03:07:06PM +0100, François Lacombe wrote:
> Date: Thu, 9 Jan 2020 15:07:06 +0100
> From: François Lacombe 
> To: dev@openstreetmap.org
> Subject: [OSM-dev] Import type=site relations or propagate relation tags to
>  members with osm2pgsql
> 
> Hi all,
> 
> What would be the best solution to get information about type=site
> relations when loading osm data with osm2pgsql?
> 
> I'd try first to load type=site objects just like multipolygon but I don't
> really know how to achieve that and what would I get in the DB exactly.
> 
> If it's not possible or desirable, how can tags of type=site relation can
> be propagated to way and/or nodes members?
> 
> By reading this, I understand this point isn't closed nor mature, right?
> https://github.com/openstreetmap/osm2pgsql/issues/230
> 
> Thanks in advance for any help
> 
> François Lacombe

> ___
> dev mailing list
> dev@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev


-- 
Jochen Topf  joc...@remote.org  https://www.jochentopf.com/  +49-351-31778688

___
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev