用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(三)

从冰棍到铸钢:手把手用Fluent融化凝固模型模拟3个不同场景(含案例设置对比) 本文深入探讨了Fluent融化凝固模型在冰棍融化、巧克力涂层凝固和钢铁连铸三个不同场景中的应用。通过详细的参数设置和案例对比,帮助工程师掌握相变模拟的核心技巧,提升工业级CFD分析的精度和效率。 阅读详情

本文介绍一下功能实现,并给出核心部分代码。

首先要定义各种结构,包括传入参数、传出结果、规则集合等,如下:

using GeoJSON.Net.Feature;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;

namespace GISWebService.HttpRequestContent
{
    /// <summary>
    /// 属性质检的传入参数
    /// </summary>
    public class CheckFields
    {
        /// <summary>
        /// 图层
        /// </summary>
        [JsonProperty("layer")]
        public string Layer { get; set; }
        /// <summary>
        /// 要素集合
        /// </summary>
        [JsonProperty("feature")]
        public List<Feature> Feature { get; set; }
    }


    /// <summary>
    /// 要素属性质检结果
    /// </summary>
    public class CheckFieldsResult
    {
        /// <summary>
        /// OBJECTID
        /// </summary>
        [JsonProperty("objectid")]
        public int ObjectID { get; set; }
        /// <summary>
        /// 字段检查结果
        /// </summary>
        [JsonProperty("fields")]
        public List<string> FieldInfo { get; set; }
    }

    /// <summary>
    /// 属性质检结果
    /// </summary>
    public class CheckFieldsResponseBody
    {
        /// <summary>
        /// 图层
        /// </summary>
        [JsonProperty("layer")]
        public string Layer { get; set; }
        /// <summary>
        /// 质检结果
        /// </summary>
        [JsonProperty("info")]
        public List<CheckFieldsResult> Information { get; set; }
    }

    /// <summary>
    /// 规则:来自集合
    /// </summary>
    public class RuleCollection
    {
        /// <summary>
        /// 分隔符
        /// </summary>
        [JsonProperty("seperator")]
        [DefaultValue(",")]
        public string Seperator { get; set; }
        /// <summary>
        /// 集合
        /// </summary>
        [JsonProperty("list")]
        [JsonConverter(typeof(ValueToList))]
        public List<string> Items { get; set; }
    }

    /// <summary>
    /// 属性值质检规则
    /// </summary>
    public class RuleValueItem
    {
        /// <summary>
        /// 字段名
        /// </summary>
        [JsonProperty("name")]
        public string FieldName { get; set; }
        /// <summary>
        /// 允许空值(默认为true)
        /// </summary>
        [JsonProperty("nullable")]
        [DefaultValue(true)]
        public bool Nullable { get; set; }
        /// <summary>
        /// 来自集合
        /// </summary>
        [JsonProperty("collection", NullValueHandling = NullValueHandling.Ignore)]
        public RuleCollection RuleOfCollection { get; set; }
        /// <summary>
        /// 正则表达式
        /// </summary>
        [JsonProperty("expression", NullValueHandling = NullValueHandling.Ignore)]
        public string RegExp { get; set; }
    }

