cjio icon indicating copy to clipboard operation
cjio copied to clipboard

Allow cjio to read accessible web stored json data

Open RitaAguiarAdsk opened this issue 2 years ago • 3 comments

I would like it to be possible to load a json file from a link url with cityjson.load(path) For example, I want to load this file, but I don't want to download it, I want to read it directly from the web: https://s3.dualstack.us-east-1.amazonaws.com/opencitymodel/2019-jun/json/NewYork/36061/NewYork-36061-000.json

Refer to this discussion for more information: https://github.com/cityjson/specs/discussions/114

RitaAguiarAdsk avatar Mar 23 '22 11:03 RitaAguiarAdsk

Just for clarification, a fix for this would still download the whole file at once, however the downloading and loading would be handled automatically by cjio. The whole citymodel would be loaded in one go. You wouldn't need a separate download + cityjson.load() step.

Or do you mean to stream the citymodel, loading cityobjects one-by-one as you request them?

balazsdukai avatar Mar 23 '22 11:03 balazsdukai

I think the first option you have suggested is certainly enough for what I would like to do. I am not going to stream this information but rather extract just the building's information I need. My use case is: I have a polygon boundary of an area in the world, in this case NYC, and I want to find all the building objects in that polygon. All json files with this info are stored online (I'm using OpenCityModel for this) and I want to read them and only extract the building objects I need by saving them in a json file on my local computer. I do not wish to download any of those OpenCityModel json files, but if there is no other option, then I will download them and keep them temporarily.

RitaAguiarAdsk avatar Mar 23 '22 12:03 RitaAguiarAdsk

For now it is not possible to do this in cjio, but it's a useful feature and most likely it will be added.

balazsdukai avatar Mar 23 '22 15:03 balazsdukai