Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade to Python 3.11 #33

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7-2020-12-19
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11

COPY ./bridge-style /tmp/bridge-style
COPY requirements.txt /tmp/
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ serve: init-geoserver
convert: ## Convert a style from lyrx to sld (input files set in config.mk) and upload it to GeoServer
convert: serve
psql -h $(PG_HOST) -p $(PG_PORT) -U $(PG_USER) -d $(PG_DATABASE) -a -f $(BASE_PATH)/$(SQL_SCRIPT)
curl --location -d @$(BASE_PATH)/$(LYRX_FILE) $(LYRX2SLD_URL) -o $(BASE_PATH)/output.zip
curl -H 'Content-Type: application/json' --location -d @$(BASE_PATH)/$(LYRX_FILE) $(LYRX2SLD_URL) -o $(BASE_PATH)/output.zip
curl -u admin:geoserver -XPOST -H "Content-type: application/zip" --data-binary @$(BASE_PATH)/output.zip $(GEOSERVER_URL)rest/styles

.PHONY: update
update: ## Convert again the lyrx and update the already existing "Default Styler" style.
curl --location -d @$(BASE_PATH)/$(LYRX_FILE) $(LYRX2SLD_URL) -o $(BASE_PATH)/output.zip
curl -H 'Content-Type: application/json'--location -d @$(BASE_PATH)/$(LYRX_FILE) $(LYRX2SLD_URL) -o $(BASE_PATH)/output.zip
curl -u admin:geoserver -XPUT -H "Content-type: application/zip" --data-binary @$(BASE_PATH)/output.zip $(GEOSERVER_URL)rest/styles/Default%20Styler

.PHONY: stop
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ docker run --rm -d --name lyrx2sld -p 80:80 camptocamp/lyrx2sld:latest
### Usage
lyrx data should be sent as a file to http://localhost/v1/lyrx2sld/ through a POST request. The converted SLD styling is sent back in the response content (content type: application/x-zip-compressed). Example using `curl`:
```
curl --location -d @/path/to/input.lyrx http://localhost/v1/lyrx2sld/ -o /path/to/output.zip
curl --location -d @/path/to/input.lyrx -H 'Content-Type: application/json' -o /path/to/output.zip "http://localhost/v1/lyrx2sld/"
```

Optional request parameter: `replaceesri` to replace ESRI font markers with standard symbols, to be set to `true` or `false` (default):
```
curl --location -d @/path/to/input.lyrx "http://localhost/v1/lyrx2sld/?replaceesri=true" -o /path/to/output.zip
curl --location -d @/path/to/input.lyrx -H 'Content-Type: application/json' -o /path/to/output.zip "http://localhost/v1/lyrx2sld/?replaceesri=true"
```
Warnings and errors from bridge-style are written to the logs - to view them:
```
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SERVICE="http://localhost/v1/lyrx2sld/"
INPUT_FILE="tests/data/withicons.lyrx"
OUTPUT_FILE="/tmp/output.zip"

STATUS_CODE=$(curl --write-out %{http_code} -v -d @$INPUT_FILE -o $OUTPUT_FILE $SERVICE)
STATUS_CODE=$(curl --write-out %{http_code} -v -d @$INPUT_FILE -H 'Content-Type: application/json' -o $OUTPUT_FILE $SERVICE)

if [ -f "$OUTPUT_FILE" ] && [ $STATUS_CODE = 200 ]; then
echo "Output file has been created and request status code is 200"
Expand Down
Loading