    /// <summary>
    /// 要素类属性值质检规则
    /// </summary>
    public class RuleValue
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 各字段规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleValueItem> RuleItems { get; set; }
    }

    /// <summary>
    /// 属性空值限制质检规则
    /// </summary>
    public class RuleRestrictionItem
    {
        /// <summary>
        /// 主干(非空时要求分支不为空)
        /// </summary>
        [JsonProperty("trunk")]
        public string Trunk { get; set; }
        /// <summary>
        /// 分支
        /// </summary>
        [JsonProperty("branch")]
        [DefaultValue(true)]
        public List<string> Branches { get; set; }
    }

    /// <summary>
    /// 要素类属性值质检规则
    /// </summary>
    public class RuleRestriction
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 属性空值限制质检规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleRestrictionItem> RuleItems { get; set; }
    }


    /// <summary>
    /// 属性空值限制质检规则
    /// </summary>
    public class RuleRelationItem
    {
        /// <summary>
        /// 较短的字段
        /// </summary>
        [JsonProperty("short")]
        public string ShortField { get; set; }
        /// <summary>
        /// 较长的字段(非空时,较短字段为其取值的一部分)
        /// </summary>
        [JsonProperty("long")]
        public string LongField { get; set; }

        /// <summary>
        /// 起始索引(从1起算,取值包含该索引)
        /// </summary>
        [JsonProperty("from")]
        public int FromIndex { get; set; }
        /// <summary>
        /// 终止索引(从1起算,大于起始索引,但小于总长度,取值包含该索引)
        /// </summary>
        [JsonProperty("to")]
        public int ToIndex { get; set; }
    }

    /// <summary>
    /// 要素类属性关系质检规则
    /// </summary>
    public class RuleRelation
    {
        /// <summary>
        /// 要素类集合
        /// </summary>
        [JsonProperty("featureclass")]
        public List<string> FeatureClassNames { get; set; }
        /// <summary>
        /// 属性关系质检规则
        /// </summary>
        [JsonProperty("rule")]
        public List<RuleRelationItem> RuleItems { get; set; }
    }

    public class ValueToList : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return true;
        }

        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            bool isTypeNullable = IsNullableType(objectType);
            Type t = isTypeNullable ? Nullable.GetUnderlyingType(objectType) : objectType;
            if (reader.TokenType == JsonToken.Null)
            {
                if (!IsNullableType(objectType))
                    throw new Exception(string.Format("不能转换null value to {0}.", objectType));
                return null;
            }
            try
            {
                List<string> ls = new List<string>();
                if (reader.TokenType == JsonToken.String)
                {
                    string sValue = reader.Value.ToString();
                    string[] arrayValue = sValue.Split(',');
                    foreach (string s in arrayValue)
                    {
                        if (string.IsNullOrWhiteSpace(s))
                            continue;
                        ls.Add(s);
                    }
                }
                return ls;
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error converting value {0} to type '{1}'", reader.Value, objectType));
            }
            throw new Exception(string.Format("Unexpected token {0} when parsing enum", reader.TokenType));
        }

        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            if (null == value)
            {
                writer.WriteNull();
                return;
            }
            List<string> ls = value as List<string>;
            if (null == ls || 0 == ls.Count)
            {
                writer.WriteNull();
                return;
            }
            string result = "";
            foreach (string s in ls)
            {
                if (string.IsNullOrEmpty(s) || string.IsNullOrWhiteSpace(s))
                    continue;
                if (string.IsNullOrEmpty(result))
                {
                    result = s;
                }
                else
                {
                    result += "," + s;
                }
            }
            writer.WriteValue(result);
        }

        public bool IsNullableType(Type t)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t");
            }
            return (t.BaseType.FullName == "System.ValueType" && t.GetGenericTypeDefinition() == typeof(Nullable<>));
        }
    }
}

先定义一个CheckValue类,来实现属性质检规则的加载:

