"Model To geoJSON" deleted all other files in the target folder, why?!

Hi @fxh999 ,

Sorry for the late response and that my answer is likely not going to be what you were hoping.

The DF Model To GeoJSON component is designed to delete all of the files in the directory to which it is written. Otherwise, you would not be able to use a newly-written GeoJSON to get new/updated simulation results with URBANopt. You might chalk this up to a limitation of the current URBANopt SDK that it will not run a new simulation unless it does not find existing simulation files in the directory. So this kinda forces me to delete everything in the folder that the GeoJSON is written to in order to get the simulation to run correctly.

I’m also really sorry to say that the files deleted this way are wiped off the drive completely. So the answer to this:

Is that there’s really no reliable way to recover them since they are not in your recycle bin. If you have a backup system for your machine, that might provide you with a path to recover them. Or, if all else fails, the Windows File Recovery App might let you restore some of the files.

But I’m really sorry about this if you were trying to write the GeoJSON and run the simulation from a directory in which you already had files. We have been using this type of system to clear simulation directories for fresh simulations for over a decade now. And I have never gotten any reports about people accidentally deleting folders where they were running an E+ or Radiance simulation.

But, for some reason, these urban-scale simulations seem to be pretty vulnerable to this type of accidental deletion. The only other time that I saw this type of thing was for UWG simulation where someone deleted their Desktop by accident.

Now that I know this is another case where people are likely to make this mistake, let me see if I can revise the code such that only the URBANopt simulation files are deleted from the directory and nothing else.