private void centerShow()
        {
            CompactFeatureObj obj = getCompactFeatureObj();

            if (obj != null)
            {
                fireResetRegion(obj.Shape.ToString());
            }
        }
        private void ExportGIMenu_Click(object sender, RoutedEventArgs e)
        {
            CompactFeatureObj obj = getCompactFeatureObj();

            if (obj != null)
            {
                StringShowClient client = new StringShowClient(obj.Shape.ToString(), "空间地理信息", obj.Name);
                client.ShowDialog();
            }
        }
예제 #3
0
        private void onSetAttribute(ushort key, tagFEATURE feature, CompactFeatureObj obj)
        {
            S57AttributeType attrType = (S57AttributeType)key;

            string[] attr = feature.GetAttribute(attrType);
            if (attr != null)
            {
                obj[attrType.ToString()] = attr;
            }
        }
예제 #4
0
 private void setAttribute(tagFEATURE feature, CompactFeatureObj obj)
 {
     foreach (ushort attrId in feature.ATTFRead)
     {
         onSetAttribute(attrId, feature, obj);
     }
     foreach (ushort attrId in feature.NATFRead)
     {
         onSetAttribute(attrId, feature, obj);
     }
 }
예제 #5
0
        private List <CompactFeatureObj> updateResult(List <tagFEATURE> list)
        {
            List <CompactFeatureObj> result = new List <CompactFeatureObj>();

            for (int i = 0; i < list.Count; i++)
            {
                tagFEATURE    feature  = list[i];
                GeometryShape geoShape = null;
                if ((feature.PRIM == GeoPrimitiveType.Point || feature.PRIM == GeoPrimitiveType.Text) && feature.SG2D != null)
                {
                    geoShape = new GeoPointShape(feature.SG2D.Points[0].X, feature.SG2D.Points[0].Y);
                }
                else if (feature.PRIM == GeoPrimitiveType.Line && feature.SG2D != null)
                {
                    geoShape = new GeoLineShape(feature.SG2D);
                }
                else if (feature.PRIM == GeoPrimitiveType.Area && feature.Area != null)
                {
                    geoShape = new GeoAreaShape(feature.Area);
                }
                if (geoShape != null && _locator.Rect.IntersectsWith(geoShape.Bounds))
                {
                    string   name  = string.Empty;
                    string[] names = feature.GetAttribute(S57AttributeType.NOBJNM);
                    if (names != null && names.Length > 0)
                    {
                        name = names[0];
                    }
                    string            fileName  = feature.File.Header.FileName;
                    int               tempIndex = fileName.LastIndexOf('\\') + 1;
                    CompactFeatureObj obj       = new CompactFeatureObj(string.Empty, name, string.Empty, geoShape, fileName.Substring(tempIndex, fileName.LastIndexOf('.') - tempIndex), feature.OBJL.ToString());
                    result.Add(obj);
                    setAttribute(feature, obj);
                }
            }
            return(result);
        }