Codebase list mkgmap / upstream/0.0.0+svn4604
New upstream version 0.0.0+svn4604 Bas Couwenberg 3 years ago
6 changed file(s) with 624 addition(s) and 527 deletion(s). Raw diff Collapse all Expand all
196196 :: - On the PC, when zooming out, the name 'Rue de la Concorde' is only
197197 rendered as 'Concorde'.
198198 :: - The index for road names only contains the important part of the name.
199 You can search for road name Conc to find road names like 'Rue de la Concorde'.
199 You can search for road name 'Conc' to find road names like 'Rue de la Concorde'.
200200 However, a search for 'Rue' will not list 'Rue de la Concorde' or 'Rue du Moulin'.
201201 It may list 'Rueben Brookins Road' if that is in the map.
202202
536536 used for the single tiles, good compromises are somewhere between 55000
537537 and 276160.
538538
539 === Miscellaneous options ===
540
541 ;--max-jobs[=integer]
542 : Specify the number of threads to be used for concurrent processing.
543 Increasing max-jobs will reduce the execution time, providing sufficient
544 memory is available and the value is not greater than the number of cores
545 in the CPU. If no value is specified, the limit is set to the number of CPU
546 cores. The default is for the limit to be automatically set to a reasonable
547 value based on the amount of memory allocated to the Java runtime and the
548 amount used in processing the first tile.
549
550 ;--keep-going
551 : Don't quit whole application if an exception occurs while
552 processing a map - continue to process the other maps.
553
554 ;--block-size=integer
555 : Changes the block size that is used in the generated map. This
556 option is not usually needed, but sometimes an error message
557 will ask you to try a value for this option.
558
559 ;--net
560 : Tells mkgmap to write NET data, which is needed for address search
561 and routing. Use this option if you want address search, but do
562 not need a map that supports routing or house number search.
563
564 ;--route
565 : Tells mkgmap to write NET and NOD data, which are needed in maps
566 that support routing. If you specify this option, you do not need
567 to specify --net and --no-net is ignored.
568
569 ;--add-boundary-nodes-at-admin-boundaries=NUM
570 : This option controls how mkgmap calculates special routing nodes which
571 are needed by Garmin software to allow routing between different map tiles.
572 These nodes are written to section 3 and 4 in the NOD file.
573 When a road crosses the tile boundary (bbox), the road is split at this
574 point and such a special node is written. This allows routing between
575 one set of tiles produced by splitter.jar. However, if you create a map
576 from different sets of tiles, those tiles are likely to overlap.
577 For the overlapping tiles, none of the entries in NOD3 match and thus
578 routing across tile border doesn't work when the route is not fully
579 covered by one of the tiles.
580 The option tells mkgmap to add special nodes wherever a road touches or
581 crosses an administrative boundary. The NUM parameter specifies a filter
582 for the admin_level. Boundaries with a higher admin_level value are ignored.
583 The default value is 2 (country borders). Another reasonable value might
584 be 4. A value less or equal to 0 tells mkgmap to ignore intersections at
585 administrative boundaries.
586
587 ;--drive-on=left|right|detect|detect,left|detect,right
588 : Explicitly specify which side of the road vehicles are
589 expected to drive on.
590 If the first option is detect, the program tries
591 to find out the proper flag. If that detection
592 fails, the second value is used (or right if none is given).
593 With OSM data as input, the detection tries to find out
594 the country each road is in and compares the number
595 of drive-on-left roads with the rest.
596 Use the --bounds option to make sure that the detection
597 finds the correct country.
539 === Sea Processing options ===
540
541 If your map contains sea areas then you will need to use --generate-sea to generate
542 the sea areas from the OSM files or --precomp-sea to use separate precompiled sea tiles.
543
544 ;--generate-sea[=VALUE[,...]]
545 : Generate sea polygons. When this option is specified, the sea is generated using a
546 multipolygon unless the polygons value is specified. The coastline data can be read from
547 the input OSM files, separate files containing coastline data if --coastlinefile
548 is specified or precompiled sea data if --precomp-sea is specified. The VALUEs are as follows:
549 :;multipolygon
550 :: generate the sea using a multipolygon. This is the default value.
551 :;polygons | no-mp
552 :: don't generate the sea using a multipolygon - instead,
553 generate a background sea polygon plus individual land
554 polygons (see land-tag value).
555 :;land-tag=TAG=VAL
556 :: tag to use for land polygons (default natural=land) created by the polygons option.
557 For these to be visible in the Garmin map, a suitable land polygon type must
558 be defined in the TYP file (suggested type is 0x010100 or 0x54), the polygon must
559 have a higher drawing level than the sea polygon type and the style file must link
560 TAG=VAL to the land polygon type defined in the TYP file.
561 :;no-sea-sectors
562 :: disable the generation of "sea sectors" when the
563 coastline fails to reach the tile's boundary.
564 Under some conditions land sectors are generated instead and these use land-tag.
565 :;extend-sea-sectors
566 :: Adds a point so coastline reaches the nearest tile boundary.
567 This implies no-sea-sectors.
568 :;close-gaps=NUM
569 :: close gaps in coastline that are less than this distance (metres)
570 :;floodblocker
571 :: enable the flood blocker that prevents a flooding of
572 land by checking if the sea polygons contain streets
573 (works only with multipolygon processing)
574 :;fbgap=NUM
575 :: flood blocker gap in metre (default 40)
576 points that are closer to the sea polygon do not block
577 :;fbthres=NUM
578 :: at least so many highway points must be contained in
579 a sea polygon so that it may be removed by the flood
580 blocker (default 20)
581 :;fbratio=NUM
582 :: only sea polygons with a higher ratio
583 (highway points x 100000 / polygon size) are removed
584 (default 0.5)
585 :;fbdebug
586 :: switches on the debugging of the flood blocker
587 generates GPX files for each polygon checked by
588 the flood blocker
589 :;check
590 :: check whether the coastline data contains sea within sea or land
591 within land
592
593 ;--coastlinefile=filename[,filename...]
594 : Defines a comma separated list of OSM or PBF format files that contain
595 coastline data to be used instead of extracting the data from the input files.
596 If you specify --coastlinefile you must also specify --generate-sea.
597
598 ;--precomp-sea=directory|zipfile
599 : Defines the directory or a zip file that contains precompiled sea data.
600 Sea data in a zip file must be located in the zip file's root directory or in
601 a sub directory named sea. When this option is defined, natural=coastline tags
602 from the input OSM files are ignored, the --coastlinefile option is ignored
603 and the precompiled data is used instead.
604 You can use the multipolygon, polygon and land-tag values of the --generate-sea
605 option in conjunction with --precomp-sea to control the way the sea is built,
606 but the other --generate-sea values are not available.
607 If --generate-sea is not specified, the --precomp-sea option sets --generate-sea=multipolygon.
608
609 You can download procompiled sea data for the whole world from the mkgmap download page at
610 http://www.mkgmap.org.uk/download/mkgmap.html
611
612 If you want to build your own precompiled sea data, you will need to build a copy
613 of mkgmap from the source, with the optional PrecompSeaGenerator source included.
614 This generator uses ESRI shapefiles as its source data. It is not included in
615 the standard mkgmap build due to its dependencies on external libraries.
616
617 === Diagnostic options ===
598618
599619 ;--check-roundabouts
600620 : Check that roundabouts have the expected direction (clockwise
635655 : See also option --add-boundary-nodes-at-admin-boundaries.
636656 : This option seems to cause routing problems in BaseCamp.
637657
658 ;--report-similar-arcs
659 : Issue a warning when more than one arc connects two nodes and
660 the ways that the arcs are derived from contain identical
661 points. It doesn't make sense to use this option at the same
662 time as using the cycleway creating options.
663
664 ;--report-dead-ends=LEVEL
665 : Set the dead end road warning level. The value of LEVEL (which
666 defaults to 1 if this option is not specified) determines
667 those roads to report:
668 :* 0 = none
669 :* 1 = report on connected one-way roads that go nowhere
670 :* 2 = also report on individual one-way roads that go nowhere.
671
672 ;--dead-ends[=key[=value]][,key[=value]...]
673 : Specify a list of keys and optional values that should be considered
674 to be valid dead ends when found on the node at the end of a way. Ways with
675 nodes matching any of the items in the list will not be reported as dead ends.
676 If no value or * is specified for value then presence of the key alone will
677 cause the dead end check to be skipped. The default is --dead-ends=fixme,FIXME.
678
679 === POI options ===
680
681 ;--add-pois-to-lines[=all|start|end|mid|other]
682 : Generate nodes that may be used by the points file to produce POIs at
683 various positions of non-closed lines. The option expects a comma separated list that
684 specifies the positions at which a node should be generated. The default is all.
685 If the inner or all values are used, a lot of points are likely to be generated and
686 these are likely to need filtering in the points file.
687 Each node is tagged with the same tags as the line plus mkgmap generated tags
688 mkgmap:line2poi=true and mkgmap:line2poitype with one of the following values:
689 :* start - The first point of the line
690 :* end - The last point of the line
691 :* inner - Each point of the line except the first and the last
692 :* mid - An extra point added by mkgmap at the middle of the line
693
694 ;--add-pois-to-areas
695 : For each polygon and multipolygon, generate a node that may be used by the
696 points file to produce a POI.
697 The nodes are created after the relation style but before the other styles are applied.
698 Each node is tagged with the same tags of the area/multipolygon, plus mkgmap generated
699 tag mkgmap:area2poi=true.
700 Artificial polygons created by multipolyon processing are not used.
701 The nodes are created at the following positions:
702 :;polygons: the first rule that applies of:
703 ::* the first node tagged with a tag defined by the --pois-to-areas-placement option
704 ::* the centre point
705 :;multipolygons: the first rule that applies of:
706 ::* the node with role=label
707 ::* the centre point of the biggest area
708
709 ;--pois-to-areas-placement=tag=value[;tag=value...]
710 : A node is placed at the first node of the polygon tagged with the first tag/value
711 pair. If none of the nodes are tagged with the first tag-value pair the first node
712 tagged with the second tag-value pair is used and so on. If none of the tag-value pairs
713 matches or no tag-value pairs are supplied, the centre of the polygon is used.
714 It is possible to define wildcards for tag values like entrance=*.
715 <p>
716 Default: entrance=main;entrance=yes;building=entrance
717
718 ;--make-poi-index
719 : Generate a POI index in each map tile. Probably not used by modern devices,
720 but still supported.
721
722 ;--poi-address
723 : Enable address / phone information to POIs. Address info is
724 read according to the "Karlsruhe" tagging schema. Automatic
725 filling of missing information could be enabled using the --location-autofill option.
726 Default is enabled, use --no-poi-address to disable.
727
728 ;--nearby-poi-rules=type[-type][/all|named|unnamed]:distance[:delete-poi|delete-name][,...]
729 : Defines a set of rules to follow when a POI is near to another of the
730 same type and label. Each rule consists of three parts separated by colons. The
731 first two parts must be provided; the last part can be defaulted.
732
733 : The first part of the rule is a Garmin POI type code or range of type codes,
734 with an optional suffix; it determines when the rule is triggered. A type code may be
735 specified in decimal or hexadecimal (e.g. 0x2c0b). A rule is triggered
736 when processing a POI if the type code of the POI matches the rule type
737 or falls within the range of type codes,
738 providing there is also a match in the POI name and the first part
739 suffix. If the suffix is '/all' (the default) then the match is only made
740 on the type. If the suffix is '/named' then the rule is only triggered if
741 the POI has a name. If the suffix is '/unnamed' then the rule is only
742 triggered if the POI has no name. A wildcard of an asterisk character may
743 be used to match any type code. The wildcard may also be combined with a
744 suffix to allow separate processing of named and unnamed POIs.
745
746 : The second part of the rule is the distance in metres which an already
747 processed POI must be within for it to be considered to be nearby and
748 hence trigger the action part of the rule.
749
750 : The third part of the rule is the action part and provides two options:
751
752 :: delete-poi - the POIS are considered to be duplicates and the
753 duplicate is deleted. This is the default.
754 :: delete-name - the POIS are not duplicates, but only a single
755 name needs to be displayed.
756
757 : Wildcard rules are only applied if no other rule is applicable.
758
759 : For example:
760 : --nearby-poi-rules=*/named:10,*/unnamed:25,0x2f17-0x2f1f:30
761
762 : This has the following effect:
763 : If no other rule applies, a POI with the same name and type and
764 within 10m of one already processed will be deleted.
765 : If no other rule applies, a POI having no name and of the same type
766 and within 25m of one already processed will be deleted.
767 : A POI of any type between 0x2f17 and 0x2f1f that is within 30m of
768 another POI with the same type will be deleted.
769
770 : If you have a lot of rules, the --nearby-poi-rules-config option is likely to
771 be easier to use.
772
773 : Note: a POI that matches another in type, name and exact location is always
774 considered a duplicate and deleted.
775
776 ;--nearby-poi-rules-config=filename
777 :Allows you to specify the nearby POI rules as described in the --nearby-poi-rules option
778 in a configuration file.
779 The format of the rules is the same as in --nearby-poi-rules, except that each rule is
780 specified on a separate line, rather than separated by commas. This format makes it easier
781 to view and maintain the rules when you have a lot of them. If you just have one or two rules,
782 it is simpler to use the --nearby-poi-rules option.
783
784 === Miscellaneous options ===
785
786 ;--max-jobs[=integer]
787 : Specify the number of threads to be used for concurrent processing.
788 Increasing max-jobs will reduce the execution time, providing sufficient
789 memory is available and the value is not greater than the number of cores
790 in the CPU. If no value is specified, the limit is set to the number of CPU
791 cores. The default is for the limit to be automatically set to a reasonable
792 value based on the amount of memory allocated to the Java runtime and the
793 amount used in processing the first tile.
794
795 ;--keep-going
796 : Don't quit whole application if an exception occurs while
797 processing a map - continue to process the other maps.
798
799 ;--block-size=integer
800 : Changes the block size that is used in the generated map. This
801 option is not usually needed, but sometimes an error message
802 will ask you to try a value for this option.
803
804 ;--net
805 : Tells mkgmap to write NET data, which is needed for address search
806 and routing. Use this option if you want address search, but do
807 not need a map that supports routing or house number search.
808
809 ;--route
810 : Tells mkgmap to write NET and NOD data, which are needed in maps
811 that support routing. If you specify this option, you do not need
812 to specify --net and --no-net is ignored.
813
814 ;--add-boundary-nodes-at-admin-boundaries=NUM
815 : This option controls how mkgmap calculates special routing nodes which
816 are needed by Garmin software to allow routing between different map tiles.
817 These nodes are written to section 3 and 4 in the NOD file.
818 When a road crosses the tile boundary (bbox), the road is split at this
819 point and such a special node is written. This allows routing between
820 one set of tiles produced by splitter.jar. However, if you create a map
821 from different sets of tiles, those tiles are likely to overlap.
822 For the overlapping tiles, none of the entries in NOD3 match and thus
823 routing across tile border doesn't work when the route is not fully
824 covered by one of the tiles.
825 The option tells mkgmap to add special nodes wherever a road touches or
826 crosses an administrative boundary. The NUM parameter specifies a filter
827 for the admin_level. Boundaries with a higher admin_level value are ignored.
828 The default value is 2 (country borders). Another reasonable value might
829 be 4. A value less or equal to 0 tells mkgmap to ignore intersections at
830 administrative boundaries.
831
832 ;--drive-on=left|right|detect|detect,left|detect,right
833 : Explicitly specify which side of the road vehicles are
834 expected to drive on.
835 If the first option is detect, the program tries
836 to find out the proper flag. If that detection
837 fails, the second value is used (or right if none is given).
838 With OSM data as input, the detection tries to find out
839 the country each road is in and compares the number
840 of drive-on-left roads with the rest.
841 Use the --bounds option to make sure that the detection
842 finds the correct country.
843
638844 ;--ignore-turn-restrictions
639845 : When reading OSM files, ignore any "restriction" relations.
640846
655861 good for racing bikes, but not for other cyclists.
656862 This allows the optimisation of sharp angles at junctions of those roads.
657863 Don't use with the default style as that is a general style!
658
659 ;--report-similar-arcs
660 : Issue a warning when more than one arc connects two nodes and
661 the ways that the arcs are derived from contain identical
662 points. It doesn't make sense to use this option at the same
663 time as using the cycleway creating options.
664
665 ;--report-dead-ends=LEVEL
666 : Set the dead end road warning level. The value of LEVEL (which
667 defaults to 1 if this option is not specified) determines
668 those roads to report:
669 :* 0 = none
670 :* 1 = report on connected one-way roads that go nowhere
671 :* 2 = also report on individual one-way roads that go nowhere.
672
673 ;--dead-ends[=key[=value]][,key[=value]...]
674 : Specify a list of keys and optional values that should be considered
675 to be valid dead ends when found on the node at the end of a way. Ways with
676 nodes matching any of the items in the list will not be reported as dead ends.
677 If no value or * is specified for value then presence of the key alone will
678 cause the dead end check to be skipped. The default is --dead-ends=fixme,FIXME.
679
680 ;--add-pois-to-lines[=all|start|end|mid|other]
681 : Generate POIs for lines. The option expects a comma separated list that
682 specifies the positions for which are POI should be generated. The default is
683 to create all possible POI. For each line (must not be closed) POIs are
684 created at several points of the line. Each POI is tagged with the
685 same tags like the line and additional tags added by mkgmap:
686 mkgmap:line2poi=true and tag mkgmap:line2poitype having
687 the following values:
688 :* start - The first point of the line
689 :* end - The last point of the line
690 :* inner - Each point of the line except the first and the last
691 :* mid - The middle point
692
693 ;--add-pois-to-areas
694 : Generate a POI for each polygon and multipolygon. The POIs are created
695 after the relation style but before the other styles are applied. Each
696 POI is tagged with the same tags of
697 the area/multipolygon. Additionally the tag mkgmap:area2poi=true is
698 set so that it is possible to use that information in the points style
699 file. Artificial polygons created by multipolyon processing are not used.
700 The POIs are created at the following positions:
701 :;polygons: the first rule that applies of:
702 ::* the first node tagged with a tag defined by the --pois-to-areas-placement option
703 ::* the centre point
704 :;multipolygons: the first rule that applies of:
705 ::* the node with role=label
706 ::* the centre point of the biggest area
707
708 ;--pois-to-areas-placement=tag=value[;tag=value...]
709 : A POI is placed at the first node of the polygon tagged with the first tag/value
710 pair. If none of the nodes are tagged with the first tag-value pair the first node
711 tagged with the second tag-value pair is used and so on. If none of the tag-value pairs
712 matches or the taglist is empty, the centre of the polygon is used.
713 It is possible to define wildcards for tag values like entrance=*.
714 <p>
715 Default: entrance=main;entrance=yes;building=entrance
716
717 ;--precomp-sea=directory|zipfile
718 : Defines the directory or a zip file that contains precompiled sea tiles.
719 Sea files in a zip file must be located in the zip file's root directory or in
720 a sub directory sea. When this option is defined, natural=coastline tags
721 from the input OSM tiles are ignored and the precompiled data is used instead.
722 This option can be combined with the generate-sea options multipolygon, polygons
723 and land-tag. The --coastlinefile option is ignored if --precomp-sea is set.
724
725 ;--coastlinefile=filename[,filename...]
726 : Defines a comma separated list of files that contain coastline
727 data. The coastline data from the input files is ignored if
728 this option is set. Files must have OSM or PBF file format.
729
730 ;--generate-sea[=ValueList]
731 : Generate sea polygons. ValueList is a comma separated list of values:
732 :;multipolygon
733 :: generate the sea using a multipolygon (the default behaviour so this really doesn't need to be specified).
734 :;polygons | no-mp
735 :: don't generate the sea using a multipolygon - instead,
736 generate a background sea polygon plus individual land
737 polygons with land-tag (see following).
738 :;no-sea-sectors
739 :: disable the generation of "sea sectors" when the
740 coastline fails to reach the tile's boundary.
741 Under some conditions land sectors are generated instead and these use land-tag.
742 :;extend-sea-sectors
743 :: Adds a point so coastline reaches the nearest tile boundary.
744 This implies no-sea-sectors.
745 :;land-tag=TAG=VAL
746 :: tag to use for land polygons (default natural=land).
747 If not using "multipolygon" or land sectors are being generated, then
748 a suitable land polygon type needs to be defined in the style
749 file (suggested type is 0x010100 or 0x54) and the polygon must
750 be defined in the TYP file as having a higher drawing
751 level than the sea polygon type.
752 :;close-gaps=NUM
753 :: close gaps in coastline that are less than this distance (metres)
754 :;floodblocker
755 :: enable the flood blocker that prevents a flooding of
756 land by checking if the sea polygons contain streets
757 (works only with multipolygon processing)
758 :;fbgap=NUM
759 :: flood blocker gap in metre (default 40)
760 points that are closer to the sea polygon do not block
761 :;fbthres=NUM
762 :: at least so many highway points must be contained in
763 a sea polygon so that it may be removed by the flood
764 blocker (default 20)
765 :;fbratio=NUM
766 :: only sea polygons with a higher ratio
767 (highway points x 100000 / polygon size) are removed
768 (default 0.5)
769 :;fbdebug
770 :: switches on the debugging of the flood blocker
771 generates GPX files for each polygon checked by
772 the flood blocker
773
774 ;--make-poi-index
775 : Generate a POI index in each map tile. Probably not used by modern devices,
776 but still supported.
777864
778865 ;--nsis
779866 : Write a .nsi file that can be used with the Nullsoft Scriptable Install System
883970 already installed on the PC and therefore there is no need to read it
884971 from the device.
885972
886 ;--poi-address
887 : Enable address / phone information to POIs. Address info is
888 read according to the "Karlsruhe" tagging schema. Automatic
889 filling of missing information could be enabled using the --location-autofill option.
890 Default is enabled, use --no-poi-address to disable.
891
892973 ;--verbose
893974 : Makes some operations more verbose. Mostly used with --list-styles.
894975
898979 (assuming the draw order is equal).
899980 The tag mkgmap:drawLevel can be used to override the
900981 natural area of a polygon, so forcing changes to the rendering order.
901
902 ;--nearby-poi-rules=type[-type][/all|named|unnamed]:distance[:delete-poi|delete-name][,...]
903 : Defines a set of rules to follow when a POI is near to another of the
904 same type and label. Each rule consists of three parts separated by colons. The
905 first two parts must be provided; the last part can be defaulted.
906
907 : The first part of the rule is a Garmin POI type code or range of type codes,
908 with an optional suffix; it determines when the rule is triggered. A type code may be
909 specified in decimal or hexadecimal (e.g. 0x2c0b). A rule is triggered
910 when processing a POI if the type code of the POI matches the rule type
911 or falls within the range of type codes,
912 providing there is also a match in the POI name and the first part
913 suffix. If the suffix is '/all' (the default) then the match is only made
914 on the type. If the suffix is '/named' then the rule is only triggered if
915 the POI has a name. If the suffix is '/unnamed' then the rule is only
916 triggered if the POI has no name. A wildcard of an asterisk character may
917 be used to match any type code. The wildcard may also be combined with a
918 suffix to allow separate processing of named and unnamed POIs.
919
920 : The second part of the rule is the distance in metres which an already
921 processed POI must be within for it to be considered to be nearby and
922 hence trigger the action part of the rule.
923
924 : The third part of the rule is the action part and provides two options:
925
926 :: delete-poi - the POIS are considered to be duplicates and the
927 duplicate is deleted. This is the default.
928 :: delete-name - the POIS are not duplicates, but only a single
929 name needs to be displayed.
930
931 : Wildcard rules are only applied if no other rule is applicable.
932
933 : For example:
934 : --nearby-poi-rules=*/named:10,*/unnamed:25,0x2f17-0x2f1f:30
935
936 : This has the following effect:
937 : If no other rule applies, a POI with the same name and type and
938 within 10m of one already processed will be deleted.
939 : If no other rule applies, a POI having no name and of the same type
940 and within 25m of one already processed will be deleted.
941 : A POI of any type between 0x2f17 and 0x2f1f that is within 30m of
942 another POI with the same type will be deleted.
943
944 : If you have a lot of rules, the --nearby-poi-rules-config option is likely to
945 be easier to use.
946
947 : Note: a POI that matches another in type, name and exact location is always
948 considered a duplicate and deleted.
949
950 ;--nearby-poi-rules-config=filename
951 :Allows you to specify the nearby POI rules as described in the --nearby-poi-rules option
952 in a configuration file.
953 The format of the rules is the same as in --nearby-poi-rules, except that each rule is
954 specified on a separate line, rather than separated by commas. This format makes it easier
955 to view and maintain the rules when you have a lot of them. If you just have one or two rules,
956 it is simpler to use the --nearby-poi-rules option.
957982
958983 === Deprecated and Obsolete Options ===
959984
193193 - On the PC, when zooming out, the name 'Rue de la Concorde' is only
194194 rendered as 'Concorde'.
195195 - The index for road names only contains the important part of the
196 name. You can search for road name Conc to find road names like 'Rue de
197 la Concorde'. However, a search for 'Rue' will not list 'Rue de la
196 name. You can search for road name 'Conc' to find road names like 'Rue
197 de la Concorde'. However, a search for 'Rue' will not list 'Rue de la
198198 Concorde' or 'Rue du Moulin'. It may list 'Rueben Brookins Road' if
199199 that is in the map.
200200
526526 resolution used for the single tiles, good compromises are somewhere
527527 between 55000 and 276160.
528528
529 === Miscellaneous options ===
530
531 --max-jobs[=integer]
532 Specify the number of threads to be used for concurrent processing.
533 Increasing max-jobs will reduce the execution time, providing sufficient
534 memory is available and the value is not greater than the number of cores
535 in the CPU. If no value is specified, the limit is set to the number of CPU
536 cores. The default is for the limit to be automatically set to a reasonable
537 value based on the amount of memory allocated to the Java runtime and the
538 amount used in processing the first tile.
539
540 --keep-going
541 Don't quit whole application if an exception occurs while processing a map
542 - continue to process the other maps.
543
544 --block-size=integer
545 Changes the block size that is used in the generated map. This option is
546 not usually needed, but sometimes an error message will ask you to try a
547 value for this option.
548
549 --net
550 Tells mkgmap to write NET data, which is needed for address search and
551 routing. Use this option if you want address search, but do not need a map
552 that supports routing or house number search.
553
554 --route
555 Tells mkgmap to write NET and NOD data, which are needed in maps that
556 support routing. If you specify this option, you do not need to specify
557 --net and --no-net is ignored.
558
559 --add-boundary-nodes-at-admin-boundaries=NUM
560 This option controls how mkgmap calculates special routing nodes which are
561 needed by Garmin software to allow routing between different map tiles.
562 These nodes are written to section 3 and 4 in the NOD file. When a road
563 crosses the tile boundary (bbox), the road is split at this point and such
564 a special node is written. This allows routing between one set of tiles
565 produced by splitter.jar. However, if you create a map from different sets
566 of tiles, those tiles are likely to overlap. For the overlapping tiles,
567 none of the entries in NOD3 match and thus routing across tile border
568 doesn't work when the route is not fully covered by one of the tiles. The
569 option tells mkgmap to add special nodes wherever a road touches or crosses
570 an administrative boundary. The NUM parameter specifies a filter for the
571 admin_level. Boundaries with a higher admin_level value are ignored. The
572 default value is 2 (country borders). Another reasonable value might be 4.
573 A value less or equal to 0 tells mkgmap to ignore intersections at
574 administrative boundaries.
575
576 --drive-on=left|right|detect|detect,left|detect,right
577 Explicitly specify which side of the road vehicles are expected to drive
578 on. If the first option is detect, the program tries to find out the proper
579 flag. If that detection fails, the second value is used (or right if none
580 is given). With OSM data as input, the detection tries to find out the
581 country each road is in and compares the number of drive-on-left roads with
582 the rest. Use the --bounds option to make sure that the detection finds the
583 correct country.
529 === Sea Processing options ===
530
531 If your map contains sea areas then you will need to use --generate-sea to
532 generate the sea areas from the OSM files or --precomp-sea to use separate
533 precompiled sea tiles.
534
535 --generate-sea[=VALUE[,...]]
536 Generate sea polygons. When this option is specified, the sea is generated
537 using a multipolygon unless the polygons value is specified. The coastline
538 data can be read from the input OSM files, separate files containing
539 coastline data if --coastlinefile is specified or precompiled sea data if
540 --precomp-sea is specified. The VALUEs are as follows:
541 multipolygon
542 generate the sea using a multipolygon. This is the default value.
543 polygons | no-mp
544 don't generate the sea using a multipolygon - instead, generate a
545 background sea polygon plus individual land polygons (see land-tag
546 value).
547 land-tag=TAG=VAL
548 tag to use for land polygons (default natural=land) created by the
549 polygons option. For these to be visible in the Garmin map, a suitable
550 land polygon type must be defined in the TYP file (suggested type is
551 0x010100 or 0x54), the polygon must have a higher drawing level than
552 the sea polygon type and the style file must link TAG=VAL to the land
553 polygon type defined in the TYP file.
554 no-sea-sectors
555 disable the generation of "sea sectors" when the coastline fails to
556 reach the tile's boundary. Under some conditions land sectors are
557 generated instead and these use land-tag.
558 extend-sea-sectors
559 Adds a point so coastline reaches the nearest tile boundary. This
560 implies no-sea-sectors.
561 close-gaps=NUM
562 close gaps in coastline that are less than this distance (metres)
563 floodblocker
564 enable the flood blocker that prevents a flooding of land by checking
565 if the sea polygons contain streets (works only with multipolygon
566 processing)
567 fbgap=NUM
568 flood blocker gap in metre (default 40) points that are closer to the
569 sea polygon do not block
570 fbthres=NUM
571 at least so many highway points must be contained in a sea polygon so
572 that it may be removed by the flood blocker (default 20)
573 fbratio=NUM
574 only sea polygons with a higher ratio (highway points x 100000 /
575 polygon size) are removed (default 0.5)
576 fbdebug
577 switches on the debugging of the flood blocker generates GPX files for
578 each polygon checked by the flood blocker
579 check
580 check whether the coastline data contains sea within sea or land within
581 land
582
583 --coastlinefile=filename[,filename...]
584 Defines a comma separated list of OSM or PBF format files that contain
585 coastline data to be used instead of extracting the data from the input
586 files. If you specify --coastlinefile you must also specify --generate-sea.
587
588 --precomp-sea=directory|zipfile
589 Defines the directory or a zip file that contains precompiled sea data. Sea
590 data in a zip file must be located in the zip file's root directory or in a
591 sub directory named sea. When this option is defined, natural=coastline
592 tags from the input OSM files are ignored, the --coastlinefile option is
593 ignored and the precompiled data is used instead. You can use the
594 multipolygon, polygon and land-tag values of the --generate-sea option in
595 conjunction with --precomp-sea to control the way the sea is built, but the
596 other --generate-sea values are not available. If --generate-sea is not
597 specified, the --precomp-sea option sets --generate-sea=multipolygon.
598
599 You can download procompiled sea data for the whole world from the mkgmap
600 download page at http://www.mkgmap.org.uk/download/mkgmap.html
601
602 If you want to build your own precompiled sea data, you will need to build a
603 copy of mkgmap from the source, with the optional PrecompSeaGenerator source
604 included. This generator uses ESRI shapefiles as its source data. It is not
605 included in the standard mkgmap build due to its dependencies on external
606 libraries.
607
608 === Diagnostic options ===
584609
585610 --check-roundabouts
586611 Check that roundabouts have the expected direction (clockwise when vehicles
620645 See also option --add-boundary-nodes-at-admin-boundaries.
621646 This option seems to cause routing problems in BaseCamp.
622647
648 --report-similar-arcs
649 Issue a warning when more than one arc connects two nodes and the ways that
650 the arcs are derived from contain identical points. It doesn't make sense
651 to use this option at the same time as using the cycleway creating options.
652
653 --report-dead-ends=LEVEL
654 Set the dead end road warning level. The value of LEVEL (which defaults to
655 1 if this option is not specified) determines those roads to report:
656 * 0 = none
657 * 1 = report on connected one-way roads that go nowhere
658 * 2 = also report on individual one-way roads that go nowhere.
659
660 --dead-ends[=key[=value]][,key[=value]...]
661 Specify a list of keys and optional values that should be considered to be
662 valid dead ends when found on the node at the end of a way. Ways with nodes
663 matching any of the items in the list will not be reported as dead ends. If
664 no value or * is specified for value then presence of the key alone will
665 cause the dead end check to be skipped. The default is
666 --dead-ends=fixme,FIXME.
667
668 === POI options ===
669
670 --add-pois-to-lines[=all|start|end|mid|other]
671 Generate nodes that may be used by the points file to produce POIs at
672 various positions of non-closed lines. The option expects a comma separated
673 list that specifies the positions at which a node should be generated. The
674 default is all. If the inner or all values are used, a lot of points are
675 likely to be generated and these are likely to need filtering in the points
676 file. Each node is tagged with the same tags as the line plus mkgmap
677 generated tags mkgmap:line2poi=true and mkgmap:line2poitype with one of the
678 following values:
679 * start - The first point of the line
680 * end - The last point of the line
681 * inner - Each point of the line except the first and the last
682 * mid - An extra point added by mkgmap at the middle of the line
683
684 --add-pois-to-areas
685 For each polygon and multipolygon, generate a node that may be used by the
686 points file to produce a POI. The nodes are created after the relation
687 style but before the other styles are applied. Each node is tagged with the
688 same tags of the area/multipolygon, plus mkgmap generated tag
689 mkgmap:area2poi=true. Artificial polygons created by multipolyon processing
690 are not used. The nodes are created at the following positions:
691 polygons: the first rule that applies of:
692 * the first node tagged with a tag defined by the
693 --pois-to-areas-placement option
694 * the centre point
695 multipolygons: the first rule that applies of:
696 * the node with role=label
697 * the centre point of the biggest area
698
699 --pois-to-areas-placement=tag=value[;tag=value...]
700 A node is placed at the first node of the polygon tagged with the first
701 tag/value pair. If none of the nodes are tagged with the first tag-value
702 pair the first node tagged with the second tag-value pair is used and so
703 on. If none of the tag-value pairs matches or no tag-value pairs are
704 supplied, the centre of the polygon is used. It is possible to define
705 wildcards for tag values like entrance=*.
706
707 Default: entrance=main;entrance=yes;building=entrance
708
709 --make-poi-index
710 Generate a POI index in each map tile. Probably not used by modern devices,
711 but still supported.
712
713 --poi-address
714 Enable address / phone information to POIs. Address info is read according
715 to the "Karlsruhe" tagging schema. Automatic filling of missing information
716 could be enabled using the --location-autofill option. Default is enabled,
717 use --no-poi-address to disable.
718
719 --nearby-poi-rules=type[-type][/all|named|unnamed]:distance[:delete-poi|delete-name][,...]
720 Defines a set of rules to follow when a POI is near to another of the same
721 type and label. Each rule consists of three parts separated by colons. The
722 first two parts must be provided; the last part can be defaulted.
723
724 The first part of the rule is a Garmin POI type code or range of type
725 codes, with an optional suffix; it determines when the rule is triggered. A
726 type code may be specified in decimal or hexadecimal (e.g. 0x2c0b). A rule
727 is triggered when processing a POI if the type code of the POI matches the
728 rule type or falls within the range of type codes, providing there is also
729 a match in the POI name and the first part suffix. If the suffix is '/all'
730 (the default) then the match is only made on the type. If the suffix is
731 '/named' then the rule is only triggered if the POI has a name. If the
732 suffix is '/unnamed' then the rule is only triggered if the POI has no
733 name. A wildcard of an asterisk character may be used to match any type
734 code. The wildcard may also be combined with a suffix to allow separate
735 processing of named and unnamed POIs.
736
737 The second part of the rule is the distance in metres which an already
738 processed POI must be within for it to be considered to be nearby and hence
739 trigger the action part of the rule.
740
741 The third part of the rule is the action part and provides two options:
742
743 delete-poi - the POIS are considered to be duplicates and the duplicate
744 is deleted. This is the default.
745 delete-name - the POIS are not duplicates, but only a single name needs
746 to be displayed.
747
748 Wildcard rules are only applied if no other rule is applicable.
749
750 For example:
751 --nearby-poi-rules=*/named:10,*/unnamed:25,0x2f17-0x2f1f:30
752
753 This has the following effect:
754 If no other rule applies, a POI with the same name and type and within 10m
755 of one already processed will be deleted.
756 If no other rule applies, a POI having no name and of the same type and
757 within 25m of one already processed will be deleted.
758 A POI of any type between 0x2f17 and 0x2f1f that is within 30m of another
759 POI with the same type will be deleted.
760
761 If you have a lot of rules, the --nearby-poi-rules-config option is likely
762 to be easier to use.
763
764 Note: a POI that matches another in type, name and exact location is always
765 considered a duplicate and deleted.
766
767 --nearby-poi-rules-config=filename
768 Allows you to specify the nearby POI rules as described in the
769 --nearby-poi-rules option in a configuration file. The format of the rules
770 is the same as in --nearby-poi-rules, except that each rule is specified on
771 a separate line, rather than separated by commas. This format makes it
772 easier to view and maintain the rules when you have a lot of them. If you
773 just have one or two rules, it is simpler to use the --nearby-poi-rules
774 option.
775
776 === Miscellaneous options ===
777
778 --max-jobs[=integer]
779 Specify the number of threads to be used for concurrent processing.
780 Increasing max-jobs will reduce the execution time, providing sufficient
781 memory is available and the value is not greater than the number of cores
782 in the CPU. If no value is specified, the limit is set to the number of CPU
783 cores. The default is for the limit to be automatically set to a reasonable
784 value based on the amount of memory allocated to the Java runtime and the
785 amount used in processing the first tile.
786
787 --keep-going
788 Don't quit whole application if an exception occurs while processing a map
789 - continue to process the other maps.
790
791 --block-size=integer
792 Changes the block size that is used in the generated map. This option is
793 not usually needed, but sometimes an error message will ask you to try a
794 value for this option.
795
796 --net
797 Tells mkgmap to write NET data, which is needed for address search and
798 routing. Use this option if you want address search, but do not need a map
799 that supports routing or house number search.
800
801 --route
802 Tells mkgmap to write NET and NOD data, which are needed in maps that
803 support routing. If you specify this option, you do not need to specify
804 --net and --no-net is ignored.
805
806 --add-boundary-nodes-at-admin-boundaries=NUM
807 This option controls how mkgmap calculates special routing nodes which are
808 needed by Garmin software to allow routing between different map tiles.
809 These nodes are written to section 3 and 4 in the NOD file. When a road
810 crosses the tile boundary (bbox), the road is split at this point and such
811 a special node is written. This allows routing between one set of tiles
812 produced by splitter.jar. However, if you create a map from different sets
813 of tiles, those tiles are likely to overlap. For the overlapping tiles,
814 none of the entries in NOD3 match and thus routing across tile border
815 doesn't work when the route is not fully covered by one of the tiles. The
816 option tells mkgmap to add special nodes wherever a road touches or crosses
817 an administrative boundary. The NUM parameter specifies a filter for the
818 admin_level. Boundaries with a higher admin_level value are ignored. The
819 default value is 2 (country borders). Another reasonable value might be 4.
820 A value less or equal to 0 tells mkgmap to ignore intersections at
821 administrative boundaries.
822
823 --drive-on=left|right|detect|detect,left|detect,right
824 Explicitly specify which side of the road vehicles are expected to drive
825 on. If the first option is detect, the program tries to find out the proper
826 flag. If that detection fails, the second value is used (or right if none
827 is given). With OSM data as input, the detection tries to find out the
828 country each road is in and compares the number of drive-on-left roads with
829 the rest. Use the --bounds option to make sure that the detection finds the
830 correct country.
831
623832 --ignore-turn-restrictions
624833 When reading OSM files, ignore any "restriction" relations.
625834
640849 for other cyclists. This allows the optimisation of sharp angles at
641850 junctions of those roads. Don't use with the default style as that is a
642851 general style!
643
644 --report-similar-arcs
645 Issue a warning when more than one arc connects two nodes and the ways that
646 the arcs are derived from contain identical points. It doesn't make sense
647 to use this option at the same time as using the cycleway creating options.
648
649 --report-dead-ends=LEVEL
650 Set the dead end road warning level. The value of LEVEL (which defaults to
651 1 if this option is not specified) determines those roads to report:
652 * 0 = none
653 * 1 = report on connected one-way roads that go nowhere
654 * 2 = also report on individual one-way roads that go nowhere.
655
656 --dead-ends[=key[=value]][,key[=value]...]
657 Specify a list of keys and optional values that should be considered to be
658 valid dead ends when found on the node at the end of a way. Ways with nodes
659 matching any of the items in the list will not be reported as dead ends. If
660 no value or * is specified for value then presence of the key alone will
661 cause the dead end check to be skipped. The default is
662 --dead-ends=fixme,FIXME.
663
664 --add-pois-to-lines[=all|start|end|mid|other]
665 Generate POIs for lines. The option expects a comma separated list that
666 specifies the positions for which are POI should be generated. The default
667 is to create all possible POI. For each line (must not be closed) POIs are
668 created at several points of the line. Each POI is tagged with the same
669 tags like the line and additional tags added by mkgmap:
670 mkgmap:line2poi=true and tag mkgmap:line2poitype having the following
671 values:
672 * start - The first point of the line
673 * end - The last point of the line
674 * inner - Each point of the line except the first and the last
675 * mid - The middle point
676
677 --add-pois-to-areas
678 Generate a POI for each polygon and multipolygon. The POIs are created
679 after the relation style but before the other styles are applied. Each POI
680 is tagged with the same tags of the area/multipolygon. Additionally the tag
681 mkgmap:area2poi=true is set so that it is possible to use that information
682 in the points style file. Artificial polygons created by multipolyon
683 processing are not used. The POIs are created at the following positions:
684 polygons: the first rule that applies of:
685 * the first node tagged with a tag defined by the
686 --pois-to-areas-placement option
687 * the centre point
688 multipolygons: the first rule that applies of:
689 * the node with role=label
690 * the centre point of the biggest area
691
692 --pois-to-areas-placement=tag=value[;tag=value...]
693 A POI is placed at the first node of the polygon tagged with the first
694 tag/value pair. If none of the nodes are tagged with the first tag-value
695 pair the first node tagged with the second tag-value pair is used and so
696 on. If none of the tag-value pairs matches or the taglist is empty, the
697 centre of the polygon is used. It is possible to define wildcards for tag
698 values like entrance=*.
699
700 Default: entrance=main;entrance=yes;building=entrance
701
702 --precomp-sea=directory|zipfile
703 Defines the directory or a zip file that contains precompiled sea tiles.
704 Sea files in a zip file must be located in the zip file's root directory or
705 in a sub directory sea. When this option is defined, natural=coastline tags
706 from the input OSM tiles are ignored and the precompiled data is used
707 instead. This option can be combined with the generate-sea options
708 multipolygon, polygons and land-tag. The --coastlinefile option is ignored
709 if --precomp-sea is set.
710
711 --coastlinefile=filename[,filename...]
712 Defines a comma separated list of files that contain coastline data. The
713 coastline data from the input files is ignored if this option is set. Files
714 must have OSM or PBF file format.
715
716 --generate-sea[=ValueList]
717 Generate sea polygons. ValueList is a comma separated list of values:
718 multipolygon
719 generate the sea using a multipolygon (the default behaviour so this
720 really doesn't need to be specified).
721 polygons | no-mp
722 don't generate the sea using a multipolygon - instead, generate a
723 background sea polygon plus individual land polygons with land-tag (see
724 following).
725 no-sea-sectors
726 disable the generation of "sea sectors" when the coastline fails to
727 reach the tile's boundary. Under some conditions land sectors are
728 generated instead and these use land-tag.
729 extend-sea-sectors
730 Adds a point so coastline reaches the nearest tile boundary. This
731 implies no-sea-sectors.
732 land-tag=TAG=VAL
733 tag to use for land polygons (default natural=land). If not using
734 "multipolygon" or land sectors are being generated, then a suitable
735 land polygon type needs to be defined in the style file (suggested type
736 is 0x010100 or 0x54) and the polygon must be defined in the TYP file as
737 having a higher drawing level than the sea polygon type.
738 close-gaps=NUM
739 close gaps in coastline that are less than this distance (metres)
740 floodblocker
741 enable the flood blocker that prevents a flooding of land by checking
742 if the sea polygons contain streets (works only with multipolygon
743 processing)
744 fbgap=NUM
745 flood blocker gap in metre (default 40) points that are closer to the
746 sea polygon do not block
747 fbthres=NUM
748 at least so many highway points must be contained in a sea polygon so
749 that it may be removed by the flood blocker (default 20)
750 fbratio=NUM
751 only sea polygons with a higher ratio (highway points x 100000 /
752 polygon size) are removed (default 0.5)
753 fbdebug
754 switches on the debugging of the flood blocker generates GPX files for
755 each polygon checked by the flood blocker
756
757 --make-poi-index
758 Generate a POI index in each map tile. Probably not used by modern devices,
759 but still supported.
760852
761853 --nsis
762854 Write a .nsi file that can be used with the Nullsoft Scriptable Install
863955 already installed on the PC and therefore there is no need to read it from
864956 the device.
865957
866 --poi-address
867 Enable address / phone information to POIs. Address info is read according
868 to the "Karlsruhe" tagging schema. Automatic filling of missing information
869 could be enabled using the --location-autofill option. Default is enabled,
870 use --no-poi-address to disable.
871
872958 --verbose
873959 Makes some operations more verbose. Mostly used with --list-styles.
874960
877963 features are rendered over larger ones (assuming the draw order is equal).
878964 The tag mkgmap:drawLevel can be used to override the natural area of a
879965 polygon, so forcing changes to the rendering order.
880
881 --nearby-poi-rules=type[-type][/all|named|unnamed]:distance[:delete-poi|delete-name][,...]
882 Defines a set of rules to follow when a POI is near to another of the same
883 type and label. Each rule consists of three parts separated by colons. The
884 first two parts must be provided; the last part can be defaulted.
885
886 The first part of the rule is a Garmin POI type code or range of type
887 codes, with an optional suffix; it determines when the rule is triggered. A
888 type code may be specified in decimal or hexadecimal (e.g. 0x2c0b). A rule
889 is triggered when processing a POI if the type code of the POI matches the
890 rule type or falls within the range of type codes, providing there is also
891 a match in the POI name and the first part suffix. If the suffix is '/all'
892 (the default) then the match is only made on the type. If the suffix is
893 '/named' then the rule is only triggered if the POI has a name. If the
894 suffix is '/unnamed' then the rule is only triggered if the POI has no
895 name. A wildcard of an asterisk character may be used to match any type
896 code. The wildcard may also be combined with a suffix to allow separate
897 processing of named and unnamed POIs.
898
899 The second part of the rule is the distance in metres which an already
900 processed POI must be within for it to be considered to be nearby and hence
901 trigger the action part of the rule.
902
903 The third part of the rule is the action part and provides two options:
904
905 delete-poi - the POIS are considered to be duplicates and the duplicate
906 is deleted. This is the default.
907 delete-name - the POIS are not duplicates, but only a single name needs
908 to be displayed.
909
910 Wildcard rules are only applied if no other rule is applicable.
911
912 For example:
913 --nearby-poi-rules=*/named:10,*/unnamed:25,0x2f17-0x2f1f:30
914
915 This has the following effect:
916 If no other rule applies, a POI with the same name and type and within 10m
917 of one already processed will be deleted.
918 If no other rule applies, a POI having no name and of the same type and
919 within 25m of one already processed will be deleted.
920 A POI of any type between 0x2f17 and 0x2f1f that is within 30m of another
921 POI with the same type will be deleted.
922
923 If you have a lot of rules, the --nearby-poi-rules-config option is likely
924 to be easier to use.
925
926 Note: a POI that matches another in type, name and exact location is always
927 considered a duplicate and deleted.
928
929 --nearby-poi-rules-config=filename
930 Allows you to specify the nearby POI rules as described in the
931 --nearby-poi-rules option in a configuration file. The format of the rules
932 is the same as in --nearby-poi-rules, except that each rule is specified on
933 a separate line, rather than separated by commas. This format makes it
934 easier to view and maintain the rules when you have a lot of them. If you
935 just have one or two rules, it is simpler to use the --nearby-poi-rules
936 option.
937966
938967 === Deprecated and Obsolete Options ===
939968
0 svn.version: 4600
1 build.timestamp: 2021-01-25T19:13:35+0000
0 svn.version: 4604
1 build.timestamp: 2021-02-28T07:50:49+0000
637637 while (iter.hasNext()) {
638638 HousenumberRoad hnr = iter.next();
639639
640 List<HousenumberMatch> lostHouses = hnr.checkStreetName(road2HousenumberRoadMap, nodeId2RoadLists);
640 List<HousenumberMatch> lostHouses = hnr.checkStreetName(nodeId2RoadLists);
641641 for (HousenumberMatch house : lostHouses) {
642642 MapRoad r = house.getRoad();
643643 if (r != null) {
11801180 if (house.getRoad() != null && !house.isIgnored()) {
11811181 HousenumberRoad hnr = road2HousenumberRoadMap.get(house.getRoad());
11821182 if (hnr == null) {
1183 log.error("internal error: found no housenumber road for interpolated house",house.toBrowseURL());
1183 log.error("internal error: found no housenumber road for interpolated house number", house.getHousenumber(),house.toBrowseURL());
11841184 continue;
11851185 }
11861186 hnr.addHouse(house);
1212
1313 package uk.me.parabola.mkgmap.osmstyle.housenumber;
1414
15 import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
16
1715 import java.util.ArrayList;
1816 import java.util.Arrays;
1917 import java.util.Collections;
2220 import java.util.Iterator;
2321 import java.util.LinkedHashSet;
2422 import java.util.List;
25 import java.util.Map;
2623 import java.util.Map.Entry;
2724
25 import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
2826 import uk.me.parabola.imgfmt.app.Coord;
2927 import uk.me.parabola.log.Logger;
3028 import uk.me.parabola.mkgmap.general.CityInfo;
650648 * Identify those houses which are assigned to this road because it was the closest,
651649 * but can't be correct because street name doesn't match.
652650 *
653 * @param road2HousenumberRoadMap maps {@link MapRoad} instances to corresponding
654 * {@link HousenumberRoad} instances
655651 * @param nodeId2RoadLists maps node ids to the {@link MapRoad} that use the corresponding nodes.
656652 * @return
657653 */
658 public List<HousenumberMatch> checkStreetName(Map<MapRoad, HousenumberRoad> road2HousenumberRoadMap, Int2ObjectOpenHashMap<HashSet<MapRoad>> nodeId2RoadLists) {
654 public List<HousenumberMatch> checkStreetName(Int2ObjectOpenHashMap<HashSet<MapRoad>> nodeId2RoadLists) {
659655 List<HousenumberMatch> noWrongHouses = Collections.emptyList();
660656 List<HousenumberMatch> wrongHouses = Collections.emptyList();
661657 double minDist = Double.MAX_VALUE;
6969 private double fbRatio = 0.5d;
7070 private int fbThreshold = 20;
7171 private boolean fbDebug;
72 private boolean checkCoastline = false;
7273
7374 private ElementSaver saver;
7475
186187 fbThreshold = (int) Double.parseDouble(option.substring("fbthres=".length()));
187188 } else if ("fbdebug".equals(option)) {
188189 fbDebug = true;
190 } else if ("check".equals(option)) {
191 checkCoastline = true;
189192 } else {
190193 printOptionHelpMsg(forPrecompSea, option);
191194 }
285288 System.err.println(" land-tag=TAG=VAL tag to use for land polygons (default natural=land)");
286289 if (forPrecompSea)
287290 return;
291
288292 System.err.println(" no-sea-sectors disable use of \"sea sectors\"");
289293 System.err.println(" extend-sea-sectors extend coastline to reach border");
290294 System.err.println(" close-gaps=NUM close gaps in coastline that are less than this distance (metres)");
292296 System.err.println(" fbgap=NUM points closer to the coastline are ignored for flood blocking (default 40)");
293297 System.err.println(" fbthres=NUM min points contained in a polygon to be flood blocked (default 20)");
294298 System.err.println(" fbratio=NUM min ratio (points/area size) for flood blocking (default 0.5)");
295 }
296
299 System.err.println(" check check for sea polygons within sea and land within land");
300 }
301
297302 /**
298303 * Read the index from stream and populate the index grid.
299304 * @param fileStream already opened stream
585590 List<Way> seaWays = new ArrayList<>();
586591
587592 // get the index with assignment key => sea/land/tilename
588 distinctTilesOnly = loadLandAndSee(landWays, seaWays);
593 distinctTilesOnly = loadLandAndSea(landWays, seaWays);
589594
590595 if (generateSeaUsingMP || distinctTilesOnly) {
591596 // when using multipolygons use the data directly from the precomp files
601606 }
602607
603608 // check if the land tags need to be changed
604 boolean changeLadTag = landTag != null && ("natural".equals(landTag[0]) && !"land".equals(landTag[1]));
609 boolean changeLandTag = landTag != null && ("natural".equals(landTag[0]) && !"land".equals(landTag[1]));
605610 for (Way w : landWays) {
606 if (changeLadTag) {
611 if (changeLandTag) {
607612 w.deleteTag("natural");
608613 w.addTag(landTag[0], landTag[1]);
609614 }
612617 }
613618
614619
615 private boolean loadLandAndSee(List<Way> landWays, List<Way> seaWays) {
620 private boolean loadLandAndSea(List<Way> landWays, List<Way> seaWays) {
616621 boolean distinctTilesOnly = true;
617622 List<java.awt.geom.Area> seaOnlyAreas = new ArrayList<>();
618623 List<java.awt.geom.Area> landOnlyAreas = new ArrayList<>();
759764 } else if (w.getPoints().size() > 1){
760765 beginMap.put(w.getFirstPoint(), w);
761766 } else {
762 log.info("Discarding coastline way", w.getId(), "because it consists of less than 2 points");
767 log.info("Discarding coastline", w.getBasicLogInformation(), "because it consists of less than 2 points");
763768 }
764769 }
765770 segments.clear();
784789
785790 // merge the ways and maintain maps and list
786791 private static void merge(Map<Coord, Way> beginMap, List<Way> joined, Way w1, Way w2) {
787 log.info("merging: ", beginMap.size(), w1.getId(), w2.getId());
792 log.info("merging:", beginMap.size(), w1.getBasicLogInformation(), "with", w2.getBasicLogInformation());
788793 Way wm;
789794 if (FakeIdGenerator.isFakeId(w1.getId())) {
790795 wm = w1;
830835 }
831836
832837 // clip all shoreline segments
833 clipShorlineSegments();
838 clipShorelineSegments();
834839
835840 if(shoreline.isEmpty()) {
836841 // No sea required
876881
877882 createLandPolygons(hitMap);
878883 processIslands(seaRelation);
879 processAntiIslands(true);
884 checkIslands(true);
880885
881886 Way sea = createSeaWay(true);
882887
883 log.info("sea: ", sea);
888 log.info("sea:", sea);
884889 saver.addWay(sea);
885890 if(seaRelation != null)
886891 seaRelation.addElement("outer", sea);
887892 } else {
888893 // background is land
889894 createSeaPolygons(hitMap);
890 processAntiIslands(false);
895 checkIslands(false);
891896
892897 // generate a land polygon so that the tile's
893898 // background colour will match the land colour on the
930935 }
931936
932937 /**
933 * These are bits of sea have been generated as polygons.
934 * if the tile is also sea based, then check that surrounded by an island
935 * @param seaRelation if set, add as inner
938 * Check whether land is enclosed in land or sea within sea.
936939 * @param seaBased true if the tile is also sea with land [multi-]polygons
937940 */
938 private void processAntiIslands(boolean seaBased) {
941 private void checkIslands(boolean seaBased) {
942 if (!checkCoastline)
943 return;
944
939945 for (Way ai : antiIslands) {
940 if (seaBased) {
941 boolean containedByLand = false;
942 for (Way i : islands) {
943 if (i.containsPointsOf(ai)) {
944 containedByLand = true;
945 break;
946 }
947 }
948 if (!containedByLand) {
949 // found an anti-island that is not contained by land
950 log.warn("inner sea", ai , "is surrounded by water");
951 }
952 }
946 Way containingLand = null;
947 Way containingSea = null;
948 for (Way i : islands) {
949 if (i.containsPointsOf(ai) && ((containingLand == null) || (containingLand.containsPointsOf(i))))
950 containingLand = i;
951 }
952 for (Way ai2 : antiIslands) {
953 if ((ai2 != ai) && ai2.containsPointsOf(ai) && ((containingSea == null) || containingSea.containsPointsOf(ai2)))
954 containingSea = ai2;
955 }
956 if ((containingSea != null) && (containingLand != null)) {
957 if (containingSea.containsPointsOf(containingLand))
958 containingSea = null;
959 else if (containingLand.containsPointsOf(containingSea))
960 containingLand = null;
961 else {
962 log.warn("inner sea", ai, "is surrounded by both water", containingSea, "and land", containingLand);
963 containingSea = null;
964 containingLand = null;
965 }
966 }
967 if ((containingLand == null) && (seaBased || (containingSea != null)))
968 log.error("inner sea", ai, "is surrounded by water", containingSea == null ? "" : containingSea);
969 }
970
971 for (Way i : islands) {
972 Way containingLand = null;
973 Way containingSea = null;
974 for (Way ai : antiIslands) {
975 if (ai.containsPointsOf(i) && ((containingSea == null) || containingSea.containsPointsOf(ai)))
976 containingSea = ai;
977 }
978 for (Way i2 : islands) {
979 if ((i2 != i) && i2.containsPointsOf(i) && ((containingLand == null) || (containingLand.containsPointsOf(i2))))
980 containingLand = i2;
981 }
982 if ((containingSea != null) && (containingLand != null)) {
983 if (containingSea.containsPointsOf(containingLand))
984 containingSea = null;
985 else if (containingLand.containsPointsOf(containingSea))
986 containingLand = null;
987 else {
988 log.warn("island", i, "is surrounded by both water", containingSea, "and land", containingLand);
989 containingSea = null;
990 containingLand = null;
991 }
992 }
993 if ((containingSea == null) && (containingLand != null))
994 log.error("island", i, "is surrounded by land", containingLand);
953995 }
954996 }
955997
9871029 /**
9881030 * Clip the shoreline ways to the bounding box of the map.
9891031 */
990 private void clipShorlineSegments() {
1032 private void clipShorelineSegments() {
9911033 List<Way> toBeRemoved = new ArrayList<>();
9921034 List<Way> toBeAdded = new ArrayList<>();
9931035 for (Way segment : shoreline) {
11091151 if (Way.clockwise(w.getPoints()))
11101152 addAsSea(w);
11111153 else
1112 addAsLand(w);
1154 addAsLand(w);
11131155 }
11141156
11151157 private void addAsSea(Way w) {
11351177 private void createLandPolygons(NavigableMap<Double, Way> hitMap) {
11361178 NavigableSet<Double> hits = hitMap.navigableKeySet();
11371179 while (!hits.isEmpty()) {
1138 Way w = new Way(FakeIdGenerator.makeFakeId());
11391180 Double hFirst = hits.first();
11401181 Double hStart = hFirst, hEnd;
1182 Way w = new Way(hitMap.get(hFirst).getOriginalId());
1183 w.markAsGeneratedFrom(hitMap.get(hFirst));
11411184 boolean finished = false;
11421185 do {
11431186 Way segment = hitMap.get(hStart);
11731216 private void createSeaPolygons(NavigableMap<Double, Way> hitMap) {
11741217 NavigableSet<Double> hits = hitMap.navigableKeySet();
11751218 while (!hits.isEmpty()) {
1176 Way w = new Way(FakeIdGenerator.makeFakeId());
11771219 Double hFirst = hits.last();
11781220 Double hStart = hFirst, hEnd;
1221 Way w = new Way(hitMap.get(hFirst).getOriginalId());
1222 w.markAsGeneratedFrom(hitMap.get(hFirst));
11791223 boolean finished = false;
11801224 do {
11811225 Way segment = hitMap.get(hStart);
12441288 Double hEnd = getEdgeHit(tileBounds, pEnd);
12451289 if (hStart != null && hEnd != null) {
12461290 // nice case: both ends touch the boundary
1247 log.debug("hits: ", hStart, hEnd);
1291 log.debug("hits:", hStart, hEnd);
12481292 hitMap.put(hStart, w);
12491293 hitMap.put(hEnd, null); // put this for verifyHits which then deletes it
12501294 } else {
12671311 */
12681312 List<Coord> points = w.getPoints();
12691313 if (allowSeaSectors) {
1270 Way seaOrLand = new Way(FakeIdGenerator.makeFakeId());
1314 Way seaOrLand = new Way(w.getOriginalId());
1315 seaOrLand.markAsGeneratedFrom(w);
12711316 seaOrLand.getPoints().addAll(points);
12721317 int startLat = pStart.getHighPrecLat();
12731318 int startLon = pStart.getHighPrecLon();
12901335 }
12911336 seaOrLand.addPoint(Coord.makeHighPrecCoord(cornerLat, cornerLon));
12921337 seaOrLand.addPoint(pStart);
1293 log.info("seaSector: ", generateSeaBackground, startLatIsCorner, Way.clockwise(seaOrLand.getPoints()), seaOrLand);
1338 log.info("seaSector:", generateSeaBackground, startLatIsCorner, Way.clockwise(seaOrLand.getPoints()), seaOrLand.getBasicLogInformation());
12941339 } else if (extendSeaSectors) {
12951340 // join to nearest tile border
12961341 if (null == hStart) {
13011346 hEnd = getNextEdgeHit(tileBounds, pEnd);
13021347 w.getPoints().add(getPoint(tileBounds, hEnd));
13031348 }
1304 log.debug("hits (second try): ", hStart, hEnd);
1349 log.debug("hits (second try):", hStart, hEnd);
13051350 hitMap.put(hStart, w);
13061351 hitMap.put(hEnd, null); // put this for verifyHits which then deletes it
13071352 } else {
13271372 NavigableSet<Double> hits = hitMap.navigableKeySet();
13281373 Iterator<Double> iter = hits.iterator();
13291374 int lastStatus = 0, thisStatus;
1375 Double lastHit = 0.0;
13301376 while (iter.hasNext()) {
13311377 Double aHit = iter.next();
13321378 Way segment = hitMap.get(aHit);
13381384 thisStatus = +1;
13391385 }
13401386 if (thisStatus == lastStatus)
1341 log.error("Adjacent coastlines hit tile edge in same direction", aHit, segment);
1387 log.error("Adjacent coastlines hit tile edge in same direction at", getPoint(tileBounds, lastHit).toDegreeString(), "and", getPoint(tileBounds, aHit).toDegreeString(), segment);
13421388 lastStatus = thisStatus;
1389 lastHit = aHit;
13431390 }
13441391 }
13451392
13461393 // create the point where the shoreline hits the sea bounds
13471394 private static Coord getPoint(Area a, double edgePos) {
1348 log.info("getPoint: ", a, edgePos);
1395 log.info("getPoint:", a, edgePos);
13491396 int aMinLongHP = a.getMinLong() << Coord.DELTA_SHIFT;
13501397 int aMaxLongHP = a.getMaxLong() << Coord.DELTA_SHIFT;
13511398 int aMinLatHP = a.getMinLat() << Coord.DELTA_SHIFT;