Re: [OSM-dev] Multipolygon decoding
On 1/3/2016 2:24 PM, Mikoláš Štrajt wrote: I am developing my own rendering software and I struggled on decoding multipolygon relations. It seems to be bit tricky. I tried to found some info about it, but all I found is this wiki page: http://wiki.openstreetmap.org/wiki/Relation:multipolygon/Algorithm Can you point to some example of code decoding multipolygons? I would especially like something that will be written with renderer in mind (ie source code is part of some renderer). Note that my software decodes OSM XML file itself, I don't want to use PostGIS as backend. libosmium, osm2pgsql, and imposm all have implementations of converting multipolygon relations to geometries. I would recommend using libosmium in your software if at all possible, rather than trying to decode OSM PBFs and XML yourself. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Multipolygon decoding
Hello, Josm renders them and only uses it's own Java objects after reading the XML. There are two rendering phases: Collecting the styles to be rendered and then painting everything on the screen. Here are some hints on where to get started: The generation of styles for a multipolygon is triggered here: > https://github.com/openstreetmap/josm/blob/7a780ca01e8b2b31fbfa243af1db37d032ba7853/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java#L367 Style collection (finding what needs to be drawn): > https://github.com/openstreetmap/josm/blob/7a780ca01e8b2b31fbfa243af1db37d032ba7853/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java#L1837 We inherit the style of the surrounding ways from the multipolygon. That way, multipolygon borders can be rendered like normal ways. > https://github.com/openstreetmap/josm/blob/7a780ca01e8b2b31fbfa243af1db37d032ba7853/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java#L203 Old (deprecated) polygons inherit their style from the outer lines: > https://github.com/openstreetmap/josm/blob/7a780ca01e8b2b31fbfa243af1db37d032ba7853/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java#L301 And finally the real rendering of the area (borders are rendered since their line segments got the style from the multipolygon). > https://github.com/openstreetmap/josm/blob/7a780ca01e8b2b31fbfa243af1db37d032ba7853/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java#L615 Michael Am 03.01.2016 um 23:24 schrieb Mikoláš Štrajt: > Hello, > I am developing my own rendering software and I struggled on decoding > multipolygon relations. It seems to be bit tricky. I tried to found some > info about it, but all I found is this wiki page: http://wiki.openstreetmap. > org/wiki/Relation:multipolygon/Algorithm > > Can you point to some example of code decoding multipolygons? I would > especially like something that will be written with renderer in mind (ie > source code is part of some renderer). > > Note that my software decodes OSM XML file itself, I don't want to use > PostGIS as backend. > > > > ___ > dev mailing list > dev@openstreetmap.org > https://lists.openstreetmap.org/listinfo/dev > ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
[OSM-dev] Multipolygon decoding
Hello, I am developing my own rendering software and I struggled on decoding multipolygon relations. It seems to be bit tricky. I tried to found some info about it, but all I found is this wiki page: http://wiki.openstreetmap. org/wiki/Relation:multipolygon/Algorithm Can you point to some example of code decoding multipolygons? I would especially like something that will be written with renderer in mind (ie source code is part of some renderer). Note that my software decodes OSM XML file itself, I don't want to use PostGIS as backend. -- Mikoláš Štrajt ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Retrieving nodes with a "wikipedia=" OSM tag in a certain area via an OSM API?
Hi, Am 03.01.2016 um 01:29 schrieb Oleksiy Muzalyev: > It is a bit more complicated to display a geolocation when the wikipedia > tag is assigned to an area or a way. It will try to implement it later. > If you're happy with the center point of a way/relation, you can also leverage "out center;", like in the following example: http://overpass-turbo.eu/s/dwC Center points for ways/relations are returned in the following format: -- ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
[OSM-dev] Karlsruhe Hack Weekend in February
Hi, there will be another OSM hack weekend in Karlsruhe on the 27/28 February: http://wiki.openstreetmap.org/wiki/Karlsruhe_Hack_Weekend_February_2016 Everyone is welcome. Bye Frederik -- Frederik Ramm ## eMail frede...@remote.org ## N49°00'09" E008°23'33" ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev