示例#1
0
        private void TimerOSMSearcher_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (TickStatusOsm)
            {
                _logger.Info("Пропущений тік...");
                return;
            }


            lock (lockerOSM)
            {
                TickStatusOsm = true;
                ProcessPoint point = hdb.GetEpicentrKPointForGeocoding();
                _logger.Info(string.Format("{0} {1} {2}", point.CardId.ToString(), "Address Get DB to OSM:", point.SourceAddress));

                if (point != null)
                {
                    using (OsmPointsSearcher osp = new OsmPointsSearcher())
                    {
                        point = osp.IdentifyCoordinatePoint(point);
                    }
                }
                TickStatusOsm = false;
            }
        }
        /// <summary>
        ///
        /// </summary>
        public void IdentifyCoordinatesOne(PointType pt)
        {
            if (GetRemainingAttemptsCount() <= 0)
            {
                return;
            }

            switch (pt)
            {
            case PointType.CustomerEpicentrK:
            {
                ProcessPoint point = hdb.GetEpicentrKPointForGeocoding();

                _logger.Info(string.Format("{0} {1} {2}", point.CardId.ToString(), "Address Get DB:", point.SourceAddress));

                point = hgoogle.GetRequestXmlDocumentPointsByAddress(point);

                _logger.Info(string.Format("{0} SearchEngineStatus:{5}, {1} {2} Lat={3}, Lng={4}",
                                           point.CardId.ToString(),
                                           "Point Get Googe:",
                                           point.FormattedAddress,
                                           point.Coordinate != null ? point.Coordinate.Lat : "none",
                                           point.Coordinate != null ? point.Coordinate.Lng : "none",
                                           point.PStatus.ToString()
                                           ));

                if (point.CardId > 0)
                {
                    point.Save(hdb);
                    _logger.Info(string.Format("{0} {1}", point.CardId.ToString(), "Point Set Data in DB"));
                }
                break;
            }

            case PointType.BoardPoint:
            {
                break;
            }

            case PointType.CustomerNewLine:
            {
                break;
            }

            case PointType.MarketPoint:
            {
                break;
            }
            }
        }
示例#3
0
        public void TestOne()
        {
            ProcessPoint point = hdb.GetEpicentrKPointForGeocoding();

            point = this.Get(point);
        }