logo separator

[mkgmap-dev] [PATCH v1] Extend tags for poi placement for the add-pois-to-areas option

From Olaf Hasemann o.hasemann at gmx.de on Wed Oct 19 12:37:18 BST 2011

Hello WanMil

Am Dienstag 18 Oktober 2011, 23:06:50 schrieb WanMil:

> The patch adds a new option "pois-to-areas-placement". This option
> defines on which node the POI generated from a polygon is placed
> preferrably.
> Example:
> pois-to-areas-placement=entrance=main;entrance=yes;building=entrance

thanks for the new option. It looks fine but does not allow
an empty taglist without faking trick which creates an error message for 
example via:

So i added three lines on top of your patch that explizit allow an empty 
taglist and so disables any placements at the borderline of a polygon:

	 * Reads the tag definitions of the option poi2area-placement-tags from 
the given properties.
	 * @param props mkgmap options
	 * @return the parsed tag definition list
	private List<Entry<String,String>> getPoiPlacementTags(EnhancedProperties 
props) {
		List<Entry<String,String>> tagList = new 
		String placementDefs = props.getProperty("pois-to-areas-placement", 
+		placementDefs = placementDefs.trim();
+		if ( placementDefs.length() == 0 ) {
+		    return tagList;
+		}
		String[] placementDefsParts = placementDefs.split(";");
		for (String placementDef : placementDefsParts) {
The rest is unchanged

Using this it behaves as follows(on the command line, arg file works similar):

1) no pois-to-areas-placement option given (default) is identical to:

2) pois-to-areas-placement option given without arg always uses the center

3) pois-to-areas-placement option given with valid arg places the node as you     
	described it:

your opinions?

More information about the mkgmap-dev mailing list