Giter Club home page Giter Club logo

geospatial's Introduction

Sterblue Geospatial

Geospatial monorepo for geospatial related packages

Packages

Auxiliary packages

Packages used for compiling and other auxiliary tasks.

Get started

Just add the required package to your dependencies e.g. yarn add @geospatial/geometry-referential or add it directly editing your package.json enjoy! More info can be found inside the package folder.

The example below show how to use both Geometry Referential and Coordinates altitude

import { addAltitudeToGeojson } from "@geospatial/geometry-coordinates-altitude";
import { convert, convertAsync } from "@geospatial/geometry-referential";



    const geojson = {
        "type": "FeatureCollection",
        "crs": {
          "type": "name",
          "properties": {
            "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
          }
        },
        "features": [
              {
                "type": "Feature",
                "properties": {
                  "name": "Bourgogne"
                },
                "geometry": { "type": "Point", "coordinates": [3.461807, 46.880655] }
              },
              {
                "type": "Feature",
                "properties": {
                  "name": "Cote d'ivoire"
                },
                "geometry": { "type": "Point", "coordinates": [-4.395542, 5.332077] }
              }
            ]
      };
    async function asyncFunction() {

        /*************************
         * Add altitude to coordinate 
         * using @geospatial/geometry-coordinates-altitude
        **************************/
        var result = await addAltitudeToGeojson(geojson);
        console.log(result.features[0].geometry.coordinates);

        /*************************
         * Transform from EPSG:4326 to EPSG:3857 
         * and convert from arrayXYZ into objectXYZ
         * Using @geospatial/geometry-referential
        **************************/
        const myConvertion = await convertAsync(
            {
                system: {
                  type: "reference",
                  definition: "EPSG:4326",
                  altitudeReference: "default"
                },
                format: {
                  type: "arrayXYZ"
                }
              },
              {
                system: {
                  type: "reference",
                  definition: "EPSG:3857",
                  altitudeReference: "default"
                },
                format: {
                  type: "objectXYZ"
                }
              }
          );
        result = await myConvertion(result.features[0].geometry.coordinates);
        console.log(result);
      }
      asyncFunction();

geospatial's People

Contributors

crubier avatar lcalisto avatar

Watchers

 avatar

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.