Пример #1
0
 public void MarkHardwareLevelsUsed(MapDataAnalysis analysis)
 {
     foreach (ContourRenderingTemplate template in templates)
     {
         template.MarkHardwareLevelsUsed(analysis);
     }
 }
Пример #2
0
 public abstract void RenderOsmObject(
     MapMakerSettings mapMakerSettings,
     MapDataAnalysis analysis,
     InMemoryOsmDatabase osmDatabase,
     OsmObjectBase osmObject,
     OsmRelation parentRelation,
     CGpsMapperMapWriter mapWriter);
Пример #3
0
 public void MarkHardwareLevelsUsed(MapDataAnalysis analysis)
 {
     foreach (ContoursElevationRule rule in rules.Values)
     {
         rule.MarkHardwareLevelsUsed(analysis);
     }
 }
Пример #4
0
 public void MarkHardwareLevelsUsed(MapDataAnalysis analysis)
 {
     if (Style.MinZoomFactor != int.MinValue)
     {
         analysis.MarkUsedHardwareLevel(Style.MinZoomFactor);
     }
     if (Style.MaxZoomFactor != int.MaxValue)
     {
         analysis.MarkUsedHardwareLevel(Style.MaxZoomFactor);
     }
 }
Пример #5
0
 public void RenderContour(
     IPointD2List contourPoints,
     double contourElevation,
     MapDataAnalysis analysis,
     CGpsMapperMapWriter mapWriter)
 {
     foreach (ContourRenderingTemplate template in templates)
     {
         template.RenderContour(contourPoints, contourElevation, analysis, mapWriter);
     }
 }
Пример #6
0
        protected override void AnalyzeDataInternal()
        {
            LoadRulesIfNecessary();

            Analysis = new MapDataAnalysis();
            Settings.ContoursRenderingRules.MarkHardwareLevelsUsed(Analysis);
            Settings.ContoursRenderingRules.RegisterTypes(Settings.TypesRegistry);

            tileBoxRegistration          = Settings.TypesRegistry.RegisterNewLineType("ContoursTileBox");
            tileBoxRegistration.MaxLevel = 24;
            tileBoxRegistration.MinLevel = 24;
            tileBoxRegistration.Pattern  = new PatternDefinition();
            tileBoxRegistration.Pattern.AddColor("#7F3300");
            tileBoxRegistration.Pattern.PatternLines.Add("0000");
        }
Пример #7
0
        public void RenderPolygon(
            MapMakerSettings mapMakerSettings,
            MapDataAnalysis analysis,
            IPointD2List polygonPoints,
            CGpsMapperMapWriter mapWriter)
        {
            mapWriter.AddSection("POLYGON")
            .AddTypeReference(TypeRegistration)
            .AddCoordinates(
                "Data",
                analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel],
                polygonPoints);

            mapWriter
            .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel])
            ;
        }
Пример #8
0
        public void RenderContour(
            IPointD2List contourPoints,
            double contourElevation,
            MapDataAnalysis analysis,
            CGpsMapperMapWriter mapWriter)
        {
            mapWriter.AddSection("POLYLINE")
            .AddTypeReference(TypeRegistration)
            .AddCoordinates(
                "Data",
                analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel],
                contourPoints)
            .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel]);

            if (showElevation)
            {
                mapWriter.Add("Label", (int)contourElevation);
            }
        }
Пример #9
0
        public override void RenderOsmObject(
            MapMakerSettings mapMakerSettings,
            MapDataAnalysis analysis,
            InMemoryOsmDatabase osmDatabase,
            OsmObjectBase osmObject,
            OsmRelation parentRelation,
            CGpsMapperMapWriter mapWriter)
        {
            mapWriter.AddSection("POLYGON")
            .AddTypeReference(TypeRegistration)
            .AddCoordinates(
                "Data",
                analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel],
                GetNodesForWay(osmDatabase, (OsmWay)osmObject));

            // rendering of holes
            if (osmObject is OsmAreaWithHoles)
            {
                OsmAreaWithHoles areaWithHoles = (OsmAreaWithHoles)osmObject;
                foreach (int holeWayId in areaWithHoles.EnumerateHolesWaysIds())
                {
                    OsmWay holeWay = osmDatabase.GetWay(holeWayId);
                    if (holeWay.NodesCount > 3)
                    {
                        mapWriter.AddCoordinates(
                            "Data",
                            analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel],
                            GetNodesForWay(osmDatabase, holeWay));
                    }
                }
            }

            mapWriter
            .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel])
            ;

            if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant)
            {
                mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation));
            }
        }
Пример #10
0
        public override void RenderOsmObject(
            MapMakerSettings mapMakerSettings,
            MapDataAnalysis analysis,
            InMemoryOsmDatabase osmDatabase,
            OsmObjectBase osmObject,
            OsmRelation parentRelation,
            CGpsMapperMapWriter mapWriter)
        {
            mapWriter.AddSection("POI")
            .AddTypeReference(TypeRegistration);

            // find the location to put the icon on
            OsmNode iconNode = null;

            if (osmObject is OsmNode)
            {
                iconNode = (OsmNode)osmObject;
            }
            else if (osmObject is OsmWay)
            {
                PointD2 location = Brejc.OsmLibrary.Helpers.OsmGeometryUtils.FindAreaCenterPoint(
                    (OsmWay)osmObject,
                    osmDatabase);
                iconNode = new OsmNode(1, location.X, location.Y);
            }
            else
            {
                throw new InvalidOperationException("Internal error.");
            }

            mapWriter
            .AddCoordinates("Data", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel], iconNode)
            .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel])
            ;

            if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant)
            {
                mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation));
            }
        }
Пример #11
0
        public override void RenderOsmObject(
            MapMakerSettings mapMakerSettings,
            MapDataAnalysis analysis,
            InMemoryOsmDatabase osmDatabase,
            OsmObjectBase osmObject,
            OsmRelation parentRelation,
            CGpsMapperMapWriter mapWriter)
        {
            mapWriter.AddSection("POLYLINE")
            .AddTypeReference(TypeRegistration)
            .AddCoordinates(
                "Data",
                analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MaxLevel],
                GetNodesForWay(osmDatabase, (OsmWay)osmObject))
            .Add("EndLevel", analysis.HardwareToLogicalLevelDictionary[TypeRegistration.MinLevel])
            ;

            if (this.TypeRegistration.Label != null && false == this.TypeRegistration.Label.IsConstant)
            {
                mapWriter.Add("Label", this.TypeRegistration.Label.BuildLabel(mapMakerSettings, osmObject, parentRelation).ToUpperInvariant());
            }
        }
Пример #12
0
 public RenderingRuleEngine(MapDataAnalysis analysis)
 {
     this.analysis = analysis;
 }