using GeoJSON.Net.Feature;
using GISWebService.HttpRequestContent;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GISWebService.Common
{
    public class CheckValue
    {
        private static string _CheckRelationConfig = "CheckRelation.json";
        private static string _CheckRestrictionConfig = "CheckRestriction.json";
        private static string _CheckValueConfig = "CheckValue.json";

        private static List<RuleRelation> _RuleRelations = null;
        private static List<RuleRestriction> _RuleRestrictions = null;
        private static List<RuleValue> _RuleValues = null;
        /// <summary>
        /// 属性关系检查规则
        /// </summary>
        public static List<RuleRelation> RuleRelations { get { return GetRules<RuleRelation>(_CheckRelationConfig, _RuleRelations as System.Collections.IList) as List<RuleRelation>; } }
        /// <summary>
        /// 属性空值约束检查规则
        /// </summary>
        public static List<RuleRestriction> RuleRestrictions { get { return GetRules<RuleRestriction>(_CheckRestrictionConfig, _RuleRestrictions as System.Collections.IList) as List<RuleRestriction>; } }
        /// <summary>
        /// 属性值检查规则
        /// </summary>
        public static List<RuleValue> RuleValues { get { return GetRules<RuleValue>(_CheckValueConfig, _RuleValues as System.Collections.IList) as List<RuleValue>; } }

        private static System.Collections.IList GetRules<T>(string name, System.Collections.IList rules)
        {
            if (null == rules)
            {
                Type aType = typeof(List<>).MakeGenericType(typeof(T));
                rules = Activator.CreateInstance(aType) as System.Collections.IList;
            }
            if (0 == rules.Count)
                rules = LoadRules<T>(name);
            return rules;
        }

        private static string GetConfigFile(string name)
        {
            string path = "";
            try
            {
                string s = System.IO.Path.Combine(AppSettings.PathByKey("tempdir"), name);
                path = System.IO.File.Exists(s) ? s : "";
            }
            catch (Exception e)
            {
                ExceptionHelper.LogActionException(e);
            }
            return path;
        }

        private static System.Collections.IList LoadRules<T>(string name)
        {
            string sPath = GetConfigFile(name);
            Type aType = typeof(List<>).MakeGenericType(typeof(T));
            System.Collections.IList ls = Activator.CreateInstance(aType) as System.Collections.IList;
            if (!string.IsNullOrEmpty(sPath))
            {
                string sContent = System.IO.File.ReadAllText(sPath, System.Text.Encoding.Default);
                ls = Newtonsoft.Json.JsonConvert.DeserializeObject(sContent, aType) as System.Collections.IList;
            }
            return ls;
        }

    }
}

在核心的质检类CheckValueHelper类中定义质检的方法,并让它继承自CheckValue类:

using GeoJSON.Net.Feature;
using GISWebService.HttpRequestContent;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;

namespace GISWebService.Common
{
    public class CheckValueHelper : CheckValue
    {
        public static CheckFieldsResult Check(string featureclass, Feature feature)
        {
            CheckFieldsResult result = new CheckFieldsResult() { ObjectID = -1, FieldInfo = new List<string>() };
            int oid = GetObjectID(feature);
            if (0 <= oid)
            {
                result.ObjectID = oid;
                result.FieldInfo.AddRange(CheckRelation(featureclass, feature.Properties, RuleRelations));
                result.FieldInfo.AddRange(CheckRestriction(featureclass, feature.Properties, RuleRestrictions));
                result.FieldInfo.AddRange(CheckValue(featureclass, feature.Properties, RuleValues));
            }
            return result;
        }

        private static int GetObjectID(Feature feature)
        {
            int n = -1;
            if (null == feature || null == feature.Properties || 0 == feature.Properties.Count)
                return n;
            foreach (var item in feature.Properties)
            {
                if (0 == string.Compare(item.Key, "objectid", true))
                {
                    if (null == item.Value)
                        continue;
                    int oid = -1;
                    if (int.TryParse(item.Value.ToString(), out oid) && 0 < oid)
                    {
                        n = Convert.ToInt32(item.Value.ToString());
                        break;
                    }
                }
            }
            return n;
        }

        private static string GetValueToString(Dictionary<string, object> dict, string key, bool ignoreCase = true, bool removeWhitespace = true)
        {
            string s = "";
            if (null == dict || 0 == dict.Count || string.IsNullOrEmpty(key))
                return s;
            foreach (var item in dict)
            {
                if (0 == string.Compare(item.Key, key, ignoreCase) && item.Value != null)
                {
                    s = removeWhitespace ? item.Value.ToString().Replace(" ", "") : item.Value.ToString();
                    break;
                }
            }
            return s;
        }

