
I am interested in contributing to the development effort of mkgmap and have come up with what should be a simple project to begin with. I am thinking of adding a clip box to the splitter so that any nodes outside the box will be ignored, and any lines, polygons will be clipped to the clip box (I have chosen clip so as not to confuse it with the bounds option). This has come about as I have been generating a map for Sri Lanka as I am going on holiday there in October. Cloudmade has a separate extract for Sri Lanka, but is very out of date. To get up-to-date data I have to download all of Asia from Geofabrik and process the whole lot, loading into Mapsource, then selecting the few tiles that cover Sri Lanka and transferring them to device. By supplying a clip box I could give a lat,long combination for the bottom left and top right corner; and clip to that – in the case of Sri Lanka the splitter would probably give me a single tile to process through mkgmap. It would also mean I do not need Mapsource to produce a gmapsupp.img file at all. If anyone knows why I should not try this project please let me know. A question: Is there a preferred development environment system for mkgmap or splitter on Windows, such a Eclipse or NetBeans??? Regards, Geoff.

Hi Geoff, clipping is already implemented by osmosis or osmconvert. But this requires another step to generate the map. So I think it is a good idea to add this option to splitter. I expect that clipping will not be as easy as it sounds like. If you have a way that intersects the clipping area you need the points inside the clipping area (easy) but also the first point outside the clippling area (not so easy). If you want to be correct you have to read and store all nodes because you cannot be sure that a node outside the clipping is not the first "outer" node of a way. Regarding the dev tools: there is no specific tool required. I use Eclipse but you are free to choose. WanMil
I am interested in contributing to the development effort of mkgmap and have come up with what should be a simple project to begin with. I am thinking of adding a clip box to the splitter so that any nodes outside the box will be ignored, and any lines, polygons will be clipped to the clip box (I have chosen clip so as not to confuse it with the bounds option). This has come about as I have been generating a map for Sri Lanka as I am going on holiday there in October. Cloudmade has a separate extract for Sri Lanka, but is very out of date. To get up-to-date data I have to download all of Asia from Geofabrik and process the whole lot, loading into Mapsource, then selecting the few tiles that cover Sri Lanka and transferring them to device. By supplying a clip box I could give a lat,long combination for the bottom left and top right corner; and clip to that – in the case of Sri Lanka the splitter would probably give me a single tile to process through mkgmap. It would also mean I do not need Mapsource to produce a gmapsupp.img file at all. If anyone knows why I should not try this project please let me know. A question: Is there a preferred development environment system for mkgmap or splitter on Windows, such a Eclipse or NetBeans??? Regards, Geoff.

I must admit to not using osmosis or osmconvert before. The latter seems ideal for the clipping a pbf file (I feel foolish to have not asked earlier). I would still like to add this functionality as part of the splitter as it would make the whole process much faster (and give me a start in the development process). But I agree it will not be as simple as it sounds. Especially for complex polygons which may need to be clipped in a number of places if they repeatedly cross the clip boundary. Regards, Geoff. On September 16, 2012 11:17 AM, WanMil wrote: -----Original Message----- From: WanMil Sent: Sunday, September 16, 2012 11:17 AM To: Development list for mkgmap Subject: Re: [mkgmap-dev] New clip box functionality for splitter Hi Geoff, clipping is already implemented by osmosis or osmconvert. But this requires another step to generate the map. So I think it is a good idea to add this option to splitter. I expect that clipping will not be as easy as it sounds like. If you have a way that intersects the clipping area you need the points inside the clipping area (easy) but also the first point outside the clippling area (not so easy). If you want to be correct you have to read and store all nodes because you cannot be sure that a node outside the clipping is not the first "outer" node of a way. Regarding the dev tools: there is no specific tool required. I use Eclipse but you are free to choose. WanMil
I am interested in contributing to the development effort of mkgmap and have come up with what should be a simple project to begin with. I am thinking of adding a clip box to the splitter so that any nodes outside the box will be ignored, and any lines, polygons will be clipped to the clip box (I have chosen clip so as not to confuse it with the bounds option). This has come about as I have been generating a map for Sri Lanka as I am going on holiday there in October. Cloudmade has a separate extract for Sri Lanka, but is very out of date. To get up-to-date data I have to download all of Asia from Geofabrik and process the whole lot, loading into Mapsource, then selecting the few tiles that cover Sri Lanka and transferring them to device. By supplying a clip box I could give a lat,long combination for the bottom left and top right corner; and clip to that – in the case of Sri Lanka the splitter would probably give me a single tile to process through mkgmap. It would also mean I do not need Mapsource to produce a gmapsupp.img file at all. If anyone knows why I should not try this project please let me know. A question: Is there a preferred development environment system for mkgmap or splitter on Windows, such a Eclipse or NetBeans??? Regards, Geoff.
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

