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); }
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); } }