        private static List<string> CheckRelation(string featureclass, Dictionary<string, object> dict, List<RuleRelation> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;

            List<string> ls = new List<string>();
            List<RuleRelationItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var item in lsRuleItem)
            {
                if (string.IsNullOrEmpty(item.ShortField) || string.IsNullOrEmpty(item.LongField) || item.FromIndex <= 0 || item.ToIndex <= 0 || item.FromIndex > item.ToIndex)
                {
                    Log.Loging.Info(string.Format("关联检查配置文件有误。Long = {0}, Short = {1}, From = {2} ,To = {3}", item.LongField, item.ShortField, item.FromIndex, item.ToIndex));
                    continue;
                }
                string sShortLengthValue = GetValueToString(dict, item.ShortField);
                string sLongLengthValue = GetValueToString(dict, item.LongField);
                if (string.IsNullOrEmpty(sShortLengthValue) || string.IsNullOrEmpty(sLongLengthValue))
                {
                    Log.Loging.Info(string.Format("有数据为空。{0} = {1}, {2} = {3}", item.ShortField, sShortLengthValue, item.LongField, sLongLengthValue));
                    continue;
                }
                if (sLongLengthValue.Length < item.ToIndex)
                {
                    Log.Loging.Info(string.Format("数据有误,{0} 字段取值 {1} 未能超过索引长度 {2}", item.LongField, sLongLengthValue, item.ToIndex));
                    continue;
                }
                string sSubString = sLongLengthValue.Substring(item.FromIndex - 1, item.ToIndex - item.FromIndex + 1);
                if (0 != string.Compare(sShortLengthValue, sSubString, true))
                {
                    if (item.FromIndex == item.ToIndex)
                        ls.Add(string.Format("字段 {0} 取值不为字段 {1} 取值的第 {2} 位", item.ShortField, item.LongField, item.FromIndex));
                    else
                        ls.Add(string.Format("字段 {0} 取值不为字段 {1} 取值的第 {2} 位至第 {3} 位", item.ShortField, item.LongField, item.FromIndex, item.ToIndex));
                }
            }
            return ls;
        }

        private static List<string> CheckRestriction(string featureclass, Dictionary<string, object> dict, List<RuleRestriction> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;
            List<string> ls = new List<string>();
            List<RuleRestrictionItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var item in lsRuleItem)
            {
                if (string.IsNullOrEmpty(item.Trunk) || null == item.Branches || 0 == item.Branches.Count)
                {
                    Log.Loging.Info("主干字段配置有误");
                    continue;
                }
                string sTrunkFieldValue = GetValueToString(dict, item.Trunk);
                if (string.IsNullOrEmpty(sTrunkFieldValue))
                {
                    Log.Loging.Info(string.Format("不包含字段 {0} 或取值为空", item.Trunk));
                    continue;
                }
                foreach (var branch in item.Branches)
                {
                    if (string.IsNullOrEmpty(branch))
                    {
                        Log.Loging.Info("分支字段配置有误");
                        continue;
                    }
                    string sBrunchFieldValue = GetValueToString(dict, branch);
                    if (string.IsNullOrEmpty(sBrunchFieldValue))
                        ls.Add(string.Format("字段 {0} 不为空时要求字段 {1} 也不能为空", item.Trunk, branch));
                }
            }
            return ls;
        }

        private static List<string> CheckValue(string featureclass, Dictionary<string, object> dict, List<RuleValue> lsRule)
        {
            int nA = -1;
            for (int n = 0; n < lsRule.Count; n++)
            {
                int m = lsRule[n].FeatureClassNames.FindIndex((e) => { return 0 == string.Compare(e, featureclass, true); });
                if (m >= 0)
                {
                    nA = n;
                    break;
                }
            }
            if (nA < 0)
                return null;
            List<string> ls = new List<string>();
            List<RuleValueItem> lsRuleItem = lsRule[nA].RuleItems;
            foreach (var aPair in dict)
            {
                RuleValueItem fieldRule = null;
                for (int k = 0; k < lsRuleItem.Count; k++)
                {
                    if (0 == string.Compare(lsRuleItem[k].FieldName, aPair.Key, true))
                    {
                        fieldRule = lsRuleItem[k];
                        break;
                    }
                }
                if (null == fieldRule)
                    continue;

                string sValue = "";
                if (null != aPair.Value)
                    sValue = aPair.Value.ToString().Replace(" ", "");

                if (!fieldRule.Nullable)
                {
                    if (string.IsNullOrEmpty(sValue))
                    {
                        ls.Add(string.Format("字段 {0} 取值不允许非空", aPair.Key));
                        continue;
                    }
                }

                if (!string.IsNullOrEmpty(sValue) && null != fieldRule.RuleOfCollection)
                {
                    if (null != fieldRule.RuleOfCollection.Items && 0 < fieldRule.RuleOfCollection.Items.Count && !string.IsNullOrEmpty(fieldRule.RuleOfCollection.Seperator))
                    {
                        char[] cSeperator = fieldRule.RuleOfCollection.Seperator.ToCharArray();
                        string[] arrayValue = sValue.Split(cSeperator, StringSplitOptions.RemoveEmptyEntries);
                        foreach (var item in arrayValue)
                        {
                            if (0 > fieldRule.RuleOfCollection.Items.FindIndex(e => { return 0 == string.Compare(item, e, true); }))
                            {
                                ls.Add(string.Format("字段 {0} 取值不在指定的集合范围内", aPair.Key));
                                break;
                            }
                        }
                    }
                }
                if (!string.IsNullOrEmpty(sValue) && !string.IsNullOrEmpty(fieldRule.RegExp))
                {
                    if (!(new Regex(fieldRule.RegExp).IsMatch(sValue)))
                        ls.Add(string.Format("字段 {0} 取值不符合规范", aPair.Key));
                }
            }
            return ls;
        }

    }
}