I think using osmconvert/osmosis is the usual way and I have no problems with it. To improve speed, you can cut a rectangular once out of a larger extract, split it and create an areas.list-file. For secend time (and each time after this) you use the larger extract and let splitter cut all tiles via your created areas.list-file. Henning

The more I consider this the more complicated it gets. If you take the polygon for a wood selected in JOSM and highlighted in red in the JPG attached. Discarding everything to the left of the light blue line would leave three closed polygons for the wood. Highways are also another worry. If a highway goes outside the clipping area and returns into the clipping area, should the clip bounds be auto-adjusted to allow the whole highway to be included??? How many times should a clip bound be extended before enough is thought to be enough??? Or should the cut be brutal, along the lines the user entered? Now I have used osmconvert I doubt I could write anything that would work faster within the splitter. So I guess I will have to think of a something else as my first project. Regards, Geoff. On September 16, 2012 12:19 PM, Henning wrote: -----Original Message----- From: aighes Sent: Sunday, September 16, 2012 12:19 PM To: Development list for mkgmap Subject: Re: [mkgmap-dev] New clip box functionality for splitter I think using osmconvert/osmosis is the usual way and I have no problems with it. To improve speed, you can cut a rectangular once out of a larger extract, split it and create an areas.list-file. For secend time (and each time after this) you use the larger extract and let splitter cut all tiles via your created areas.list-file. Henning _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

More thoughts to greatly simplify the clipping: As WanMil suggested all nodes would have to be stored along with a flag to show if it initially resides inside or outside the clip box. Each way will then be tested in turn against the min longitude, max longitude, min latitude, max latitude. Taking the min longitude test as an example: If a way goes from inside the clip box (>= min longitude) then goes outside and remains outside, the way will be clipped to min longitude. When it goes inside to outside and returns inside (>= min longitude) no clip occurs, and nodes between are flagged to reside inside the clip box. If a way goes from outside clip box then goes inside and remains inside, the way will be clipped to min longitude. When it goes from outside to inside and returns outside it will need to be determined if the way describes a line or a polygon: if a line it is clipped, if a polygon nodes in the way outside will be flagged to reside inside the clip box Then similar is done for the other clip lines. This would allow breathing of the clip box to to take into account highways, rivers etc, which go outside and return into the clip box. And get rid of complex polygon clipping entirely. Any thoughts? WanMil, I will look at the bounds utility you mentioned. Regards, Geoff. -----Original Message----- From: Geoff Sherlock Sent: Sunday, September 16, 2012 2:42 PM To: Development list for mkgmap Subject: Re: [mkgmap-dev] New clip box functionality for splitter The more I consider this the more complicated it gets. If you take the polygon for a wood selected in JOSM and highlighted in red in the JPG attached. Discarding everything to the left of the light blue line would leave three closed polygons for the wood. Highways are also another worry. If a highway goes outside the clipping area and returns into the clipping area, should the clip bounds be auto-adjusted to allow the whole highway to be included??? How many times should a clip bound be extended before enough is thought to be enough??? Or should the cut be brutal, along the lines the user entered? Now I have used osmconvert I doubt I could write anything that would work faster within the splitter. So I guess I will have to think of a something else as my first project. Regards, Geoff. On September 16, 2012 12:19 PM, Henning wrote: -----Original Message----- From: aighes Sent: Sunday, September 16, 2012 12:19 PM To: Development list for mkgmap Subject: Re: [mkgmap-dev] New clip box functionality for splitter I think using osmconvert/osmosis is the usual way and I have no problems with it. To improve speed, you can cut a rectangular once out of a larger extract, split it and create an areas.list-file. For secend time (and each time after this) you use the larger extract and let splitter cut all tiles via your created areas.list-file. Henning _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
aighes
-
Geoff Sherlock
-
WanMil