---
title: "Leabharlanna Geospásúla a"
version: 6.0
locale: ga
source: https://docs.djangoproject.com/ga/6.0/ref/contrib/gis/install/geolibs/
canonical: https://djangodocs.dev/ga/6.0/ref/contrib/gis/install/geolibs/
---
# Leabharlanna Geospásúla a

## Leabharlanna geospásúla

Úsáideann GeodJango agus/nó soláthraíonn sé comhéadain do na leabharlanna geospásúla foinse oscailte

| Clár | Cur síos | Riachtanach | Leaganacha Tacaithe |
| --- | --- | --- | --- |
| [GEOS](/ga/6.0/ref/contrib/gis/geos/#geos-overview) | Foinse Oscailte Inneall Ge | Tá | 3.14, 3.13, 3.12, 3.11, 3.10, 3.9, 3.8 |
| [PROJECT](https://proj.org/) | Leabharlann Réamh-mheastach | Sea (PostgreSQL agus SQLite amháin) | 9.x, 8.x, 7.x, 6.x |
| [GDAL](/ga/6.0/ref/contrib/gis/gdal/#gdal-overview) | Leabharlann Aistí Sonraí Geospásúla | Tá | 3.11, 3.10, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1 |
| [GeoIP](/ga/6.0/ref/contrib/gis/geoip2/#geoip2-overview) | Leabharlann geolocation bunaithe ar IP | Níl | 2 |
| [PostGis](https://postgis.net/) | Síntí spásúla do PostgreSQL | Sea (PostgreSQL amháin) | 3.5, 3.4, 3.3, 3.2, 3.1 |
| [Spatialite](https://www.gaia-gis.it/gaia-sins/) | Síntí spásúla le haghaidh SQLite | Sea (SQLite amháin) | 5.1, 5.0, 4.3 |

Tabhair faoi deara go bhféadfadh leaganacha níos sine nó níos déanaí de na leabharlanna seo oibriú go hiomlán breá le GeodJango freisin. Féadfaidh do mhíleáiste a athrú.

> **Note**
>
> The GeoDjango interfaces to GEOS, GDAL, and GeoIP may be used
> independently of Django. In other words, no database or settings file
> required -- import them as normal from [`django.contrib.gis`](/ga/6.0/ref/contrib/gis/#module-django.contrib.gis).

Ar Debian/Ubuntu, moltar duit na pacáistí seo a leanas a shuiteáil a shuiteálfaidh, go díreach nó trí spleáchas, na leabharlanna geospásúla riachtanacha:

```console
$ sudo apt-get install binutils libproj-dev gdal-bin
```

Téigh i gcomhairle le treoracha ardáin a shonraíonn freisin má tá tú ar:ref: macos nó:ref: windows.

## Tógáil ó fhoinse

When installing from source on UNIX and GNU/Linux systems, please follow
the installation instructions carefully, and install the libraries in the
given order. If using MySQL or Oracle as the spatial database, only GEOS
is required.

> **Note**
>
> Ar ardáin Linux, b'fhéidir go mbeadh sé riachtanach an t-ordú ldconfig a reáchtáil tar éis gach leabharlann a shuiteáil. Mar shampla:
>
> ```shell
> $ sudo make install
> $ sudo ldconfig
> ```

> **Note**
>
> Ní mór d'úsáideoirí macOS [Xcode](https://developer.apple.com/xcode/) a shuiteáil d'fhonn bogearraí a thiomsú ón bhfoinse.

### GEOS

GEOS is a C++ library for performing geometric operations, and is the default
internal geometry representation used by GeoDjango (it's behind the "lazy"
geometries). Specifically, the C API library is called (e.g., `libgeos_c.so`)
directly from Python using ctypes.

Ar dtús, íoslódáil GEOS ó shuíomh Gréasáin GEOS agus déan an cartlann foinse a dhíoslódáil:

```shell
$ wget https://download.osgeo.org/geos/geos-X.Y.Z.tar.bz2
$ tar xjf geos-X.Y.Z.tar.bz2
```

Ansin téigh isteach san eolaire GEOS, cruthaigh fillteán tógáil , agus déan isteach ann:

```shell
$ cd geos-X.Y.Z
$ mkdir build
$ cd build
```

Ansin tógáil agus suiteáil an pacáiste:

```shell
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ cmake --build .
$ sudo cmake --build . --target install
```

#### Fabhtcheartú

##### Ní féidir leabharlann GEOS a fháil

Nuair nach féidir le GeodJango GEOS a fháil, ardaítear an earráid seo:

```text
ImportError: Could not find the GEOS library (tried "geos_c"). Try setting GEOS_LIBRARY_PATH in your settings.
```

Is é an réiteach is coitianta ná do: ref: libsettings *nó* set:ref: geoslibrarypath a chumrú i gceart i do shocruithe.

Má tá pacáiste dénártha de GEOS á úsáid agat (m.sh., ar Ubuntu), b'fhéidir go mbeidh ort: ref: binutils.

##### `CONAIR_LEABHARLANNA_GEOS`

If your GEOS library is in a non-standard location, or you don't want to
modify the system's library path then the [`GEOS_LIBRARY_PATH`](/ga/6.0/ref/contrib/gis/geos/#std-setting-GEOS_LIBRARY_PATH)
setting may be added to your Django settings file with the full path to the
GEOS C library. For example:

```shell
GEOS_LIBRARY_PATH = '/home/bob/local/lib/libgeos_c.so'
```

> **Note**
>
> Caithfidh an socrú gurb é an cosán *iomlán* chuig an leabharlann roinnte\*\*C\*\*; i bhfocail eile ba mhaith leat `libgeos_c.so` a úsáid, ní `libgeos.so`.

\<geos-exceptions-in-logfile\>Féach freis:ref: Líontar mo logaí le earráidí a bhaineann le Geos .

### PROJ

Is leabharlann é [PROJ](https://proj.org/) chun sonraí geospásúla a thiontú go córais tagartha comhordaithe éagsúla.

Ar dtús, íoslódáil cód foinse PROJ:

```shell
$ wget https://download.osgeo.org/proj/proj-X.Y.Z.tar.gz
```

... agus comhaid athraithe dáta (íoslódáil `proj-datumgrid-x.y.tar.gz` do PROJ \<7.x) \[#\] \_:

```shell
$ wget https://download.osgeo.org/proj/proj-data-X.Y.tar.gz
```

Ansin, déan an cartlann cód foinse a bhaint, agus bain na comhaid athraithe dáta san fho-eolaire `sonra`. Caithfear é seo a dhéanamh *roimh* chun cumraíocht:

```shell
$ tar xzf proj-X.Y.Z.tar.gz
$ cd proj-X.Y.Z/data
$ tar xzf ../../proj-data-X.Y.tar.gz
$ cd ../..
```

Maidir le PROJ 9.x agus níos mó, ní scaoiltear ach tógáil tacaíochta ag baint úsáide as `Cmake` (féach [PROJ RFC-7](https://proj.org/community/rfc/rfc-7.html#rfc7)).

Chun tógáil le `Cmake` cinntigh go gcomhlíonann do chóras na [riachtanais tógála](https://proj.org/install.html#build-requirements). Ansin cruthaigh fillteán tógáil san eolaire PROJ, agus déan isteach ann:

```shell
$ cd proj-X.Y.Z
$ mkdir build
$ cd build
```

Faoi dheireadh, cumraigh, déan agus suiteáil PROJ:

```shell
$ cmake ..
$ cmake --build .
$ sudo cmake --build . --target install
```

### GDAL

[GDAL](https://gdal.org/) is an excellent open source geospatial library that has support for
reading most vector and raster spatial data formats. Currently, GeoDjango only
supports [GDAL's vector data](/ga/6.0/ref/contrib/gis/gdal/#gdal-vector-data) capabilities [^2].
[GEOS](#geosbuild) and [PROJ](#proj4) should be installed prior to building GDAL.

Déan an leagan scaoilte GDAL is déanaí a íoslódáil ar dtús agus déan an cartlann

```shell
$ wget https://download.osgeo.org/gdal/X.Y.Z/gdal-X.Y.Z.tar.gz
$ tar xzf gdal-X.Y.Z.tar.gz
```

Maidir le GDAL 3.6.x agus níos mó, ní scaoiltear ach tógáil tacaíochta ag baint úsáide as `Cmake`. Chun tógáil le Cmake\` cruthaigh fillteán tógáil san eolaire GDAL, agus déan isteach ann:

```shell
$ cd gdal-X.Y.Z
$ mkdir build
$ cd build
```

Faoi dheireadh, cumraigh, déan agus suiteáil GDAL:

```shell
$ cmake ..
$ cmake --build .
$ sudo cmake --build . --target install
```

Má tá aon fhadhbanna agat, féach an chuid fabhtcheartaithe thíos le haghaidh moltaí agus réitigh.

#### Fabhtcheartú

##### Ní féidir leabharlann GDAL a fháil

Nuair nach féidir le GeodJango leabharlann GDAL a fháil, cumraigh do: ref: libsettings *nó* set:ref: gdallibrarypath i do shocruithe.

##### `BÓTHAIR_LEABHARLANNA_GDAL`

If your GDAL library is in a non-standard location, or you don't want to
modify the system's library path then the [`GDAL_LIBRARY_PATH`](/ga/6.0/ref/contrib/gis/gdal/#std-setting-GDAL_LIBRARY_PATH)
setting may be added to your Django settings file with the full path to
the GDAL library. For example:

```shell
GDAL_LIBRARY_PATH = '/home/sue/local/lib/libgdal.so'
```

**Fonótaí**

[^1]: The datum shifting files are needed for converting data to and from
certain projections.
For example, the PROJ string for the [Google projection (900913 or 3857)](https://spatialreference.org/ref/epsg/3857/) requires the `null`
grid file only included in the extra datum shifting files. It is easier
to install the shifting files now, than to debug a problem caused
by their absence later.

[^2]: Go sonrach, soláthraíonn GeoDjango tacaíocht don leabharlann [OGR](#ogr), comhpháirt de GD\< [https://gdal.org/user/vector\_data\_model.html](https://gdal.org/user/vector_data_model.html)\> AL.
