NREL / floorspace.js

Other
66 stars 35 forks source link

Merge two FloorSpace JS files #368

Closed DavidGoldwasser closed 2 years ago

DavidGoldwasser commented 4 years ago

I've had the need to do this a few times recently, and can be sketchy trying to work in text editor to make sure ID's from the two files don't conflict. As they are JSON files I can probably write a script to do this, but could be nice if there was some native support for this.

Mkellyeng commented 4 years ago

You might run into issues with the relative positions of each building, as there's currently no native way to shift spaces around within a floor

DavidGoldwasser commented 4 years ago

Thanks, I'll keep an eye out for that if I do this. Maybe I can make sure to keep 0,0 in sync for the two models, if not I can aways move the spaces once they are OSM files.

bgschiller commented 3 years ago

@DavidGoldwasser, thinking about how to make this most useful. Suppose there's a new button near the import/export ones that does a merge. It would present a modal and prompt you for:

Merge another floorspace.json into this one

  1. Place other floorspace's origin at ____ (default (0,0))
  2. Other floorspace's stories should be merged-with-these-ones/stacked-above-these-ones/stacked-below-these-ones

Is it enough to add all other objects from the other file (thermal zones, construction sets, window definitions), or would we need to de-duplicate somehow?

Anything else you can think of that I'm forgetting?

DavidGoldwasser commented 3 years ago

@bgschiller, that seems like a nice approach. For item 2, I suppose if the imported JSON has story of the same name then it would be great to merge it. If it is a story that isn't in the current JSON then I'd be fine with it going on the top. This does require some coordination by the user in the order of operations, but this is kind of an edge case anyway so a little extra prep work on the user is fine.