Skip to content

Commit

Permalink
fix: raw-data-api changed Export.geojson --> RawExport.geojson (#30)
Browse files Browse the repository at this point in the history
* fix: changed Export.geojson --> RawExport.geojson

* fix: identation in consistency
  • Loading branch information
Sujanadh authored Aug 12, 2024
1 parent f362a89 commit a4840fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions osm_rawdata/pgasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions osm_rawdata/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a4840fa

Please sign in to comment.