# setCellSpaceLocation **Endpoint:** `POST https://firesim.cs.gsu.edu/api/setCellSpaceLocation` Set the geographic center of the simulation. Required when using online fuel data. Accepts any US coordinate. ## Parameters | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `userToken` | string | yes | — | Your simulation token. | | `lat` | number (double) | yes | — | Latitude of the center of the simulation area. | | `lng` | number (double) | yes | — | Longitude of the center of the simulation area. | ## Responses ### HTTP 200 Location set successfully. **Example:** ```json "Set cell space location" ``` ### HTTP 500 Internal server error (Spring JSON). Returned when `userToken` is missing or invalid — the server cannot locate the simulation instance for that token. **Example:** ```json { "timestamp": "2026-05-20T16:41:20.921+00:00", "status": 500, "error": "Internal Server Error", "path": "/api/setCellSpaceLocation" } ``` ## Examples ### Python ```python import requests base_url: str = "https://firesim.cs.gsu.edu/api/setCellSpaceLocation/" params: dict[str, float | str] = { "userToken": "abc123xyz", "lat": 1526555.822562622, "lng": -35655.01701560877, } response = requests.post(base_url, params=params) print(response.text) ``` ### JavaScript ```javascript /** @type {string} */ const BASE_URL = "https://firesim.cs.gsu.edu/api/setCellSpaceLocation/"; const params = { userToken: "abc123xyz", lat: 1526555.822562622, lng: -35655.01701560877, }; const url = new URL(BASE_URL); Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v)); fetch(url.toString(), { method: "POST" }) .then(res => res.text()) .then(console.log); ``` ### cURL ```bash BASE_URL="https://firesim.cs.gsu.edu/api/setCellSpaceLocation/" curl -s -X POST \ -G --data-urlencode "userToken=abc123xyz" \ -G --data-urlencode "lat=1526555.822562622" \ -G --data-urlencode "lng=-35655.01701560877" \ "$BASE_URL" ``` ### Java ```java import java.net.URI; import java.net.http.*; String BASE_URL = "https://firesim.cs.gsu.edu/api/setCellSpaceLocation/"; String queryString = "userToken=abc123xyz" + "&" + "lat=1526555.822562622" + "&" + "lng=-35655.01701560877"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL + "?" + queryString)) .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); ``` ### Go ```go import ( "fmt" "io" "net/http" "net/url" ) baseURL := "https://firesim.cs.gsu.edu/api/setCellSpaceLocation/" params := url.Values{} params.Set("userToken", "abc123xyz") params.Set("lat", "1526555.822562622") params.Set("lng", "-35655.01701560877") resp, _ := http.PostForm(baseURL, params) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) ``` ### Rust ```rust use reqwest::blocking::Client; let base_url = "https://firesim.cs.gsu.edu/api/setCellSpaceLocation/"; let params = vec![ ("userToken", "abc123xyz"), ("lat", "1526555.822562622"), ("lng", "-35655.01701560877"), ]; let client = Client::new(); let response = client.post(base_url).query(¶ms).send().unwrap(); println!("{}", response.text().unwrap()); ```