npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

geo4326

v1.6.2

Published

geo4326 converts footprint of satellite to polygon of EPSG:4326.

Downloads

139

Readme

geo4326

geo4326 is utilities for geospatial vector data.

  • create a polygon of CRS84 from other projection coordinates.
  • cut a polygon of CRS84 at the Antimeridian.
  • measure distace and area on the WGS 84 ellipsoid.
  • translate satellite position to lon / lat.

Depends: proj4, epsg-index, satellite.js

Documens

docs

Example

import { transform } from "geo4326";
const upperLeft = [382200, 2512500]
const lowerLeft = [382200, 2279400]
const upperRight = [610500, 2512500]
const lowerRight = [610500, 2279400]
const srcCrs = "+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs";
transform.geojsonFromCornerCoordinates(
    upperLeft, lowerLeft, upperRight, lowerRight, srcCrs,
    { partition: 1 }
)

result

{
    "type": "Feature",
    "bbox": [
        85.85296718933643,
        20.610041795245515,
        88.07596179098903,
        22.71977571380184
    ],
    "properties": {},
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [
                    85.85296718933643,
                    22.715665870841406
                ],
                [
                    85.86148358606191,
                    21.662922032738383
                ],
                [
                    85.86949772758247,
                    20.610041795245515
                ],
                [
                    86.96496913971062,
                    20.613735097472325
                ],
                [
                    88.06045501053289,
                    20.610485722030123
                ],
                [
                    88.06797282315149,
                    21.663390816645528
                ],
                [
                    88.07596179098903,
                    22.716159863683806
                ],
                [
                    86.96445677235502,
                    22.71977571380184
                ],
                [
                    85.85296718933643,
                    22.715665870841406
                ]
            ]
        ]
    }
}

note

In codes, EPSG:4326 means urn:ogc:def:crs:OGC:1.3:CRS84(Axes: lon/lat).

Linear ring enclosing the pole is transformed to polar sterographic projections once.
Source CRS -> polar sterographic projections (EPSG:3995, EPSG:3031) -> EPSG:4326

Not support following linear rings.

  • enclosing the pole and straddling the antimeridian many times
  • enclosing the two poles.

Input polygon must be less than 360deg in width and less than 180deg in height, in CRS84.