Esempio n. 1
0
        private Osm GetSubject(Bounds bounds = null)
        {
            var subject = FileSerializer.ReadXmlCacheOrSource(Municipality + "/Subject.osm",
                                                              () => Subjects.GetElementsInBoundingBox(bounds));

            Console.WriteLine("ChangeId high watermark: " + subject.GetHighestChangeSetId());
            return(subject);
        }
Esempio n. 2
0
        public static CompleteWay[] Generate(string from, string to, NetTopologySuite.Geometries.Geometry scope = null)
        {
            var osm = FileSerializer.ReadXmlCacheOrSource(to,
                                                          () => TranslateAndDisolve(from, scope));

            JOSM.MarkAsNeverUpload(to);
            return(osm.GetElements().ToComplete().OfType <CompleteWay>().ToArray());
        }
Esempio n. 3
0
        public static OsmChange[] GetChangesFromChangesets(params long[] changeIds)
        {
            var changes = new List <OsmChange>();

            foreach (var changeId in changeIds)
            {
                OsmChange change = FileSerializer.ReadXmlCacheOrSource(@"CachesChanges\" + changeId + ".osc",
                                                                       () => { Thread.Sleep(15000); return(OsmApiClient.GetChangesetDownload(changeId).Result); });
                changes.Add(change);
            }

            return(changes.ToArray());
        }
Esempio n. 4
0
        public static OsmGeo[] GetElementsFromChanges(params long[] changeIds)
        {
            var elements = new List <OsmGeo>();
            int i        = 0;

            foreach (var changeId in changeIds)
            {
                Console.WriteLine(++i + "/" + changeIds.Length + ": " + changeId);
                OsmChange fullChange = FileSerializer.ReadXmlCacheOrSource(@"CachesChanges\" + changeId + ".osc",
                                                                           () => { Thread.Sleep(10000); return(OsmApiClient.GetChangesetDownload(changeId).Result); });
                var newElements = fullChange.GetElements();
                elements.AddRange(newElements);
            }

            return(elements.ToArray());
        }
Esempio n. 5
0
 private Osm GetReference()
 {
     return(FileSerializer.ReadXmlCacheOrSource(Municipality + "/Reference.osm",
                                                () => References.Fetch(Municipality)).Result);
 }