Exemple #1
0
 private void ApplyAttributesOfDataFrame(IGxdDataFrame gxdDataFrame, IDataFrame iDataFrame, ILayout layout, PrjEnvelope envelope)
 {
     Layout.GxdEnvelope gxdEnv = ToPrjEnvelope(envelope, gxdDataFrame, iDataFrame);
     if (gxdEnv != null)
     {
         FitSizeToTemplateWidth(layout, (float)(gxdEnv.MaxX - gxdEnv.MinX), (float)(gxdEnv.MaxY - gxdEnv.MinY));
         gxdDataFrame.Envelope = gxdEnv;
     }
 }
 protected override void ApplyAttributesOfDataFrame(Layout.IGxdDataFrame gxdDataFrame, Layout.IDataFrame dataFrame, ILayout layout)
 {
     Layout.GxdEnvelope evp = ToPrjEnvelope(_env, gxdDataFrame.SpatialRef);
     if (evp != null)
     {
         FitTemplateWidth(layout, (float)(evp.MaxX - evp.MinX), (float)(evp.MaxY - evp.MinY));
         gxdDataFrame.Envelope = evp;
     }
     base.ApplyAttributesOfDataFrame(gxdDataFrame, dataFrame, layout);
 }
Exemple #3
0
        protected override void ApplyAttributesOfDataFrame(IGxdDataFrame gxdDataFrame, IDataFrame dataFrame, ILayout layout)
        {
            string instanceIdentify = _argumentProvider.GetArg("OutFileIdentify") as string;

            Layout.GxdEnvelope evp = ToPrjEnvelope(_envelope, gxdDataFrame, dataFrame);
            if (evp != null)
            {
                FitSizeToTemplateWidth(layout, (float)(evp.MaxX - evp.MinX), (float)(evp.MaxY - evp.MinY));
                gxdDataFrame.Envelope = evp;
                _envelope             = null;
            }
        }
Exemple #4
0
 //设置数据层范围
 protected override void ApplyAttributesOfDataFrame(IGxdDataFrame gxdDataFrame, IDataFrame dataFrame, ILayout layout)
 {
     try
     {
         Layout.GxdEnvelope evp = ToPrjEnvelope(_shpEnvelope, gxdDataFrame, dataFrame);
         if (evp != null)
         {
             FitSizeToTemplateWidth(layout, (float)(evp.MaxX - evp.MinX), (float)(evp.MaxY - evp.MinY));
             gxdDataFrame.Envelope = evp;
         }
     }
     catch (Exception ex)
     {
         PrintInfo(ex.Message);
     }
     base.ApplyAttributesOfDataFrame(gxdDataFrame, dataFrame, layout);
 }
Exemple #5
0
        protected override void ApplyAttributesOfDataFrame(IGxdDataFrame gxdDataFrame, IDataFrame dataFrame, ILayout layout)
        {
            string instanceIdentify = _argumentProvider.GetArg("OutFileIdentify") as string;
            string envelope         = null;

            if (instanceIdentify == "TFRI")
            {
                envelope = _argumentProvider.GetArg("OldThemeEnvelope").ToString();
            }
            else
            {
                envelope = _argumentProvider.GetArg("ThemeEnvelope").ToString();
            }
            if (string.IsNullOrEmpty(envelope))
            {
                return;
            }
            string[] latlon = envelope.Split(',');
            if (latlon == null || latlon.Length < 4)
            {
                return;
            }
            ISmartSession session = _argumentProvider.GetArg("SmartSession") as ISmartSession;

            if (session == null)
            {
                return;
            }
            double[] geoRange;
            if (!IsSetRange(session, latlon, out geoRange))
            {
                return;
            }
            GxdEnvelope env = new GxdEnvelope(double.Parse(latlon[0]), double.Parse(latlon[1]), double.Parse(latlon[2]), double.Parse(latlon[3]));

            Layout.GxdEnvelope evp = ToPrjEnvelope(env, gxdDataFrame, dataFrame);
            if (evp != null)
            {
                FitSizeToTemplateWidth(layout, (float)(evp.MaxX - evp.MinX), (float)(evp.MaxY - evp.MinY));
                gxdDataFrame.Envelope = evp;
            }
            base.ApplyAttributesOfDataFrame(gxdDataFrame, dataFrame, layout);
        }
Exemple #6
0
 private Layout.GxdEnvelope ToPrjEnvelope(Layout.GxdEnvelope env, Layout.IGxdDataFrame gxdDataFrame, Layout.IDataFrame dataFrame)
 {
     GeoDo.Project.IProjectionTransform tran = GetProjectionTransform(gxdDataFrame.SpatialRef);
     if (tran == null)
     {
         return(null);
     }
     double[] xs = new double[] { env.MinX, env.MaxX };
     double[] ys = new double[] { env.MaxY, env.MinY };
     try
     {
         tran.Transform(xs, ys);
         return(new Layout.GxdEnvelope(xs[0], xs[1], ys[1], ys[0]));
     }
     catch
     {
         return(null);
     }
 }
 private Layout.GxdEnvelope ToPrjEnvelope(Layout.GxdEnvelope env, string spatialRef)
 {
     if (_env == null)
     {
         return(null);
     }
     GeoDo.Project.IProjectionTransform tran = GetProjectionTransform(spatialRef);
     if (tran == null)
     {
         return(null);
     }
     double[] xs = new double[] { env.MinX, env.MaxX };
     double[] ys = new double[] { env.MaxY, env.MinY };
     try
     {
         tran.Transform(xs, ys);
         return(new Layout.GxdEnvelope(xs[0], xs[1], ys[1], ys[0]));
     }
     catch
     {
         return(null);
     }
 }
 public void SetEnvelope(Layout.GxdEnvelope env)
 {
     _env = env;
 }
 public CmaThemeGraphGenerator(ISmartSession session)
     : base(session)
 {
     _env = null;
 }