Re: [OSM-dev] Pyosmium relations

2017-11-24 Thread Sarah Hoffmann
Hi,

On Fri, Nov 24, 2017 at 07:14:00PM +, Xavier Barnada wrote:
> Hi,
> 
> I am working on an aplication to detect specific changes in an area (
> https://github.com/Xevib/changewithin ).
> 
> My doubt is, is there any way to know the lat and lon of each node of a
> relation usign pyosmium?

Pyosmium can only process multipolygon relations into geometries
at the moment (via the area() callback). This might be enough in
your case, if you are really only interested in buildings. Have
a look at the amenity_list.py example to see how to get the
geometry as a Shaply object.

There is no generic mechanism for handling geometries, mainly because
it is rather difficult to come up with a truely generic approach.
Relations can represent a lot of diferent concepts and each needs
a slightly different handling. In your case, for example, I suspect
that you not only want lat/lon of the nodes directly in the relation
but of the nodes of the ways in the relations.

> 
> I tried to solve this problem making "cache" of the nodes on the file but
> this does not seem to be a good strategy

That's essentially what happens when pyosmium processes multipolygon
relations into areas. A node cahce is always needed when working with
OSM data.

I see that you plan to process change files. Please keep in mind
that these files do not contain the complete node or way information
reuqired to obtain the geometry for relations. If you require geometry
information of ways or relations, you need to start from the planet
file (or an excerpt of the area you are interested in) and keep the
current planet state to look up missing information.

Kind regards

Sarah

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


[OSM-dev] Pyosmium relations

2017-11-24 Thread Xavier Barnada
Hi,

I am working on an aplication to detect specific changes in an area (
https://github.com/Xevib/changewithin ).

My doubt is, is there any way to know the lat and lon of each node of a
relation usign pyosmium?

I tried to solve this problem making "cache" of the nodes on the file but
this does not seem to be a good strategy

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