Ejemplo n.º 1
0
        private List <string> getXZQMC()
        {
            List <string> res = new List <string>();

            GeoDrawSheetMap.clsGetGeoInfo getGeoinfo = new GeoDrawSheetMap.clsGetGeoInfo();
            getGeoinfo.m_lngMapScale    = (long)Convert.ToInt32(cBoxScale.Text.Split(':')[1]);
            getGeoinfo.m_strMapNO       = txtMapNo.Text.Replace(" ", "");
            getGeoinfo.m_intInsertCount = 3;
            getGeoinfo.m_pPrjCoor       = pAxMapControl.Map.SpatialReference as IProjectedCoordinateSystem;
            getGeoinfo.ComputerAllGeoInfo();
            IGeometry tfGeometry = getGeoinfo.m_pSheetMapGeometry;
            //GeoPageLayoutFn.drawPolygonElement(tfGeometry, pAxMapControl.ActiveView.GraphicsContainer);//测试用
            IRelationalOperator pRO      = tfGeometry as IRelationalOperator;
            IFeatureCursor      pFCursor = xzq_xianFC.Search(null, false);
            IFeature            pFeature = pFCursor.NextFeature();
            int idx = pFeature.Fields.FindField(xzq_xian_field);

            while (pFeature != null)
            {
                IGeometry pGm = pFeature.ShapeCopy;
                if (pRO.Relation(pGm, "RELATE(G1,G2,'T********')"))//(pRO.Within(pGm) || pRO.Overlaps(pGm)怀疑此方法有问题 || pRO.Contains(pGm))
                {
                    //GeoPageLayoutFn.drawPolygonElement(pGm, pAxMapControl.ActiveView.GraphicsContainer);//测试用
                    res.Add(getXZQMC(pFeature.get_Value(idx).ToString()));
                }
                pFeature = pFCursor.NextFeature();
            }
            //pAxMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);//测试用
            return(res);
        }
Ejemplo n.º 2
0
        private static bool EvaluateRelation([NotNull] IRelationalOperator shapeRelOp,
                                             [NotNull] IGeometry relatedShape,
                                             [NotNull] string relationDescription)
        {
            if (IsInteriorIntersectionRelation(relationDescription))
            {
                // more robust: (not disjoint) and (not touches)
                // "disjoint" geometries should not make it here.

                // TODO consolidate optimization of touches with GeometryEngine
                return(!shapeRelOp.Touches(relatedShape));
            }

            return(shapeRelOp.Relation(relatedShape, relationDescription));
        }
Ejemplo n.º 3
0
        private List <string> getXZQMC(IGeometry tfGeometry, IFeatureClass xzq_xianFC, string xzq_xian_field)
        {
            List <string> res = new List <string>();
            //GeoPageLayoutFn.drawPolygonElement(tfGeometry, pAxMapControl.ActiveView.GraphicsContainer);//测试用
            IRelationalOperator pRO      = tfGeometry as IRelationalOperator;
            IFeatureCursor      pFCursor = xzq_xianFC.Search(null, false);
            IFeature            pFeature = pFCursor.NextFeature();
            int idx = pFeature.Fields.FindField(xzq_xian_field);

            while (pFeature != null)
            {
                IGeometry pGm = pFeature.ShapeCopy;
                if (pRO.Relation(pGm, "RELATE(G1,G2,'T********')"))//(pRO.Within(pGm) || pRO.Overlaps(pGm)怀疑此方法有问题 || pRO.Contains(pGm))
                {
                    //GeoPageLayoutFn.drawPolygonElement(pGm, pAxMapControl.ActiveView.GraphicsContainer);//测试用
                    res.Add(ModGetData.getXZQMC(pFeature.get_Value(idx).ToString()));
                }
                pFeature = pFCursor.NextFeature();
            }
            //pAxMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);//测试用
            return(res);
        }