Ejemplo n.º 1
0
        private void GenericLoader_OnLength(GenericLoader g, string dbffilename, string shpfilename, long length)
        {
            dbflength = length;

            Console.WriteLine("Processing Dbase: " + Path.GetFileName(dbffilename));
            Console.WriteLine("Processing shp: " + Path.GetFileName(shpfilename));
            Console.WriteLine("Discovered " + length.ToString() + " Records.");

            if (g.Options.Resume)
            {
                Console.WriteLine("===> Resume On <===");
            }



            // interesting tidbit Console.LargestWindowWidth doesnt work worth shit.
            cursorx = Console.CursorLeft;
            cursory = Console.CursorTop;

            blankline = string.Empty;

            for (int rep = 0; rep < 80; rep++)
            {
                blankline += " ";
            }
        }
Ejemplo n.º 2
0
        private void CountyLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
        {
            CountyRecord cr = (CountyRecord)r;


            cr.FipsId = cr.STATEFP + cr.COUNTYFP + blankline;
        }
Ejemplo n.º 3
0
        private void RoadsLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
        {
            RoadRecord rec = (RoadRecord)r;


            if (fipspad.Length == 0)
            {
                for (int x = 0; x < 15; x++)
                {
                    fipspad += "0";
                }
            }

            if (string.IsNullOrEmpty(statecode))
            {
                string[] pieces       = g.DBFFileName.Split(new char[] { '_' });
                string   stcountycode = pieces[2];

                statecode  = stcountycode.Substring(0, 2);
                countycode = stcountycode.Substring(2, 3);
            }

            rec.FipsId     = statecode + countycode + fipspad;
            rec.StCtyLinId = statecode + "-" + countycode + "-" + rec.LINEARID;
        }
Ejemplo n.º 4
0
 private void GenericLoader_SkipRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
 {
     Console.SetCursorPosition(cursorx, cursory);
     Console.WriteLine(blankline);
     Console.WriteLine(blankline);
     Console.SetCursorPosition(cursorx, cursory);
     Console.WriteLine("Skipping " + (index + 1).ToString() + " of " + dbflength.ToString());
 }
Ejemplo n.º 5
0
        private void SpeciesSeasonLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
        {
            PopulateArchiveKeyHash();

            var s = (SpeciesSeasonRecord)r;

            s.DownloadGuid = speciesArchiveGuid[Path.GetFileName(g.ZipFileName)];
        }
Ejemplo n.º 6
0
 private void GenericLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
 {
     // catchall to avoid unnecessary processrecord event handlers in implementations.
     // this should really just be all of them really.
     // however fips calculation may not allow this in a few record types.
     // ... and just in case there is a usecase where we're loading a state supplied dbf WITHOUT a shapefile.
     if (r is IHasShape)
     {
         IHasShape rec = (IHasShape)r;
         rec.Shape = shape;
     }
 }
Ejemplo n.º 7
0
        private void PlaceLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
        {
            PlaceRecord pr = (PlaceRecord)r;

            pr.FipsId = pr.STATEFP + "00000000" + pr.PLACEFP + "00000";
        }
Ejemplo n.º 8
0
        private void StateLoader_ProcessRecord(GenericLoader g, int index, IRecordLoader r, ShapeUtilities.BaseShapeRecord shape)
        {
            StateRecord state = (StateRecord)r;

            state.FipsId = state.STATEFP + zeropad;
        }