Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
osm-is-area
Advanced tools
Readme
determine if an OpenStreetMap entry is an area or not.
this package uses osm-polygon-features to determine if some closed ways should be treated as polygons or lines.
var osmIsArea = require('osm-is-area')
// first and last ref match, but { highway: 'service' } is not an area:
console.log(osmIsArea({
type: 'way',
id: 4421943,
tags: { highway: 'service' },
refs: [ 27119458, 1764217171, 27119461, 1069372913,
1764230257, 5530415689, 1764230254, 27119458]
})) // false
// first and last ref match; { waterway: 'riverbank' } is a valid area:
console.log(osmIsArea({
type: 'way',
id: 23873915,
tags: { waterway: 'riverbank' },
refs: [ 3584796914, 4856390070, 4856390069, 4856390067, 258759210, 997025704, 997024369, 3584796914 ]
})) // true
// first and last ref don't match - not a closed way:
console.log(osmIsArea({
type: 'way',
id: 4421935,
tags: { highway: 'primary', surface: 'asphalt' },
refs: [ 746891652, 408306337, 27119389, 1687103099, 730024891, 1035333171, 746891666 ]
})) // false
// first and last ref match; { natural: 'wood' } is a valid area:
console.log(osmIsArea({
type: 'way',
id: 23874706,
tags: { name: 'Щербачевский лес', natural: 'wood' },
refs: [ 1125622707, 1007659859, 1125622501, 1125622605, 1125622588, 1007659898, 1125622707 ]
})) // true
// first and last ref match; { boundary: 'protected area' } is a valid area:
console.log(osmIsArea({
type: 'way',
id: 34333478,
tags: { name: 'Лісовий заказник «Григорівський бір»', boundary: 'protected_area' },
refs: [ 393849373, 1010883354, 1010883623, 393849376, 1010883341, 393849377, 393849373 ]
})) // true
to try this example on your own machine, clone this repository, navigate to the
directory you cloned into, and run npm run example
.
var osmIsArea = require('osm-is-area')
takes an osm entry
object and returns true
or false
.
input osm objects should be formatted as osm-pbf-parser returns them. specifically, this module expects:
'node'
, 'way'
, or 'relation'
the only thing that's relevant about the members
array is whether it's empty
(module will return false
if this is the case).
this module assumes that all relations of type 'multipolygon'
are areas, and
that no other relations are areas. learn more about
relation:multipolygon.
MIT
FAQs
determine if an OpenStreetMap entry is an area or not
The npm package osm-is-area receives a total of 4 weekly downloads. As such, osm-is-area popularity was classified as not popular.
We found that osm-is-area demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.