GeorepositoryClient¶
- class geodetic_engine.georepository.GeorepositoryClient[source]¶
Bases:
objectReads objects from a Georepository instance.
Example
>>> client = GeorepositoryClient(config) >>> systems = list( ... client.iter_collection("GeodeticCoordRefSystem") ... )
- get_object(url)[source]¶
Fetch a single object by absolute URL, caching the result.
Scope, extent, unit and method objects are referenced by many parents; without caching the same object is refetched hundreds of times.
- aliases(item)[source]¶
Fetch the alias records of an object.
Every object type exposes
{object}/alias. The detail representation sometimes carries an inlineAliasarray as well; that is preferred when present to avoid a round trip.
- detail(item)[source]¶
Fetch the full object behind a search result.
Collection endpoints return summaries; the fields needed to build a proj.db row only appear on the detail representation.
- wkt(item)[source]¶
Export an object as WKT2.
The register’s own rendering is used rather than one rebuilt from the object’s fields, so that a CRS this workflow does not model in full still reaches PROJ exactly as the authority stated it.
- Parameters:
- Return type:
- Returns:
The WKT string, or None when the object advertises no link or the instance returns an empty body.
- Raises:
GeorepositoryApiError – If the export request fails. A bound CRS is one such case: the endpoint exists but answers HTTP 501.
Example
>>> client.wkt(client.detail(item)) 'GEOGCRS["ED50",DATUM[...'
- iter_collection(endpoint, *, authorities=None)[source]¶
Yield every object in a collection endpoint, page by page.
- Parameters:
- Yields:
Search result objects in server order.
- Raises:
PaginationTruncatedError – If the server advertises more results than were collected, or repeats a page, which indicates the
pageparameter was ignored.
- versions(*, custom_authority=None)[source]¶
The newest version of each dataset the register keeps.
A register versions two things separately and reports both on its own landing page: the EPSG dataset it carries, and the objects it defines itself. A version history entry states no
DataSource, so the two series are told apart by code, EPSG’s running up from 1 and the register’s own from a fixed floor well above EPSG’s range.Only the collection summaries are read, never the detail of each entry: there are hundreds of them, and a build needs this answer before it can decide anything else.
- Parameters:
custom_authority (
str|None, default:None) – Name to report the register’s own series under. Defaults tocustom, since the register does not name it.- Return type:
- Returns:
Version by dataset, such as
{"EPSG" -- "12.053", "Example": "1.103"}. Empty when the instance exposes no version history.