All Projects → paulojraposo → FlowMaps

paulojraposo / FlowMaps

Licence: MIT license
No description or website provided.

Programming Languages

QML
638 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to FlowMaps

gridviz
visualization of gridded statistics
Stars: ✭ 108 (+730.77%)
Mutual labels:  mapping, cartography, gis
Mapnik
Mapnik is an open source toolkit for developing mapping applications
Stars: ✭ 3,067 (+23492.31%)
Mutual labels:  mapping, cartography, gis
awesome-maps-ukraine
A curated list of maps of Ukraine, ukrainian mappers and tools that they use or develop for creating and publish maps
Stars: ✭ 35 (+169.23%)
Mutual labels:  mapping, cartography, gis
openstreetmap-americana
A quintessentially American map style
Stars: ✭ 89 (+584.62%)
Mutual labels:  mapping, cartography
QGIS-visualization-workshop
QGIS visualization workshop materials.
Stars: ✭ 46 (+253.85%)
Mutual labels:  cartography, gis
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (+46.15%)
Mutual labels:  mapping, gis
Simple Tiles
Simple tile generation for maps.
Stars: ✭ 106 (+715.38%)
Mutual labels:  mapping, gis
CesiumJsFirstPersonCameraController
cesiumgis.com/
Stars: ✭ 20 (+53.85%)
Mutual labels:  mapping, gis
EOmaps
A library to create interactive maps of geographical datasets
Stars: ✭ 193 (+1384.62%)
Mutual labels:  mapping, gis
geog4572
Geovisual Analytics @ Oregon State University
Stars: ✭ 67 (+415.38%)
Mutual labels:  cartography, gis
GMT.jl
Generic Mapping Tools Library Wrapper for Julia
Stars: ✭ 148 (+1038.46%)
Mutual labels:  mapping, gis
Contextily
Context geo-tiles in Python
Stars: ✭ 254 (+1853.85%)
Mutual labels:  mapping, cartography
geologic-symbols-qgis
Geologic symbols library and development for QGIS
Stars: ✭ 63 (+384.62%)
Mutual labels:  mapping, gis
leafmap
A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment
Stars: ✭ 1,299 (+9892.31%)
Mutual labels:  mapping, gis
earthengine-apps
A collection of Earth Engine Apps created using geemap, voila, and heroku
Stars: ✭ 20 (+53.85%)
Mutual labels:  mapping, gis
Azuremapscodesamples
A set of code samples for the Azure Maps web control.
Stars: ✭ 167 (+1184.62%)
Mutual labels:  mapping, gis
earthwyrm
Vector tile map server for openstreetmap data
Stars: ✭ 16 (+23.08%)
Mutual labels:  cartography, gis
Magrit
♠ Thematic cartography ♠
Stars: ✭ 60 (+361.54%)
Mutual labels:  mapping, cartography
Editor
An open source visual editor for the 'Mapbox Style Specification'
Stars: ✭ 1,167 (+8876.92%)
Mutual labels:  mapping, cartography
CesiumJs3DTileServer
cesiumgis.com/
Stars: ✭ 25 (+92.31%)
Mutual labels:  mapping, gis

FlowMaps


The basemap used above from NaturalEarthData.com.


Flows drawn for an azimuthal projection centered on Toronto.

This Python script makes flow maps using mathematical interpolations between a start and an end point in a given map projection. The script takes one input file, being a CSV table of flows. It produces one output file in shapefile, geojson, kml, gml, or gmt format. For thorough usage information, please use the help flag from the command line:

python InterpolatedFlowMaps.py -h

Please note that the input CSV file must be in the format of the example below. The headers seen below, named exactly as seen, must be present and unique in the input file. Any other headers and fields may also exist, and will be copied to the output features as text fields. Sequencing of the headers does not matter. Strings throughout may be enclosed in double quotes. FlowMag values must be integer or decimal numbers. To use textual magnitude data, such as strings like "high" or "low," simply use some other unique column to store these data in---they will be copied to the output file.

All given coordinate values must be latitude and longitude in WGS84.

Example CSV:

OrigName,OrigLat,OrigLon,DestName,DestLat,DestLon,FlowMag
Ponta Delgada,37.7483018179,-25.6665834976,Lisbon,38.7227228779,-9.1448663055,6013
Ponta Delgada,37.7483018179,-25.6665834976,Los Angeles,33.9899782502,-118.179980511,1661
Ponta Delgada,37.7483018179,-25.6665834976,Coimbra,40.2003743683,-8.41668034,2259
Ponta Delgada,37.7483018179,-25.6665834976,Christchurch,-43.5350313123,172.630020711,4656
Ponta Delgada,37.7483018179,-25.6665834976,Toronto,43.6999798778,-79.4200207944,584
Ponta Delgada,37.7483018179,-25.6665834976,Kyoto,35.0299922882,135.749997924,282
Ponta Delgada,37.7483018179,-25.6665834976,Yokohama,35.3200262645,139.58004838,6985
Ponta Delgada,37.7483018179,-25.6665834976,Durban,-29.8650130017,30.9800105374,4981
Ponta Delgada,37.7483018179,-25.6665834976,Knoxville,35.9700124298,-83.9200303566,1235

Dependencies

  • scipy
  • gdal
  • shapely
  • pyproj

Getting Started

  1. Download the InterpolatedFlowMaps.py and testdata.csv files from this repository.
  2. I recommend using Anaconda as a Python package manager. Install Anaconda (or Miniconda). If you've already got it, skip this step. See https://www.anaconda.com/distribution/.
  3. In a terminal, create a conda environment called tryflows with the necessary packages:
    conda create -n tryflows python=3 scipy gdal shapely pyproj
  4. Activate your conda environment:
    conda activate tryflows
  5. Navigate to the folder where you’ve downloaded the .py file, e.g.,
    Linux, Mac, Unix-like systems: cd /home/MyName/Downloads
    Windows: cd C:\Users\MyName\Downloads
  6. Use your Anaconda Python environment to run the file, asking for the detailed help documentation:
    python InterpolatedFlowMaps.py -h
  7. Run the script on the provided demo data:
    python InterpolatedFlowMaps.py testdata.csv testdata.shp

The script produces just the skeletal polylines for the flows. Once you have those, use your favorite GIS (e.g., QGIS at https://qgis.org) to symbolize them, for example by drawing line or arrow widths according to the FlowMag attribute, as in the image at top.

The provided QML file can help you get started with symbolizing your flow lines in QGIS 3. It defines a classification scheme based on testdata.csv, some colors, a layer rendering order that draws flows with smaller FlowMag values on top of those with larger, a drop shadow, and an arrow size definition based on fractions of the FlowMag attribute (i.e., arrow end width, head width, and head length are each defined with an SQL-like statement dividing the value of FlowMag by the arbitrary value of 300). You'll almost certainly have to change the values for the class breaks and the symbol drawing and scaling parameters in the QGIS Layer Properties window to choices that fit your own data and map, but you can start by adjusting the values given in the QML file, after loading it using the menu option illustrated below.


Usage and Citation

If you make maps with this, I'd love to hear about it ([email protected]). If you're using this in an academic setting, please cite the presentation where it was first published:

Raposo, P. (2017). Open-Source Flow Maps with Cubic Splines. Presented at the North American Cartographic Information Society (NACIS) Annual Meeting, Montreal, Canada.

For more along these lines (get it?), see Anita Graser's excellent blog, https://anitagraser.com, where she's frequently discussed flow maps and how to make them in QGIS. Other stuff by me can be found on my website.

Thanks for your interest!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].