Ejemplo n.º 1
0
 private void addTags(short[] addendum)
 {
     if (this.tags == null)
     {
         this.tags = addendum;
     }
     else
     {
         TShortSet tags2 = new TShortHashSet();
         tags2.addAll(this.tags);
         tags2.addAll(addendum);
         this.tags = tags2.toArray();
     }
 }
Ejemplo n.º 2
0
        /// <param name="tagSet">
        ///            the tag set </param>
        /// <returns> the minimum zoom level of all tags in the tag set </returns>
        public sbyte getZoomAppearPOI(short[] tagSet)
        {
            if (tagSet == null || tagSet.Length == 0)
            {
                return(sbyte.MaxValue);
            }

            TShortHashSet tmp = new TShortHashSet(tagSet);

            if (this.poiZoomOverrides.Count > 0)
            {
                foreach (short s in tagSet)
                {
                    ISet <OSMTag> overriddenTags = this.poiZoomOverrides[Convert.ToInt16(s)];
                    if (overriddenTags != null)
                    {
                        foreach (OSMTag osmTag in overriddenTags)
                        {
                            tmp.remove(osmTag.Id);
                        }
                    }
                }

                if (tmp.Empty)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (short s in tagSet)
                    {
                        sb.Append(this.idToPoiTag[Convert.ToInt16(s)].tagKey() + "; ");
                    }
                    LOGGER.severe("ERROR: You have a cycle in your zoom-override definitions. Look for these tags: " + sb.ToString());
                }
            }

            sbyte zoomAppear = sbyte.MaxValue;

            foreach (short s in tmp.toArray())
            {
                OSMTag tag = this.idToPoiTag[Convert.ToInt16(s)];
                if (tag.Renderable)
                {
                    zoomAppear = (sbyte)Math.Min(zoomAppear, tag.ZoomAppear);
                }
            }

            return(zoomAppear);
        }