Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cjio to read accessible web stored json data #136

Open
RitaAguiarAdsk opened this issue Mar 23, 2022 · 3 comments
Open

Allow cjio to read accessible web stored json data #136

RitaAguiarAdsk opened this issue Mar 23, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@RitaAguiarAdsk
Copy link

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: cityjson/specs#114

@balazsdukai balazsdukai added the enhancement New feature or request label Mar 23, 2022
@balazsdukai balazsdukai changed the title [Feature request] Allow cjio to read accessible web stored json data Allow cjio to read accessible web stored json data Mar 23, 2022
@balazsdukai
Copy link
Member

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?

@RitaAguiarAdsk
Copy link
Author

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.

@balazsdukai
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants