module datasource.geodata

Short summary

module pyensae.datasource.geodata

Geographic datasets.

source on GitHub

Functions

function

truncated documentation

lambert932WGPS

Converts Lambert coordinates into longitude, latitude. Does not use :epkg:`pyproj`.

load_french_departements

Returns the definition of French departments.

Documentation

Geographic datasets.

source on GitHub

pyensae.datasource.geodata.lambert932WGPS(lambertE, lambertN)

Converts Lambert coordinates into longitude, latitude. Does not use :epkg:`pyproj`.

Parameters
  • lambertE – lambertE

  • lambertN – lambertN

Returns

longitude, latitude

source on GitHub

pyensae.datasource.geodata.load_french_departements(cache=None)

Returns the definition of French departments.

Parameters

cache – cache folder

Returns

French departments as a GeoDataFrame

Loads French departments polygons

Simple example to retrieve French departements.

<<<

from pyensae.datasource import load_french_departements
df = load_french_departements()
print(df.head(2).T)

>>>

    /usr/local/lib/python3.9/site-packages/shapefile.py:1067: ResourceWarning: unclosed file <_io.FileIO name='./GEOFLA_2-1_DEPARTEMENT_SHP_LAMB93_FXX_2015-12-01.7z' mode='rb' closefd=True>
      record.points = list(izip(*(iter(flat),) * 2))
                                                                0                                                  1
    geometry    POLYGON ((3.023296506544766 47.86102220986016,...  POLYGON ((4.361587131774929 46.13845863622107,...
    CODE_DEPT                                                  89                                                 69
    CODE_REG                                                   27                                                 84
    CODE_CHF                                                  024                                                381
    ID_GEOFLA                            DEPARTEM0000000000000004                           DEPARTEM0000000000000028
    NOM_CHF                                               AUXERRE                                               LYON
    NOM_DEPT                                                YONNE                                              RHONE
    NOM_REG                               BOURGOGNE-FRANCHE-COMTE                               AUVERGNE-RHONE-ALPES
    X_CENTROID                                             748211                                             832095
    X_CHF_LIEU                                             742447                                             842221
    Y_CENTROID                                            6750855                                            6530600
    Y_CHF_LIEU                                            6744261                                            6520526

source on GitHub