Giter Site home page Giter Site logo

Comments (4)

rveciana avatar rveciana commented on April 28, 2024 1

Thank you! It's very simple, a very nice library.

from d3-contour.

mbostock avatar mbostock commented on April 28, 2024

There are a lot of options for displaying GeoJSON while applying simple transformations in planar coordinates:

  1. Use the SVG viewBox attribute.

  2. Use SVG transforms.

  3. Use Canvas transforms.

  4. Use d3.geoPath’s projection, often in conjunction with d3.geoIdentity.

Here’s a live example of the surface temperature GeoTIFF using the first option:

https://bl.ocks.org/mbostock/4886c227038510f1c103ce305bef6fcc

If you want to convert from planar coordinates back to spherical coordinates, and then reproject those spherical coordinates using a different spherical-to-planar projection (say d3.geoOrthographic), it’s a bit tricker. You could either assume that the planar coordinates are equirectangular (d3.geoEquirectangular) and then treat them as x = longitude, y = latitude (perhaps with another simpler planar translate and scale), or you’d need to know the exact spherical projection in use and run it through project.invert. After that, you’d want to run it through d3.geoStitch to remove the antimeridian and polar cuts, and lastly run back through your new projection.

from d3-contour.

mbostock avatar mbostock commented on April 28, 2024

Here’s an example of reprojecting contours:

preview

from d3-contour.

Plantain avatar Plantain commented on April 28, 2024

Could you add an example for reprojecting contours when the source is a limited domain rather than 0,360 -90,90?

from d3-contour.

Related Issues (20)

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.