/// <summary> /// Imports node (geography POINT) in Sql Server as a varbinary(max) /// </summary> private void ImportGeoNode() { if (_nodesOsm.Count > 0) { DataTable nodesGeo = this.GetTableGeo(); int countRow = 0; foreach (KeyValuePair <Int64, Node> keyValuePair in _nodesOsm) { countRow++; if (keyValuePair.Value.GeoType == null) { continue; } DataRow dataRow = nodesGeo.NewRow(); dataRow["idGeo"] = keyValuePair.Key; dataRow["bin"] = GeoProcessing.GeoProcessingNode(keyValuePair.Value); dataRow["typeGeo"] = (Int16)GeoTypeOGC.Point; nodesGeo.Rows.Add(dataRow); if (countRow == COUNT_ROW) { this.ImportDataTableInDb(ref nodesGeo, GetTableGeo); countRow = 0; } } if (nodesGeo.Rows.Count > 0) { this.ImportDataTableInDb(ref nodesGeo, GetTableGeo); } } }
private void AddGeoNodeToTable(Node node) { DataRow dataRow = _geos.NewRow(); dataRow["idGeo"] = node.Id; dataRow["bin"] = GeoProcessing.GeoProcessingNode(node); dataRow["typeGeo"] = (byte)GeoTypeOGC.Point; this.AddRowsToGeoTable(dataRow); }