---
title: Get the geo reference
summary: Read the geo reference stored on a version, in WGS84 or converted to another EPSG system, from JavaScript, Java or the OpenAPI, and detect a model that has none.
order: 10
languages: [javascript, java]
terms: [geo-reference, crs, version, vid]
see-also: [how-to/geo/set-the-geo-reference, how-to/geo/extract-from-epsg-or-wkt, how-to/viewer3d/geo-mode, explanation/geo-referencing-in-ifc]
notion: https://app.notion.com/p/50ded66cdddc4f9da43a12ed5cdb75c0
---

# Get the geo reference

BIM.works stores every [[term:geo-reference]] in WGS84 (`EPSG:4326`). This guide reads it, optionally converted to the projected [[term:crs|CRS]] your application works in.

## Before you start

You need a client with the `gis:read` scope and the [[term:vid|Vid]] of a processed version. Note that almost every IFC model *has* a geo reference after processing: extraction runs at upload, and what it finds in `IfcSite` is often wrong. A stored reference is not proof that the model is placed correctly.

## Steps

1. **Read it.** The result carries the geo reference and the anchor point, the point in model coordinates (millimetres) that the latitude and longitude refer to; it is `null` for a version without one. Pass a target EPSG code to receive the coordinates in that system instead of WGS84.

   ````code-group
   ```javascript
   const factory = new BimWorksClientFactory(BIM_WORKS_ADDRESS);
   const client = await factory.createClientWithApiToken(BIM_WORKS_API_TOKEN);

   const stored = await client.gis.getGeoReference(BIM_WORKS_FIRST_MODEL, null);
   if (stored == null) {
   	console.log("no geo reference");
   } else {
   	const {latitude, longitude, elevation, rotation, epsg} = stored.geo_reference;   // epsg is "EPSG:4326"
   	console.log(latitude, longitude, elevation, rotation, stored.anchor_point);
   }

   // The same, converted to the Dutch RD New system
   const rd = await client.gis.getGeoReference(BIM_WORKS_FIRST_MODEL, "EPSG:28992");
   ```
   ```java
   try (BimWorksClientFactory factory = new BimWorksClientFactory(BIM_WORKS_ADDRESS);
        BimWorksClient client = factory.createClientWithApiToken(BIM_WORKS_API_TOKEN)) {
   	GeoReferenceExtraction stored = client.gis.getGeoReference(UUID.fromString(BIM_WORKS_FIRST_MODEL));
   	if (stored == null) {
   		System.out.println("no geo reference");
   	} else {
   		GeoReference geoReference = stored.getGeoReference();   // always EPSG:4326
   		System.out.println(geoReference.getLatitude() + ", " + geoReference.getLongitude() + " at " + stored.getAnchorPoint());
   	}
   }
   ```
   ```shell
   # The OpenAPI has no geo-reference operation; the version carries it. Bearer token from LoginWithApiToken.
   ADDRESS=BIM_WORKS_ADDRESS
   curl -s -X POST "$ADDRESS/openapi/fs/GetVersion" \
     -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
     -d '{"uuid": "'BIM_WORKS_FIRST_MODEL'"}' | jq .geo_reference
   ```
   ````

2. **Use it.** `rotation` is in degrees around the anchor point, `elevation` in metres. To place two models on one map, compare their references: the viewer does this itself in GEO mode ([[page:how-to/viewer3d/geo-mode]]).

   In JavaScript, `getGeoReference(versionUuid, null, {placedPoints: true})` also answers `bounds_centre` and `zero_point`, `{latitude, longitude, elevation}`: where the centre of the model's bounds and its origin land on the earth, to mark next to its outline ([[page:how-to/geo/get-the-footprint]]).

The Java `getGeoReference` has no target-EPSG argument and always returns WGS84; the OpenAPI ([[openapi:GetVersion]]) returns the stored reference without the anchor point and without conversion.

```note
The JavaScript type definitions declare the result as a `GeoReference`; the object actually returned is `{geo_reference, anchor_point}`, as shown above and as the BIM.works UI reads it.
```

## Check

For a model you placed in the UI ([[page:how-to/using-bimworks/set-a-geo-reference]]), `latitude` and `longitude` are the values shown in its *Location* section.
