andredaa / city_io_to_geojson

A bunch of scripts to geoference a cityIO grid
1 stars 0 forks source link

not POSTing to cityio? or slow #4

Open yasushisakai opened 5 years ago

yasushisakai commented 5 years ago

With a latest macbook pro, it took approx. 15sec to have the process back. Should it take this long?

maybe it's trying to POST it??

tested with Python2.7

andredaa commented 5 years ago

For me it takes roughly 700ms, on my laptop. When initializing the table the script tries to read from https://cityio.media.mit.edu/api/table/grasbrook If this fails it will take the __debugging_virtual_table.json as fallback. It will print("cannot read from CityIO server. Using local fallback json") Maybe it tries reading for 15seconds and then uses the fallback? https://github.com/andredaa/city_io_to_geojson/blob/ee5ba43a8854e3d475d0cbc8d645443555cd045e/CityScopeTable.py#L21

andredaa commented 5 years ago

however - it is not posting to city_io yet. we have to discuss if this will be necessary (see https://github.com/andredaa/city_io_to_geojson/issues/2 )

yasushisakai commented 5 years ago

("cannot read from CityIO server. Using local fallback json")

hmm, I don't see this output. Is there a easy way to verify the process??

andredaa commented 5 years ago

You could try measuring how long it takes you to read from the API. You could try this in a simple python shell: import json import urllib json.load(urllib.urlopen('https://cityio.media.mit.edu/api/table/grasbrook'))

see if this takes long to load.

andredaa commented 5 years ago

@yasushisakai : Could you verify if the GET query is what takes so long?

andredaa commented 5 years ago

@yasushisakai : The master is updated to no longer read from a online endpoint. Even though the created json is now much larger (44*78 gridcells), it still computes within 1.5 seconds on my computer. Would you like to check the current master - if it runs faster for you without network dependency? Where should I post the result to? (The resulting json is 1.3mb in size. You might have to look at the max. payload size of your api)