From a4840faf4064b5ccd98855f9ca4903b802afc1a1 Mon Sep 17 00:00:00 2001 From: Sujan Adhikari <109404840+Sujanadh@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:55:33 +0545 Subject: [PATCH] fix: raw-data-api changed Export.geojson --> RawExport.geojson (#30) * fix: changed Export.geojson --> RawExport.geojson * fix: identation in consistency --- osm_rawdata/pgasync.py | 8 ++++---- osm_rawdata/postgres.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osm_rawdata/pgasync.py b/osm_rawdata/pgasync.py index 677e665..61db87a 100755 --- a/osm_rawdata/pgasync.py +++ b/osm_rawdata/pgasync.py @@ -557,13 +557,13 @@ async def queryRemote( result = self.session.get(zip, headers=self.headers) fp = BytesIO(result.content) zfp = zipfile.ZipFile(fp, "r") - zfp.extract("Export.geojson", "/tmp/") + zfp.extract("RawExport.geojson", "/tmp/") # Now take that taskid and hit /tasks/status url with get - data = zfp.read("Export.geojson") - os.remove("/tmp/Export.geojson") + data = zfp.read("RawExport.geojson") + os.remove("/tmp/RawExport.geojson") return json.loads(data) - # return zfp.read("Export.geojson") + # return zfp.read("RawExport.geojson") class PostgresClient(DatabaseAccess): diff --git a/osm_rawdata/postgres.py b/osm_rawdata/postgres.py index 9138781..9ede971 100755 --- a/osm_rawdata/postgres.py +++ b/osm_rawdata/postgres.py @@ -624,10 +624,10 @@ def queryRemote( if not data_url.endswith(".zip"): return data_url - # Extract filename is set, else use Export.geojson + # Extract filename is set, else use RawExport.geojson query_dict = json.loads(query) file_type = query_dict.get("outputType", "geojson") - filename = f"{query_dict.get('fileName', 'Export')}.{file_type}" + filename = f"{query_dict.get('fileName', 'RawExport')}.{file_type}" # Get zip file and extract with self.session.get(data_url, headers=self.headers) as response: buffer = BytesIO(response.content)