Coordinates
Documentation of the LibGeoWebCoordinateV2 contract
The Geo Web Coordinate library defines the Geo Web's fixed global grid and coordinate system. It is the basis for the spatial definition of all Geo Web land parcels.
The system's grid lines create rectangular areas referred to as Geo Web Coordinates. Each of these Coordinates is uniquely identified and stored with an EVM-optimized method as 1 bit (0=available, 1=claimed). This provides a scalable, on-chain way to ensure that no two parcels overlap (i.e. all Coordinates in a new claim are unclaimed) even as the number of claimed parcels grows into the millions.

A single Geo Web Coordinate (yellow rectangle) on testnet
In the testnet implementation, a larger grid size was used for more practical large land claims. Mainnet uses a smaller grid size that balances transaction fees/size with enabling faithful representation of existing physical-world property lines (~20m
around the equator). This grid may be further divided for more precision or migrated to a system that allows arbitrary polygon definition at a later date.
uint64 MAX_X
uint64 MAX_Y
function traverse(uint64 origin, uint256 direction, uint256 iX, uint256 iY, uint256 i) external pure returns (uint64, uint256, uint256, uint256)
Traverse a single direction
Parameters
Name | Type | Description |
---|---|---|
origin | uint64 | The origin coordinate to start from |
direction | uint256 | The direction to take |
iX | uint256 | |
iY | uint256 | |
i | uint256 | |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint64 | destination The destination coordinate |
[1] | uint256 | |
[2] | uint256 | |
[3] | uint256 | |
function _traverse(uint64 origin, uint256 direction, uint256 iX, uint256 iY, uint256 i) internal pure returns (uint64, uint256, uint256, uint256)
function _getX(uint64 coord) internal pure returns (uint64 coordX)
Get the X coordinate
function _getY(uint64 coord) internal pure returns (uint64 coordY)
Get the Y coordinate
function toWordIndex(uint64 coord) external pure returns (uint256 iX, uint256 iY, uint256 i)
Convert coordinate to word index
function _toWordIndex(uint64 coord) internal pure returns (uint256 iX, uint256 iY, uint256 i)
Last modified 1mo ago