The 404 status code you’re encountering indicates that the requested resource could not be found.
You need to use a URL like this:
https://eu.atlas.microsoft.com/mapData?&api-version=2.0&dataFormat=dwgzippackage&subscription-key=*********************
You must use {Your-Azure-Maps-Subscription-key} with your Primary or Secondary key.
https://{geography}.atlas.microsoft.com
geography is parameter specifies where the Azure Maps Creator resource is located. Valid values are us and eu.
The geography parameter specifies where the Azure Maps Creator resource is located. Valid values are us and eu.
Refer to this git and Microsoft Documentation for Conversion of drawing packages.
Below is the code to upload a ZIP file to Maps. Refer to this git for the full code:
def upload_dwg(pipeline, filepath):
upload_url = pipeline.base_url + "mapData?api-version=2.0&dataFormat=zip&subscription-key=" + pipeline.subcriptionKey
data = open(filepath, 'rb').read()
response = requests.post(url= upload_url ,
data=data,
headers={'Content-Type': 'application/octet-stream'})
if response.status_code == 202:
pipeline.ResultUploadOperationsLocation = response.headers["Operation-Location"]
print("DWG Upload Started...")
else:
print("Upload failed with status code: ", response.status_code)
exit()
return pipeline
def get_upload_status(pipeline):
response = requests.get(pipeline.ResultUploadOperationsLocation + "&subscription-key=" + pipeline.subcriptionKey)
response_json = response.json()
if response_json["status"] == "Succeeded":
pipeline.ResultUploadResourceLocation = response.headers["Resource-Location"]
pipeline.ResultUploadUDID = pipeline.ResultUploadResourceLocation.split("/")[-1].split("?")[0]
print("DWG upload successful.")
print("UDID: " + pipeline.ResultUploadUDID)
elif response_json["status"] == "Failed":
print("DWG Upload process failed.")
exit()
else:
time.sleep(1)
get_upload_status(pipeline)
return pipeline

https://eu.atlas.microsoft.com/mapData?&api-version=2.0&dataFormat=dwgzippackage&subscription-key=*********************