Skip to content

Commit

Permalink
doc: add crs message type (#41)
Browse files Browse the repository at this point in the history
* doc: add crs message type to README.md

* feature: add crs handling in web page
  • Loading branch information
gounux authored Oct 28, 2024
1 parent b2fe8b3 commit 170372d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ Each of them has a `"type"` key based on which it is possible to parse them :

> The coordinates of the `geojson` features must be expressed using the provided `crs_wkt` and `crs_authid`
1. `"crs"`: someone shared a [CRS](https://en.wikipedia.org/wiki/Spatial_reference_system), e.g.:

```json
{
"type": "geojson",
"author": "jane_doe",
"avatar": "mIconPostgis.svg",
"crs_wkt": 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',
"crs_authid": "EPSG:4326",
}

```

1. `"uncompliant"`: someone sent an uncompliant message and the server answers with such a message, e.g.:

```json
Expand Down
3 changes: 3 additions & 0 deletions gischat/templates/ws-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ <h1>gischat web client</h1>
case "geojson":
displayMessage(`${data.author} sent the "${data.layer_name}" geojson layer (${data.geojson.features.length} features using ${data.crs_authid})`);
break;
case "crs":
displayMessage(`${data.author} shared the crs '${data.crs_authid}'`);
break;
default:
displayMessage(`Unknown message received: ${data}`);
}
Expand Down

0 comments on commit 170372d

Please sign in to comment.