调用的地方,即接口处实现如下:

        /// <summary>
        /// 属性质检(可配置式)
        /// </summary>
        /// <returns>质检结果</returns>
        /// <status>可用</status>
        [HttpPost]
        [ResponseType(typeof(List<CheckFieldsResponseBody>))]
        public IHttpActionResult CheckFields2([FromBody]List<CheckFields> param)
        {
            try
            {
                List<CheckFieldsResponseBody> lsResult = new List<CheckFieldsResponseBody>() { };
                foreach (var item in param)
                {
                    CheckFieldsResponseBody aResponse = new CheckFieldsResponseBody() { Layer = item.Layer, Information = new List<CheckFieldsResult>() };
                    foreach (var feature in item.Feature)
                        aResponse.Information.Add(CheckValueHelper.Check(aResponse.Layer, feature));
                    lsResult.Add(aResponse);
                }
                return Json(new JObject(new JProperty("status", 0), new JProperty("result", JToken.FromObject(lsResult))));
            }
            catch (Exception e)
            {
                ExceptionHelper.LogActionException(e);
                return Json(new ResponseInfo() { StatusCode = 1, Message = e.Message });
            }
        }


第77步 时间序列建模实战:多因素预测 vol-2(以决策树回归为例) 阅读详情

相关推荐

UVM入门与进阶学习笔记17——寄存器模型(3)

目录寄存器模型的常规方法mirror、desired和actual valueprediction的分类自动预测显式预测uvm_reg的访问方法mem与reg的联系和差别内建(built-in)sequences寄存器模型内建序列存储模型内建序列寄存器健康检查寄存器应用场景寄存器检查功能覆盖率概述覆盖率自动收集模式覆盖率外部事件触发收集 寄存器模型的常规方法 mirror、desired和actual value 在应用寄存器模型时,除了利用它的寄存器信息,也会利用它跟踪寄存器的值。 寄存器模型中的每

weixin_41979380的博客 7537

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(二)

