diff --git a/.github/workflows/test-docker-action.yml b/.github/workflows/test-docker-action.yml index d20221bc..fe324cfd 100644 --- a/.github/workflows/test-docker-action.yml +++ b/.github/workflows/test-docker-action.yml @@ -33,3 +33,4 @@ jobs: MAPBOXUSERNAME: ${{ secrets.MAPBOXUSERNAME }} MAPBOXTOKEN: ${{ secrets.MAPBOXTOKEN }} MAPBOXTILESET: ${{ secrets.MAPBOXTILESET }} + MAPBOXLAYERNAME: ${{ secrets.MAPBOXLAYERNAME }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1dc78a0d..b72e6fe4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,7 @@ env: MAPBOXUSERNAME: "123" MAPBOXTOKEN: "456" MAPBOXTILESET: "xyz" + MAPBOXLAYERNAME: "abc" LOGGING: INFO DATABASE_URL: postgresql://fangorn:ent@localhost:5432/trees?schema=public diff --git a/action.yml b/action.yml index 58e2aa80..c77114b1 100644 --- a/action.yml +++ b/action.yml @@ -38,6 +38,9 @@ inputs: MAPBOXTILESET: description: "" required: true + MAPBOXLAYERNAME: + description: "The layer within the tileset that holds the trees data" + required: true LOGGING: description: "" required: true @@ -56,5 +59,7 @@ runs: S3_BUCKET: ${{ inputs.S3_BUCKET }} MAPBOXUSERNAME: ${{ inputs.MAPBOXUSERNAME }} MAPBOXTOKEN: ${{ inputs.MAPBOXTOKEN }} + MAPBOXTILESET: ${{ inputs.MAPBOXTILESET }} + MAPBOXLAYERNAME: ${{ inputs.MAPBOXLAYERNAME }} LOGGING: ${{ inputs.LOGGING }} DATABASE_URL: ${{ inputs.DATABASE_URL }} diff --git a/docker-compose.yml b/docker-compose.yml index 3d5fa8e5..68c30051 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: MAPBOXUSERNAME: "123" MAPBOXTOKEN: "456" MAPBOXTILESET: "xyz" + MAPBOXLAYERNAME: "abc" OUTPUT: "True" LOGGING: INFO diff --git a/harvester/harvester.py b/harvester/harvester.py index 3b54c3d6..6e5bfb12 100644 --- a/harvester/harvester.py +++ b/harvester/harvester.py @@ -402,8 +402,8 @@ def finishGeojson(feature_list, file_name): url = "https://api.mapbox.com/uploads/v1/{}?access_token={}".format( os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTOKEN")) - payload = '{{"url":"http://{}.s3.amazonaws.com/{}","tileset":"{}.{}"}}'.format( - s3_credentials["bucket"], s3_credentials["key"], os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTILESET")) + payload = '{{"url":"http://{}.s3.amazonaws.com/{}","tileset":"{}.{}","name":"{}"}}'.format( + s3_credentials["bucket"], s3_credentials["key"], os.getenv("MAPBOXUSERNAME"), os.getenv("MAPBOXTILESET"), os.getenv("MAPBOXLAYERNAME")) headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8', 'Cache-Control': 'no-cache'} response = requests.post(url, data=payload, headers=headers)