> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RS_WorldToRasterCoordX

Returns the X coordinate of the grid coordinate of the given world coordinates as an integer.

<img src="https://mintcdn.com/wherobots/AayJA2u8CknIeTgt/images/sql-functions/RS_WorldToRasterCoordX/RS_WorldToRasterCoordX.svg?fit=max&auto=format&n=AayJA2u8CknIeTgt&q=85&s=fae0a5305f648b587681e9a5f0b526bd" alt="RS_WorldToRasterCoordX" width="620" height="360" data-path="images/sql-functions/RS_WorldToRasterCoordX/RS_WorldToRasterCoordX.svg" />

## Signatures

```sql theme={"system"}
RS_WorldToRasterCoordX(raster: Raster, point: Geometry)
```

```sql theme={"system"}
RS_WorldToRasterCoordX(raster: Raster, x: Double, y: Double)
```

## Parameters

<ParamField body="raster" type="Raster" required>
  The input raster.
</ParamField>

<ParamField body="x" type="Double">
  The X coordinate (longitude).
</ParamField>

<ParamField body="y" type="Double">
  The Y coordinate (latitude).
</ParamField>

<ParamField body="point" type="Geometry">
  The point value.
</ParamField>

## Return type

<ResponseField type="Integer">
  An integer value.
</ResponseField>

## Examples

```sql theme={"system"}
SELECT RS_WorldToRasterCoordX(ST_MakeEmptyRaster(1, 5, 5, -53, 51, 1, -1, 0, 0), -53, 51) from rasters;
```

```
1
```

```sql theme={"system"}
SELECT RS_WorldToRasterCoordX(ST_MakeEmptyRaster(1, 5, 5, -53, 51, 1, -1, 0, 0), ST_GeomFromText('POINT (-53 51)')) from rasters;
```

```
1
```

<Tip>
  For non-skewed rasters, you can provide any value for latitude and the intended value of world longitude, to get the desired answer
</Tip>
