Draw geodata in SVG
Project description
SVGIS
-----
Create SVG drawings from vector geodata files (SHP, geoJSON, etc).
SVGIS is good for: creating small multiples, combining lots of datasets
in a sensible projections, and drawing maps with basic styles based on
classes in the source data.
.. code:: bash
svgis draw input.shp -o out.svg
svgis draw --project utm south_dakota.shp north_dakota.geojson -o dakota.svg
svgis draw --style my.css england.shp scotland.shp wales.shp -o great_britain.svg
Documentation: http://pythonhosted.org/svgis
Install
-------
Requires `fiona <http://pypi.python.org/pypi/fiona>`__, which in turn
requires GDAL.
Before installing, run the following on OS X: ``brew install gdal``. On
Linux: ``sudo apt-get -qq install libgdal1-dev``.
Then:
::
pip install svgis
An additional feature is available if you want to download more
prerequisites:
::
# Clip output shapes to the bounding box (smaller files)
brew install geos # os x
sudo yum/apt-get geos # linux
pip install svgis[clip]
Command line tools
------------------
The ``svgis`` command line tool has four commands: ``draw``,
``project``, ``scale`` and ``style``. ``svgis scale`` and
``svgis style`` will add a scaling factor or CSS style to an existing
SVG file. ``svgis project`` is a utility for determining what projection
``svgis draw`` will (optionally) generate for given bounding boxes. 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 --project EPSG:5070 --scale 1000 --bounds -124 20.5 -64 49 cb_2014_us_nation_20m.shp -o us.svg
The next two examples use the `Natural
Earth <http://naturalearthdata.com>`__ 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
}
::
svgis draw --style style.css --class-fields income_grp ne_110m_admin_0_countries.shp -o out.svg
Draw national boundaries in the Europe using an `Albers
projection <http://epsg.io/102013>`__, simplifying the output polygons,
and draw Germany in purple.
\`\ ``svgis draw \ --project EPSG:102013 \ --scale 1000 \ --simplify 0.10 \ --style "#Germany { fill: purple }" \ --id-field name \ --bounds -10 30 40 65 \ ne_110m_admin_0_countries.shp \ -o out.svg``
-----
Create SVG drawings from vector geodata files (SHP, geoJSON, etc).
SVGIS is good for: creating small multiples, combining lots of datasets
in a sensible projections, and drawing maps with basic styles based on
classes in the source data.
.. code:: bash
svgis draw input.shp -o out.svg
svgis draw --project utm south_dakota.shp north_dakota.geojson -o dakota.svg
svgis draw --style my.css england.shp scotland.shp wales.shp -o great_britain.svg
Documentation: http://pythonhosted.org/svgis
Install
-------
Requires `fiona <http://pypi.python.org/pypi/fiona>`__, which in turn
requires GDAL.
Before installing, run the following on OS X: ``brew install gdal``. On
Linux: ``sudo apt-get -qq install libgdal1-dev``.
Then:
::
pip install svgis
An additional feature is available if you want to download more
prerequisites:
::
# Clip output shapes to the bounding box (smaller files)
brew install geos # os x
sudo yum/apt-get geos # linux
pip install svgis[clip]
Command line tools
------------------
The ``svgis`` command line tool has four commands: ``draw``,
``project``, ``scale`` and ``style``. ``svgis scale`` and
``svgis style`` will add a scaling factor or CSS style to an existing
SVG file. ``svgis project`` is a utility for determining what projection
``svgis draw`` will (optionally) generate for given bounding boxes. 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 --project EPSG:5070 --scale 1000 --bounds -124 20.5 -64 49 cb_2014_us_nation_20m.shp -o us.svg
The next two examples use the `Natural
Earth <http://naturalearthdata.com>`__ 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
}
::
svgis draw --style style.css --class-fields income_grp ne_110m_admin_0_countries.shp -o out.svg
Draw national boundaries in the Europe using an `Albers
projection <http://epsg.io/102013>`__, simplifying the output polygons,
and draw Germany in purple.
\`\ ``svgis draw \ --project EPSG:102013 \ --scale 1000 \ --simplify 0.10 \ --style "#Germany { fill: purple }" \ --id-field name \ --bounds -10 30 40 65 \ ne_110m_admin_0_countries.shp \ -o out.svg``
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
svgis-0.3.3.tar.gz
(23.4 kB
view details)
Built Distributions
svgis-0.3.3-py3-none-any.whl
(23.9 kB
view details)
svgis-0.3.3-py2-none-any.whl
(23.9 kB
view details)
File details
Details for the file svgis-0.3.3.tar.gz
.
File metadata
- Download URL: svgis-0.3.3.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1306d6306845d003f8e9489f0be8a7709bfa134ef8339ad72bede06c2224c20 |
|
MD5 | 2ca36d1fbc642d1b74f0d9c7e7867099 |
|
BLAKE2b-256 | 4e5db0f27165678be13aba27d19f28aa12a8e63a1ca7d90736bc34c73bdac981 |
File details
Details for the file svgis-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: svgis-0.3.3-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dad1d283bfe053f34f020c720769a65bc178f1533d709638c046b23350e0da75 |
|
MD5 | 936d87bc1ad0aef74c516be24c686e1f |
|
BLAKE2b-256 | 937916b8fc2e1e54fff87fdf2ce7f59abc6b212367e315241a8b1c1a36f7f093 |
File details
Details for the file svgis-0.3.3-py2-none-any.whl
.
File metadata
- Download URL: svgis-0.3.3-py2-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 958d8576e9085be049069ddd7810cdace319e04c28127ab3bf0d4d72da71192b |
|
MD5 | c14f9f6541b501b59c7b662b96753e47 |
|
BLAKE2b-256 | dc09ab97bcc291f0ebcd9071f199eb73038e07968b07565d8a2db8d6d0b2190e |