logo separator

[mkgmap-dev] generate-sea is broken from rev 1760

From Apollinaris Schoell aschoell at gmail.com on Sun May 22 22:40:40 BST 2011

Hi Wanmil,

tested the patch and all sea generation is correct now.

Thanks for the good work


On 22 May 2011, at 13:02 , WanMil wrote:

> Hi Apollinaris,
> 
> I have tried your testcase data and for my real big surprise the tile is 
> flooded with mkgmap trunk and the tile is not flooded after removing the 
> code lines you blamed. So you are right.
> 
> In the end the code lines should not be removed because they were added 
> after a problem report. But I found out that the LineClipper which clips 
> the coast lines to the bounding box clips lines perfectly but that's not 
> perfectly for sea polygon creation. In your case a single two point line 
> was remaining which caused the flooding:
> 
>     |
>   --+--
> 
> was clipped (and rejoined) to two lines:
>     |
>     +--
> and
>   --
> 
> The single "--" was expanded to the bbox because of the 
> extend-sea-sectors option. This caused the flooding.
> To avoid this I remove all lines that do not touch the bbox because all 
> clipped lines must touch it at this point of code.
> 
> Could you please test the patch with all of your data?
> 
> Thanks a lot for reporting it!
> 
> WanMil
> 
>> don't have access right now but can run tomorrow.
>> It's really only the change I had sent in the first mail. As soon as I
>> replace SeaGenerator with the old version it works in any revision. If
>> you want to investigate I can send you the osm file offline
>> 
>> 
>> 
>> On Fri, May 20, 2011 at 11:53 AM, WanMil <wmgcnfg at web.de
>> <mailto:wmgcnfg at web.de>> wrote:
>> 
>>    Ok, but that's very important. r1759 cannot be compared. It's a release
>>    from a branch and I don't want to invest time after comparing apples and
>>    pears.
>> 
>>    Between r1750 and 1760 there have been massive changes to the
>>    SeaGenerator class because the floodblocker was merged.
>> 
>>    So could you please check with your testcase data if r1755 produces no
>>    flooding and r1760 does?
>> 
>>    Thanks!
>>    WanMil
>> 
>>> yes correct
>>> 
>>> I have compared many versions from 1700 up until I found 1759 as the
>>> last working version. not sure if 1755 was there too. definitely 1750
>>> 
>>> 
>>> On Fri, May 20, 2011 at 11:37 AM, WanMil <wmgcnfg at web.de
>>    <mailto:wmgcnfg at web.de>
>>> <mailto:wmgcnfg at web.de <mailto:wmgcnfg at web.de>>> wrote:
>>> 
>>>    I am sorry that I have to ask again:
>>> 
>>>    When using the same input data
>>>    r1755 produces no flooding
>>>    r1760 produces flooding
>>> 
>>>    Correct?
>>> 
>>>    r1759 is a branch (maybe the coast branch). So it should not
>>    be used for
>>>    comparison.
>>> 
>>>    WanMil
>>> 
>>>> I have tried both versions and right now I use the latest svn
>>    version
>>>> with SeaGenerator.java from 1759. So I don't have all the
>>    changes for
>>>> floodblocker but I don't need them. All coast is rendered correct
>>>    if the
>>>> tiles contain complete coastlines.
>>>> this is the only code change between 1759 and 1760 so thers can
>>    be no
>>>> other reason.
>>>> 
>>>> 
>>>> On Fri, May 20, 2011 at 10:29 AM, WanMil <wmgcnfg at web.de
>>    <mailto:wmgcnfg at web.de>
>>> <mailto:wmgcnfg at web.de <mailto:wmgcnfg at web.de>>
>>>> <mailto:wmgcnfg at web.de <mailto:wmgcnfg at web.de>
>>    <mailto:wmgcnfg at web.de <mailto:wmgcnfg at web.de>>>> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> the code below was added to SeaGenerater.java in revision 1760.
>>>>    Since then the some flooding happens in a few tiles.
>>>>> before that all sea rendering was correct. I tried also the
>>>>    floodblocker but then part of the sea is not blue anymore. It
>>>    jsut
>>>>    blocks sea in some places but doesn't prevent  the creation
>>>    of bad
>>>>    polygons.
>>>>> I have checked all of the coastline and it is definitely correct
>>>>    and extends in all places beyond the bounds of the tile.
>>>>> If someone want's to debug I can also provide the coastline only
>>>>    for the area. Just too big for this list and can upload or
>>>    send to a
>>>>    private email
>>>>> 
>>>>> I am using
>>>    generate-sea=multipolygon,extend-sea-sectors,close-gaps=10
>>>>> area for splitter is
>>>>> 18900004: 1687552,-5750784 to 1761280,-5685248
>>>>> #       : 36.210938,-123.398438 to 37.792969,-121.992188
>>>>> 
>>>>> This is the code difference in SeaGenerator.java
>>>>>                              if (clipped.size()>  0) {
>>>>>                                      // the LineClipper
>>>>    sometimes returns unjoined clips
>>>>>                                      // need to rejoin them here
>>>>> log.info <http://log.info> <http://log.info>
>>> <http://log.info>(clipped.size(),"clippings. Try to join
>>>>    them.");
>>>>>                                      List<Way>  clippedWays =
>>>>    new ArrayList<Way>(clipped.size());
>>>>>                                      for (List<Coord>
>>>>      clippedPoints : clipped) {
>>>>>                                              clippedWays.add(new
>>>>    Way(FakeIdGenerator.makeFakeId(), clippedPoints));
>>>>>                                      }
>>>>>                                      clippedWays =
>>>>    joinWays(clippedWays);
>>>>>                                      if (clippedWays.size() !=
>>>>    clipped.size()) {
>>>>>                                              clipped = new
>>>>    ArrayList<List<Coord>>(clippedWays.size());
>>>>>                                              for (Way w :
>>>>    clippedWays) {
>>>>> 
>>>>    clipped.add(w.getPoints());
>>>>>                                              }
>>>>>                                      }
>>>>> log.info <http://log.info> <http://log.info>
>>> <http://log.info>(clipped.size(),"joined clippings.");
>>>>>                              }
>>>>> 
>>>> 
>>>>    So you tried mkmgap r1755 and r1760 with the same data and
>>>    r1755 does
>>>>    not have floodings but r1760 has floodings?
>>>>    Or why are you sure that the given code is the reason for the
>>>    flooding?
>>> 
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev




More information about the mkgmap-dev mailing list