SVGIS
Create SVG drawings from vector geodata files (SHP, geojson, etc).
SVGIS is great for: creating small multiples, combining lots of datasets in a sensible projection, and drawing styled based on classes in the source data. It's perfect for creating base maps for editing in a drawing program, and its CSS-based styling gives great flexibility for styling.
svgis draw input.shp -o out.svg
svgis draw south_dakota.shp north_dakota.geojson -o dakota.svg
svgis draw england.shp scotland.shp wales.shp --style gb.css -o great_britain.svg
Complete documentation, with more examples and explanation of classes and methods: https://svgis.readthedocs.io/en/stable/
Install
Requires fiona, which in turn requires GDAL.
See the GDAL docs for install info.
Then:
pip install svgis
An optional feature of svgis is clipping polygons to a bounding box. This will speed things up if you need to draw only part of a very complex feature.
pip install 'svgis[clip]'
Commands
The svgis command line tool includes several utilities. The most important is svgis draw, which draws SVG maps based on input geodata layers.
Additional commands:
svgis bounds: get the bounding box for a layer in a given projectionsvgis graticule: create a graticule (grid) within a given boundssvgis project: determine what projectionsvgis drawwill (optionally) generate for given bounding boxsvgis scale: change the scale of an existing SVGsvgis style: add css styles to an existing SVG
Read the docs for complete information on these commands and their options.
Examples
Draw the outline of the contiguous United States, projected in Albers:
curl -O http://www2.census.gov/geo/tiger/GENZ2014/shp/cb_2014_us_nation_20m.zip
unzip cb_2014_us_nation_20m.zip
svgis draw cb_2014_us_nation_20m.shp --crs EPSG:5070 --scale 1000 --bounds -124 20.5 -64 49 -o us.svg
The next two examples use the Natural Earth admin-0 data set.
Draw upper income countries in green, low-income countries in blue:
/* style.css */
.income_grp_5_Low_income {
fill: blue;
}
.income_grp_3_Upper_middle_income {
fill: green
}
.ne_110m_lakes {
fill: #09d;
stroke: none;
}
svgis draw --style style.css --class-fields income_grp ne_110m_admin_0_countries.shp ne_110m_lakes.shp -o out.svg
Draw national boundaries and lakes in Europe using the LAEA Europe projection, simplifying the output polygons, and coloring Germany in purple.
svgis draw ne_110m_admin_0_countries.shp ne_110m_lakes.shp \
--crs EPSG:3035 \
--scale 1000 \
--simplify 90 \
--style '.ne_110m_admin_0_countries { fill: tan } #Germany { fill: purple }' \
--style '.ne_110m_lakes { fill: #09d; stroke: none; }' \
--id-field name \
--bounds -10 30 40 65 \
-o out.svg
Metadata
Release files for svgis 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| svgis-0.6.0.tar.gz | 864.2 kB | Without provenance | Details for svgis-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| svgis-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for svgis-0.6.0-py3-none-any.whl |
Total release size: 904.8 kB
Release files / svgis-0.6.0.tar.gz
| Download URL | svgis-0.6.0.tar.gz |
|---|---|
| Size | 864.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad52812ca1754b0e799b4a8d432e1865126e3b94eb2aaf9d49a71a64610a1866
|
|
BLAKE2b-256 checksum How to use checksums |
16a70a71b356a2383dd8303889ae4d986aaf84acc8e093d6a21d924429be698f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Release files / svgis-0.6.0-py3-none-any.whl
| Download URL | svgis-0.6.0-py3-none-any.whl |
|---|---|
| Size | 40.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a63e3b404d8ef6788ad1742d8e2266a708739bfe8e88db7eae763fad5323ce3d
|
|
BLAKE2b-256 checksum How to use checksums |
90d4e950d14ee437a207889d10f1ae8e26906313d530da434d1d907e1792d3f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.5
|
Security for svgis 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.