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.
@webgeodatavore/geojson.terminator
Advanced tools
Readme
Create a GeoJSON of overlay day and night regions. It's derivated from Leaflet-Terminator project
You can see a demo in action using OpenLayers
It generates a 'pseudo-GeoJSON'.
Coordinates longitude range go from -360 to 360 whereas it should be -180, + 180
API like OpenLayers or Leaflet can consume this GeoJSON although it's invalid from the GeoJSON spec viewpoint.
If you need a valid GeoJSON in another context, you may use something like GDAL/OGR to clip GeoJSON to a valid range with:
ogr2ogr -f "GeoJSON" output.geojson input.geojson \
-clipsrc -180 90 180 90
var geoJSON = new GeoJSONTerminator();
var timeLayer = new ol.layer.Vector({
source: new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(geoJSON, {
featureProjection: 'EPSG:3857'
})
}),
style: new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgb(0, 0, 0)'
}),
stroke: null
}),
opacity: 0.5
});
map.addLayer(timeLayer);
// At the beginning
import VectorLayer from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
import GeoJSON from 'ol/format/GeoJSON';
import Style from 'ol/style/Style';
import Stroke from 'ol/style/Stroke';
import Fill from 'ol/style/Fill';
import GeoJSONTerminator from "@webgeodatavore/geojson.terminator";
// Then after map instanciation
const geoJSON = new GeoJSONTerminator();
const timeLayer = new VectorLayer({
source: new VectorSource({
features: (new GeoJSON()).readFeatures(geoJSON, {
featureProjection: 'EPSG:3857'
})
}),
style: new Style({
fill: new Fill({
color: 'rgb(0, 0, 0)'
}),
stroke: null
}),
opacity: 0.5
});
map.addLayer(timeLayer);
FAQs
GeoJSON Night and day regions on Earth
The npm package @webgeodatavore/geojson.terminator receives a total of 408 weekly downloads. As such, @webgeodatavore/geojson.terminator popularity was classified as not popular.
We found that @webgeodatavore/geojson.terminator 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.