
Hi Gerd Here is the start of it + a couple of changes to the interface of IsInFunction to make life easier. I won't be able to finish this tonight so I've fixed the IsInUnitTest to run using a copied version of calcInsideness, but the start of the 'reverse' version is there, called dev_calcInsideness. Attached patch supersedes is_in-function_v8b.patch and it would be good if it can be applied soon so that, for instance, Arndt, could see if it fixes his problem with context and parameters. Ticker On Wed, 2020-02-12 at 15:55 +0000, Gerd Petermann wrote:
Hi Ticker,
I found it difficult to test the real style function, that's why I moved all the logic out of it. I am looking forward to your solution.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 12. Februar 2020 16:47 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Work on is_in branch
Hi Gerd
The re-structuring makes this difficult.
I propose a function in IsInUtilTest with the same interface as calcInsideness from IsInUtil that somehow drives the real function IsIn Function to collect and build the IN/ON/OUT intflag.
Ticker
On Wed, 2020-02-12 at 15:28 +0000, Gerd Petermann wrote:
Hi Ticker,
did you run the unit tests? This should download a newer version of the samples.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Mittwoch, 12. Februar 2020 16:23 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Work on is_in branch
Hi Gerd
Here it is - changes are:
- Some restructuring with early stopping where possible.
- Merging polygons for POINT IN/ON test so a point on shared boundary becomes IN rather than ON.
- Not merging polygons when no need.
- Make the function cacheable, so that there is negligible cost to the second call: highway=path & is_in(landuse, residential, all)=true [0xAA] highway=path & is_in(landuse, residential, all)=false [0xBB]
- Improved the layout of documentation in the Style Manual.
- Fixed quite a few problems.
I've left quite a lot of debug in for the moment, I think there will still be work to do.
It gives correct answers to 'point-on.osm'. I haven't worked through is -in-hook-sample-v3.osm yet because I wanted to get this revision out to replace faults in the previous versions.
Ticker
On Tue, 2020-02-11 at 15:49 +0000, Gerd Petermann wrote:
Hi Ticker,
whatever you plan to do. I moved the code to the lib because it is easier to write a unit test. I would not invest much time to avoid a few tests which only happen in very rare cases. Makes testing more complicated and code less readable.
Gerd
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev