GithubHelp home page GithubHelp logo

isabella232 / deprecated-stacker-of-worlds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapbox/deprecated-stacker-of-worlds

0.0 0.0 0.0 32 KB

Stack GeoJSON spanning multiple worlds onto the One True World

License: ISC License

JavaScript 100.00%

deprecated-stacker-of-worlds's Introduction

stacker-of-worlds

WORK IN PROGRESS

Stack GeoJSON spanning multiple worlds onto the One True World of CRS84 — that is, with all longitudes contained between -180 and +180.

By different "worlds" I mean different 360 degree segments of an infinite longitudinal range: -180 to +180, 180 to 540, 540 to 900, -540 to -180, -900 to -540, etc.

How it works

Accepts a GeoJSON Feature or FeatureCollection and returns a new Feature or FeatureCollection representing the same information but with the following transformations to ensure coordinates fall within real longitudes (applied to the sole Feature or else to every Feature in the FeatureCollection):

  • If the Feature exists completely inside +/-180, leave it as it is.
  • If the Feature exists completely outside +/-180, translate its coordinates over to the One True World.
  • If the Feature spans any number of datelines in any number of "worlds", split it at the datelines to create one geometry for each world, translate each geometry's coordinates to the One True World, then combine all the translated coordinates into a Multi* Feature.

deprecated-stacker-of-worlds's People

Contributors

davidtheclark 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.