예제 #1
0
파일: ucSvd2.cs 프로젝트: windygu/hispeed
        private int GetMicapsWidth(string micapsfile, string rasterfile)
        {
            int width           = 0;
            MicapsDataReader dr = MicapsDataReaderFactory.GetVectorFeatureDataReader(micapsfile, new object[1] {
                _datatype
            }) as MicapsDataReader;
            Envelope env = null;

            if (StatRegionSet.UseRegion)
            {
                env = StatRegionSet.Envelope;
            }
            else if (rasterfile != null && Path.GetExtension(rasterfile) != ".000")
            {
                using (IRasterDataProvider datap = GeoDataDriver.Open(rasterfile) as IRasterDataProvider)
                {
                    CoordEnvelope cenv = datap.CoordEnvelope;
                    env = new Envelope(cenv.MinX, cenv.MinY, cenv.MaxX, cenv.MaxY);
                }
            }
            if (env == null)
            {
                width = dr.Length;
            }
            else
            {
                width = dr.GetFeatures(env).Length;
            }
            return(width);
        }
예제 #2
0
        private static Feature[] GetMicapsFeatures(string file, Envelope envelope = null)
        {
            MicapsDataReader dr = MicapsDataReaderFactory.GetVectorFeatureDataReader(file, new object[1] {
                _datatype
            }) as MicapsDataReader;

            if (envelope != null)
            {
                return(dr.GetFeatures(envelope));
            }
            else
            {
                return(dr.Features);
            }
        }