public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIDocument uidoc = commandData.Application.ActiveUIDocument;
            Document   doc   = uidoc.Document;

            ContainerStore.Registration <MapStreamHttpService>();

            var osmServie = ContainerStore.Resolve <OsmService>();

            using (Transaction t = new Transaction(doc, "Build City"))
            {
                t.Start();

                // -73.8513, 40.6796, -73.8386, 40.6890
                // -74.0533, 40.6804, -73.9976, 40.7124
                // Define the map bounding box
                var mapbounds = new MapBounds
                {
                    Left   = -73.8513,
                    Bottom = 40.6796,
                    Right  = -73.8386,
                    Top    = 40.6890
                };

                OsmStore.Geolocate(mapbounds);
                osmServie.Run(doc);

                t.Commit();
            }


            return(Result.Succeeded);
        }
Beispiel #2
0
 public StreetService(GeometryService geometryService, CoordinatesService coordService, OsmStore osmStore, SolidGeometryService solidGeometryService)
 {
     this.geometryService      = geometryService;
     this.coordService         = coordService;
     this.osmStore             = osmStore;
     this.solidGeometryService = solidGeometryService;
 }
        private static void GenerateRevitFile(DesignAutomationData daData)
        {
            var      rvtApp = daData.RevitApp;
            Document newDoc = rvtApp.NewProjectDocument(UnitSystem.Imperial) ?? throw new InvalidOperationException("Could not create new document.");

            var osmServie = ContainerStore.Resolve <OsmService>();

            using (Transaction t = new Transaction(newDoc, "Build City"))
            {
                t.Start();

                MapBounds mapBounds = MapBounds.Deserialize(File.ReadAllText(MapBoundsFile));
                OsmStore.Geolocate(mapBounds);
                osmServie.Run(newDoc);
                t.Commit();
            }

            newDoc.SaveAs(ResultFile);
        }
Beispiel #4
0
 public View3DService(CoordinatesService coordService, OsmStore osmStore)
 {
     this.coordService = coordService;
     this.osmStore     = osmStore;
 }
Beispiel #5
0
 public CoordinatesService(OsmStore store)
 {
     this.store = store;
 }
 public GeometryService(CoordinatesService coordService, OsmStore osmStore)
 {
     this.coordService = coordService;
     this.osmStore = osmStore;
 }
Beispiel #7
0
 public TopoSurfaceService(CoordinatesService coordService, OsmStore osmStore)
 {
     this.coordService = coordService;
     this.osmStore     = osmStore;
 }