Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
|BuildStatus|_
rasterstats
is a Python module for summarizing geospatial raster datasets based on vector geometries.
It includes functions for zonal statistics and interpolated point queries. The command-line interface allows for
easy interoperability with other GeoJSON tools.
For details on installation and usage, visit the documentation at http://pythonhosted.org/rasterstats <http://pythonhosted.org/rasterstats/>
_.
Given a vector layer and a raster band, calculate the summary statistics of each vector geometry. For example, with a polygon vector layer and a digital elevation model (DEM) raster, compute the mean elevation of each polygon.
.. figure:: https://github.com/perrygeo/python-raster-stats/raw/master/docs/img/zones_elevation.png :align: center :alt: zones elevation
The command line interfaces to zonalstats and point_query
are rio
subcommands which read and write geojson features
.. code-block:: bash
$ fio cat polygon.shp | rio zonalstats -r elevation.tif
$ fio cat points.shp | rio pointquery -r elevation.tif
See the CLI Docs <http://pythonhosted.org/rasterstats/cli.html>
_. for more detail.
For zonal statistics
.. code-block:: python
>>> from rasterstats import zonal_stats
>>> stats = zonal_stats("tests/data/polygons.shp", "tests/data/slope.tif")
>>> stats[0].keys()
dict_keys(['min', 'max', 'mean', 'count'])
>>> [f['mean'] for f in stats]
[14.660084635416666, 56.60576171875]
and for point queries
.. code-block:: python
>>> from rasterstats import point_query
>>> point = {'type': 'Point', 'coordinates': (245309.0, 1000064.0)}
>>> point_query(point, "tests/data/slope.tif")
[74.09817594635244]
Find a bug? Report it via github issues by providing
.. |BuildStatus| image:: https://github.com/perrygeo/python-rasterstats/workflows/Rasterstats%20Python%20package/badge.svg .. _BuildStatus: https://github.com/perrygeo/python-rasterstats/actions
FAQs
Summarize geospatial raster datasets based on vector geometries
We found that rasterstats demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.