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

node-red-node-geofence

v0.3.4

Published

A simple node to filter based on location

Downloads

1,103

Readme

node-red-node-geofence

Geofence node for Node-RED

This uses the geolib node to check if points fall with in a given region. Points are taken from the first of the following msg properties in this order:

  1. msg.location.lat & msg.location.lon
  2. msg.lat & msg.lon
  3. msg.payload.lat & msg.payload.lon

Region can be circular, rectangular or polygons and are drawn on to a map in the config node.

screenshot of config node

Messages can be filtered depending on if they fall inside or outside the given region or the node can append the node name to a list of areas the msg falls in (to allow the chaining of geofence nodes).

The list is stored in msg.location.isat in the following format:

msg.location: {
    inarea: true,
    isat: [
      'firstArea',
      'secondArea'
    ],
    distances: {
      'firstArea': 100,
      'secondArea': 15
    }
}

And also includes the distance in meters from the centre (or centroid for polygons) of the region.

The config node uses leaflet and openstreetmap data so requires internet access. You can drop back to a non graphical config by replacing geofence.html with geofence-nomap.html

Possible breaking changes moving from version 0.0.x to 0.1.0.

These are arround the "add 'inarea'" mode

  • msg.location.inarea is always a boolean and now just reflects the last geofence node that the message passes through
  • msg.location.distances is now just an object using the name as a key, rather than an array of objects

WorldMap Support

If the check box is ticked then a second output port will be added to the node. The msg output from this port will include the shape of the geofence zone that can be fed directly into a WorldMap node so that it will be drawn on the geofence layer.

This output is triggered by a message with msg.payload.action set to send. This can be initiated by using the WorldMap in node when a new browser connects.