VIDA-NYU / tile2net

Automated mapping of pedestrian networks from aerial imagery tiles
BSD 3-Clause "New" or "Revised" License
146 stars 22 forks source link

Issue pulling NYC data #67

Closed AradhitaB closed 2 months ago

AradhitaB commented 2 months ago

Hi,

I am trying to generate data for NYC from tile2net to run inference on. Since this falls under the supported regions I wasn't expecting any problems. However, some tiles are returning 404 from the server. When this happens, I also get a "Required privilege not held by user" error, and none of the tiles from that run are saved.

For example, for the neighborhood of 'Midland Beach, Staten Island, Richmond County, City of New York, New York, 10306, United States':

INFO       Geocoding [40.5631606, -74.104586, 40.5831606, -74.084586], this may take awhile...
INFO       Using NewYorkCity as the source at location=[40.5631606, -74.104586, 40.5831606, -74.084586]
INFO       Using base_tilesize=256 from source
INFO       Stitching 30 tiles...
INFO       769 tiles missing out of 1280 total.
INFO       24 tiles returned 404 from the server.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\file_path\tile2net\src\tile2net\__main__.py", line 6, in <module>
    argh.dispatch_commands([
  File "C:\file_path\anaconda3\envs\tileenv\Lib\site-packages\argh\dispatching.py", line 358, in dispatch_commands
    dispatch(parser, *args, **kwargs)
  File "C:\file_path\anaconda3\envs\tileenv\Lib\site-packages\argh\dispatching.py", line 183, in dispatch
    for line in lines:
  File "C:\file_path\anaconda3\envs\tileenv\Lib\site-packages\argh\dispatching.py", line 294, in _execute_command
    for line in result:
  File "C:\file_path\anaconda3\envs\tileenv\Lib\site-packages\argh\dispatching.py", line 247, in _call
    result = function(namespace_obj)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\file_path\tile2net\src\tile2net\raster\generate\__init__.py", line 17, in generate
    raster.generate(args.stitch_step)
  File "C:\file_path\tile2net\src\tile2net\raster\raster.py", line 814, in generate
    self.stitch(step)
  File "C:\file_path\tile2net\src\tile2net\raster\raster.py", line 416, in stitch
    self.download()
  File "C:\file_path\tile2net\src\tile2net\raster\raster.py", line 645, in download
    os.symlink(src, path)
OSError: [WinError 1314] A required privilege is not held by the client: 'C:\\file_path\\tile2net\\src\\tile2net\\raster\\resources\\black\\19.png' -> 'output_dir\\project_name\\tiles\\static\\nyc\\256_19\\154247_197407.png'

Even if it's not possible to resolve the 404 error, if there's a workaround to at least save the tiles that did return from server that would be really helpful.

Thank you!

Mary-h86 commented 2 months ago

@AradhitaB The error you are encountering is not a 404 server error; it is an OSError related to permission issues with creating a symlink on Windows. The log message INFO 24 tiles returned 404 from the server is not indicative of an error but only informs you that 24 tiles within the specified bounding box fall outside the NYC supported tiles, likely those in the Lower Bay waters.

Thanks for bringing the Windows potential permission issue to our attention. In the meantime, you can enable developer mode on windows until we push a fix for this specific case later.

Enable Developer Mode (Windows 10/11): Go to Settings → Update & Security → For Developers. Turn on Developer Mode. This setting allows symlink creation without elevated privileges.

AradhitaB commented 2 months ago

Thank you so much, this worked! I guess I got confused because the symlink issue only popped up when the server log message did.