Azavea.NijPredictivePolicing.ACSAlchemistLibrary.Transfer.AcsDataManager.CheckBlockGroupFile C# (CSharp) Method

CheckBlockGroupFile() public method

Downloads the census DATA for the given state
public CheckBlockGroupFile ( ) : bool
return bool
        public bool CheckBlockGroupFile()
        {
            _log.DebugFormat("Downloading census data for tract and block groups for {0}", this.State);

            string desiredUrl = FileLocator.GetStateBlockGroupUrl(this.State);
            string destFilepath = GetLocalBlockGroupZipFileName();

            if (!FileDownloader.GetFileByURL(desiredUrl, destFilepath, ref this._cancelled, WorkOffline))
            {
                _log.ErrorFormat("Downloading census data failed: unable to retrieve {0} ", desiredUrl);
                return false;
            }

            //double-check to make sure we're not expanding this ON-TOP of the 'all-geometries' data!!!
            //current data path should NOT be acs2010_5yr
            if (!FileLocator.ExpandZipFile(destFilepath, this.GetAggregateDataPath()))
            {
                _log.ErrorFormat("Downloading census data failed: unable to expand file {0}", destFilepath);
                return false;
            }

            _log.Debug("Downloading census data... Done!");
            return true;
        }