Ejemplo n.º 1
0
        public void SaveDBToShape(DBLayer dBLayer, string shapeFileName)
        {
            var allNodesCache = dBLayer.GetAllNodesDictionary();
            var nodes         = dBLayer.GetBoundNodes();

            SaveNodesToShape(shapeFileName, allNodesCache, nodes);
        }
Ejemplo n.º 2
0
        public void ImportOSM(string pathToOSM, DBLayer dal, bool forceIfTableEmpty = false, MapBoundingBox mapBoundingBox = null)
        {
            using (var fileStream = File.OpenRead(pathToOSM))
            {
                // create source stream.
                OsmStreamSource source;
                if (Path.GetExtension(pathToOSM).ToLower().Contains("pbf"))
                {
                    source = ImportOSMPBF(fileStream);
                }
                else
                {
                    source = ImportOSMXML(fileStream);
                }

                dal.ImportNodes(source, true, mapBoundingBox);
                dal.ImportWays(source);
                dal.ClearUnboundNodes();
            }
        }