Code Monkey home page Code Monkey logo

edigeo-reproject's Introduction

edigeo-reproject

npm version CircleCI codecov XO code style

Reprojection à la volée des feuilles EDIGÉO

Pré-requis

Utilisation côté serveur

Installation

npm install @etalab/edigeo-reproject

If you need to use CommonJS syntax, you will need to use the package version 0.2.0 and install it with npm install [email protected]

Exemple d'utilisation

Get sample data

wget https://cadastre.data.gouv.fr/data/dgfip-pci-vecteur/2023-01-01/edigeo/feuilles/54/54008/edigeo-540080000C01.tar.bz2

Sample for ES6 syntax

A file index-es6.mjs as below

import { readFile, writeFile } from 'fs/promises'
import { reprojectArchive } from 'edigeo-reproject'

// Actuellement l'opérateur await ne fonctionne que dans une fonction asynchrone
async function doJob() {
  const originalArchive = await readFile('edigeo-540080000C01.tar.bz2')
  const reprojectedArchive = await reprojectArchive(originalArchive, '54', 'L93toCC') // L93toCC ou CCtoL93
  await writeFile('edigeo-cc-540080000C01.tar.bz2', reprojectedArchive)
}

doJob().catch(console.error)

Sample for CommonJS syntax

It works only if using [email protected] package.

A file index-commonjs.js as below

const fs = require('fs')
const fsPromises = fs.promises // Available with Node 10+
const {reprojectArchive} = require('edigeo-reproject')

// Actuellement l'opérateur await ne fonctionne que dans une fonction asynchrone
async function doJob() {
  const originalArchive = await fsPromises.readFile('edigeo-540080000C01.tar.bz2')
  const reprojectedArchive = await reprojectArchive(originalArchive, '54', 'L93toCC') // L93toCC ou CCtoL93
  await fsPromises.writeFile('edigeo-cc-540080000C01.tar.bz2', reprojectedArchive)
}

doJob().catch(console.error)

Utilisation en ligne de commande

Installation

npm install -g edigeo-reproject

Exemple d'utilisation

curl edigeo-540080000C01.tar.bz2 | edigeo-reproject -d 54 -m L93toCC > edigeo-cc-540080000C01.tar.bz2
# ou directement à partir d'une ressource distante
curl https://cadastre.data.gouv.fr/data/dgfip-pci-vecteur/2023-01-01/edigeo/feuilles/54/54008/edigeo-540080000C01.tar.bz2 | edigeo-reproject -d 54 -m L93toCC > edigeo-cc-540080000C01.tar.bz2

Licence

MIT

edigeo-reproject's People

Contributors

jdesboeufs avatar thomasg77 avatar

Stargazers

Francisco Euzébio da Cruz avatar  avatar  avatar Jonathan Montane avatar

Watchers

 avatar James Cloos avatar  avatar Thibaud Dauce avatar Geoffrey Aldebert avatar Théophile Merlière avatar Jordan Guedj avatar  avatar  avatar

Forkers

qpc-github

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.