本文主要介绍质检规则的配置。CheckValue.json属性取值质检规则(单一字段)[ { "featureclass": [ "ZD_SHYQ", "ZD_SHYQ_WRK" ], "rule": [ { "name": "ZDTZM&q

a_dev的专栏 494

基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition

基于face_recognition库实现人脸考勤系统功能。利用Python的tkinter模块来设计考勤系统的图形化界面,此外结合openpyxl模块,实现将学生的信息和考勤打卡数据保存到表格中,方便查看和调用。该系统具备“刷脸打卡”、“新学生注册”等功能。............

lyx4949的博客 6969

C#从零开始的学习笔记(5)命名空间

文章目录概述命名空间的定义访问命名空间命名空间别名 概述 .NET Framework类库包含大量的类型,并且用户也能够自定义类型。为了有效组织C#程序中的类型以及保证其唯一性,C#引入了命名空间的概念,从而最大限度地避免类型重名的错误。 与通常的文件或者组件不同,命名空间是一种逻辑组合。在C#文件中定义类时,可以把它包括在命名空间定义中。C#程序中类型有指示逻辑层次结构完全限定名(fully qualified name)描述,例如Dtcloud.Test1.HelloWorld 表示Dtcloud命名空

DTCloud 1560

卷积神经网络-猫狗识别(附源码)

利用python实现一个卷积神经网络,训练猫狗数据集,实现对猫狗图片的预测识别

m0_63223213的博客 2万+

【Pytorch实战教程】基于RML2018的融合网络分类 | LSTM网络和ResNet网络融合 | 含数据集的处理

这段代码是从原始数据中读取所选择的数据,画出星座图,并将星座图保存本地,然后将IQ数据保存成mat文件,将图片数据读取之后保存为npy文件,方便后续融合网络使用。

若北辰 929

C#.net 地图控件开发(八) 地图要素Feature

地图要素         地图要素(Feature)是构成地图图层的最小单元,它包括地物的几何形状,符号和描述信息。描述信息可以做成数据表的形式存储在图层类中,符号也可以存储在图层类中作为默认的要素符号,但是为了在图层中突出表示某个特殊的地物,所以在地图要素中也增加了符号属性。 要素类         作用:描述单个地物的图形信息和属性信息。         类:除了包括几何图形和符号外,

jackjian的专栏 2324

RK3568 Android14 调试 RTL8211F 千兆以太网 (RGMII)

调试 RTL8211F 的核心在于:确认地址(看电阻贴片情况)和 搞定延时(配置 rgmii-id 或微调 delay 值)。一旦这两点对上了,RK3568 的千兆网络就能稳定运行。希望这篇结合原理图的实战记录能帮到你!

qq_33427070的博客 1651

C# 使用AE获取feature的属性及字段操作

我就废话不多说了,大家还是直接看代码吧~ public static DataTable GetFeatureDataTable(IFeature pFeature) { DataTable dt = new DataTable(); dt.Columns.Add("位置:"); dt.Columns.Add("数据:"); for (int i = 0; i < pFeature.Fields.FieldCount; i++) {

chinaherolts2008的博客 1255

安装WSL过程中出现注册表编辑器无法重命名WSL。重命名项时出现错误的解决方案

本文主要介绍了安装WSL过程中出现注册表编辑器无法重命名WSL。重命名项时出现错误的解决方案,希望能对使用Windows WSL的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 9万+

整流桥选型参数,结构原理,工艺与注意问题总结

整流桥(Rectifier Bridge)是一种电子元件,它的主要作用是将交流电(AC)转换为直流电(DC)。这种转换在许多电子设备中都是必要的,因为大多数电子元件和电路都需要直流电源来工作。本文对整流桥的工作原理,结构特点,工艺流程,选型参数及设计注意事项进行总结。

fydar的博客 2189

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(四)

本文主要介绍接口的调用。接口页面测试参数[ { "layer": "ZRZ", "feature": [ { "type": "Feature", "geometry": null, "properties":

a_dev的专栏 351

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(一)

需求概述某项目中,要对宗地、自然幢数据进行质检。质检规则非常多,大致可以分为几类:一是要求某一属性字段值要么为空,要么为指定值;二是要求为某一属性字段值要么为空,要么从指定的集合中取值;三是要求当某一字段取值不为空时,某些字段也不能为空;四是要求当某一字段取值不为空,某一字段的取值必须为该字段值的某一位或某几位。设计思路把规则搞成配置文件,程序只负责解析规则,检查数据,以及输出结果。上述规则中,前...

a_dev的专栏 394

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

C#AE获得feature的属性及字段

public static DataTable GetFeatureDataTable(IFeature pFeature) { DataTable dt = new DataTable(); dt.Columns.Add("位置:"); dt.Columns.Add("数据:"); ...

西柚2015地信小白GISer 2106

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

查询Feature的名称及ID

List<Guid> featIDs = new List<Guid>(); var dd = from i in SPFarm.Local.FeatureDefinitions where i != null && i.RootDirectory.Contains("NanmuThe...

weixin_34198762的博客 765

Feature的命名规则

一直不是很了解feature的命名规则是什么,直到最近遇到一个名称很长的feature在用ps active的时候,想了一小会,还是觉得看下比较好 最终,我发现,feature的名字的命名规则是 projectname_featurename 比如说,一个项目的名字是 ABCSolutions.A.B.C, 它里面一个featuree的名字是NoticeBoard Feature,那么

cindoralla的专栏 2364

IFeatureClass --1

IFeatureClass 用于访问控制要素类行为和属性的成员 IFeatureClass接口是获取和设置要素类属性的主要接口。例如,使用IFeatureClass接口获取要素类类型、获取满足查询条件的要素数目或在要素类中创建新要素。IFeatureClass接口继承了IObjectClass接口。 成员 AddField         向这个类中添加一个字段。 AddIndex

jojojojo2002的专栏 1931

关于获得IFeature的属性字段

IGeometricNetwork,NetworkAnalysis,IEIDHelepr,IEnumEIDInfo,IEIDInfo

Sean的专栏 8301

C# 4.0 Features

C# is a language we work on regularly, it is a language that we love the most. It is always good to see updates to such a lovely language which is very common to most of us. C# 4.0 after its release

张彤的专栏 1160

C# GIS库 NetTopologySuite shp 转 geojson

将ShapeFile 读取为 FeatureCollection: public bool ShpToFeatureCollection1(string filename, out FeatureCollection collection) { collection = null; try ...

weixin_30333885的博客 1469

Arcengine编辑要素属性

AE中编辑要素属性     在Arcgis二次开发中经常用到对feature属性的编辑等工作,而对于从IFeaturelayer中QI得到的Itable填充C#中的datagridview,在修改数据后如何保存数据?网上的示例多数讲的是打开一个Iworkspace后进行编辑工作,而这对上面这种情况来说没多大关联性。因此,应该寻找一个直接的方法,保存在datagridview的数据修改。现将本

GIS探索者 6337

基于C#的MapInfo开发时常用的命名空间总结

命名空间:  MapInfo.DataMapInfo.Data 命名空间包含了实现 MapInfo .NET 数据提供方的类和接口。 对 MapInfo 数据的访问有两种形式:作为使用 SQL 与数据交互的 ADO.NET 数据提供程序和作为使用类与数据交互的 Feature 对象。 MapInfo ADO.NET 数据提供方是使用 MIConnection、M

it114的专栏 2234

地籍数据属性质检功能设计与实现

要质检的数据包括使用权宗地、所有权宗地、自然幢,属性质检规则如下:使用权宗地、所有权宗地属性质检项如下:1.       必填项区县代码(QXDM)、宗地特征码(ZDTZM)、坐落(ZL)、定着物特征码(DZWTZM)、权力人(QLR)、面积单位(MJDW)。2.       字段限制1)       要素代码(YSDM)为空,或不为空必须是10位数字组成;2)       宗地代码(ZDDM)为...

a_dev的专栏 3340

C# 6.0 Feature list

FeatureExampleC#VB Auto-property initializers public int X { get; set; }= x; Added Exists Getter-only auto-properties public int Y{ get; }= y; Added Added Ctor assignmen...

weixin_30652491的博客 148
上一篇: 用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(二)
下一篇: 用C#写一个灵活的要素Feature属性Properties质检WebAPI接口(四)
acngiser
博客等级 码龄15年 118粉丝 214原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值