Skip to content

Not able to insert sites table properly #55

@im-prakher

Description

@im-prakher

Actually, when I was inserting sites table using the client route,

curl -F "fileName=@input_files/sites.csv" \
-F "shp_file=@input_files/S8_two_row_polys.shp" \
-F "dbf_file=@input_files/S8_two_row_polys.dbf" \
-F "prj_file=@input_files/S8_two_row_polys.prj" \
-F "shx_file=@input_files/S8_two_row_polys.shx" \
http://localhost:6001/sites

the app returned the response 410 and logged this error,

ERROR:root:Traceback (most recent call last):
yaba_api_1 | File "fiona/_shim.pyx", line 74, in fiona._shim.gdal_open_vector
yaba_api_1 | File "fiona/_err.pyx", line 270, in fiona._err.exc_wrap_pointer
yaba_api_1 | fiona._err.CPLE_OpenFailedError: '/code/temp/shp_file' not recognized as a supported file format.
yaba_api_1 |
yaba_api_1 | During handling of the above exception, another exception occurred:
yaba_api_1 |
yaba_api_1 | Traceback (most recent call last):
yaba_api_1 | File "/code/Meta.py", line 132, in insert_sites
yaba_api_1 | data_g1=gpd.read_file(shp_file_target)
yaba_api_1 | File "/usr/local/lib/python3.7/site-packages/geopandas/io/file.py", line 77, in read_file
yaba_api_1 | with reader(path_or_bytes, **kwargs) as features:
yaba_api_1 | File "/usr/local/lib/python3.7/site-packages/fiona/env.py", line 398, in wrapper
yaba_api_1 | return f(*args, **kwargs)
yaba_api_1 | File "/usr/local/lib/python3.7/site-packages/fiona/__init__.py", line 254, in open
yaba_api_1 | layer=layer, enabled_drivers=enabled_drivers, **kwargs)
yaba_api_1 | File "/usr/local/lib/python3.7/site-packages/fiona/collection.py", line 154, in __init__
yaba_api_1 | self.session.start(self, **kwargs)
yaba_api_1 | File "fiona/ogrext.pyx", line 484, in fiona.ogrext.Session.start
yaba_api_1 | File "fiona/_shim.pyx", line 81, in fiona._shim.gdal_open_vector
yaba_api_1 | fiona.errors.DriverError: '/code/temp/shp_file' not recognized as a supported file format.

But when I use the yaba_api route for inserting sites table,

curl -F "fileName=@input_files/sites.csv" \
-F "shp_file=@input_files/S8_two_row_polys.shp" \
-F "dbf_file=@input_files/S8_two_row_polys.dbf" \
-F "prj_file=@input_files/S8_two_row_polys.prj" \
-F "shx_file=@input_files/S8_two_row_polys.shx" \
http://localhost:5001/yaba/v1/sites

it succeeded in doing so. Also, when I am making a request using the browser, both routes log the same error. Don't know what is causing this.

@Chris-Schnaufer @saurabh1969 @dlebauer @KristinaRiemer

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions