forked from geocompx/geocompy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preface.qmd
106 lines (92 loc) · 7.66 KB
/
preface.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Preface {.unnumbered}
**Geocomputation with Python** (*geocompy*) is motivated by the need for an introductory, yet rigorous and up-to-date, resource for working with geographic data with the most popular programming language in the world.
A unique selling point of the book is its cohesive and joined-up coverage of *both vector and raster* geographic data models and consistent learning curve.
We aim to *minimize surprises*, with each section and chapter building on the previous.
If you're just starting out with Python for working with geographic data, this book is an excellent place to start.
There are many resources on Python on 'GeoPython' but none that fill this need for an introductory resource that provides strong foundations for future work.
We want to avoid reinventing the wheel and provide something that fills an 'ecological niche' in the wider free and open source software for geospatial (FOSS4G) ecosystem.
Key features include:
1. Doing basic operations well
2. Integration of vector and raster datasets operations
3. Clear explanation of each line of code in the book to minimize surprises
4. Exercises at the end of each chapter with reproducible and open solutions
5. Provision of lucid example datasets and meaningful operations to illustrate the applied nature of geographic research
This book is complementary with, and adds value to, other projects in the ecosystem, as highlighted in the following comparison between *Geocomputation with Python* and related GeoPython books:
- [Learning Geospatial Analysis with Python](https://www.packtpub.com/product/learning-geospatial-analysis-with-python/9781783281138) and [Geoprocessing with Python](https://www.manning.com/books/geoprocessing-with-python) are books in this space that focus on processing spatial data using low-level Python interfaces for GDAL, such as the **gdal**, **gdalnumeric**, and **ogr** [packages](https://gdal.org/api/python_bindings.html) from **osgeo**. This approach requires writing more lines of code. We believe our approach is more ["Pythonic"](https://rasterio.readthedocs.io/en/latest/intro.html#philosophy) and future-proof, in light of development of packages such as **geopandas** and **rasterio**.
- [Introduction to Python for Geographic Data Analysis](https://pythongis.org/) (in progress) seeks to provide a general introduction to 'GIS in Python', with parts focusing on Python essentials, using Python with GIS, and case studies. Compared with this book, which is also open source, and is hosted at pythongis.org, *Geocomputation with Python* has a narrower scope (not covering [spatial network analysis](https://pythongis.org/part3/chapter-11/index.html), for example) and more coverage of raster data processing and raster-vector interoperability.
- [Geographic Data Science with Python](https://geographicdata.science/book/intro.html) is an ambitious project with chapters dedicated to advanced topics, with Chapter 4 on [Spatial Weights](https://geographicdata.science/book/notebooks/04_spatial_weights.html) getting into complex topics relatively early, for example.
- [Python for Geospatial Data Analysis](https://www.oreilly.com/library/view/python-for-geospatial/9781098104788/) introduces a wide range of approaches to working with geospatial data using Python, including automation of proprietary and open-source GIS software, as well as standalone open source Python packages (which is what we focus on and explain comprehensively in our book). Geocompy is shorter, simpler and more introductory, and cover raster and vector data with equal importance.
Another unique feature of the book is that it is part of a wider community.
*Geocomputation with Python* is a sister project of [Geocomputation with R](https://r.geocompx.org/), a book on geographic data analysis, visualization, and modeling using the R programming language that has 60+ contributors and an active community, not least in the associated [Discord group](https://discord.gg/PMztXYgNxp).
Links with the vibrant 'R-spatial' community, and other communities such as [GeoRust](https://georust.org/) and [JuliaGeo](https://juliageo.org/), lead to many opportunities for mutual benefit across open source ecosystems.
## Code and sample data
To run the code examples, you can [download](https://github.com/geocompx/geocompy/zipball/master) the ZIP file of the GitHub [repository](https://github.com/geocompx/geocompy/). In the ZIP file, the `ipynb` directory contains the source files of the chapters in Jupyter Notebook format, the `data` directory contains the sample data files, and the `output` directory contains the files created in code examples (some of which are also used as inputs in other code sections). Place them together as follows to run the code:
```text
├── data
│ ├── aut.tif
│ ├── ch.tif
│ ├── coffee_data.csv
│ ├── cycle_hire.gpkg
│ ├── cycle_hire_osm.gpkg
│ ├── cycle_hire_xy.csv
│ ├── dem.tif
│ ├── landsat.tif
│ ├── nlcd.tif
│ ├── nz_elev.tif
│ ├── nz.gpkg
│ ├── nz_height.gpkg
│ ├── seine.gpkg
│ ├── srtm.tif
│ ├── us_states.gpkg
│ ├── world.gpkg
│ ├── world_wkt.csv
│ ├── zion.gpkg
│ └── zion_points.gpkg
├── output
│ ├── cycle_hire_xy.csv
│ ├── dem_agg5.tif
│ ├── dem_contour.gpkg
│ ├── dem_resample_maximum.tif
│ ├── dem_resample_nearest.tif
│ ├── elev.tif
│ ├── grain.tif
│ ├── map.html
│ ├── ne_10m_airports.cpg
│ ├── ne_10m_airports.dbf
│ ├── ne_10m_airports.prj
│ ├── ne_10m_airports.README.html
│ ├── ne_10m_airports.shp
│ ├── ne_10m_airports.shx
│ ├── ne_10m_airports.VERSION.txt
│ ├── ne_10m_airports.zip
│ ├── nlcd_4326_2.tif
│ ├── nlcd_4326.tif
│ ├── nlcd_modified_crs.tif
│ ├── plot_geopandas.jpg
│ ├── plot_rasterio2.svg
│ ├── plot_rasterio.jpg
│ ├── r3.tif
│ ├── r_nodata_float.tif
│ ├── r_nodata_int.tif
│ ├── r.tif
│ ├── srtm_32612_aspect.tif
│ ├── srtm_32612_slope.tif
│ ├── srtm_32612.tif
│ ├── srtm_masked_cropped.tif
│ ├── srtm_masked.tif
│ ├── w_many_features.gpkg
│ ├── w_many_layers.gpkg
│ └── world.gpkg
├── 01-spatial-data.qmd
├── 02-attribute-operations.qmd
├── 03-spatial-operations.qmd
├── 04-geometry-operations.qmd
├── 05-raster-vector.qmd
├── 06-reproj.qmd
├── 07-read-write.qmd
└── 08-mapping.qmd
```
## Acknowlegements
We acknowledge Robin Lovelace, Jakub Nowosad, and Jannes Muenchow---authors of [Geocomputation with R](https://r.geocompx.org/) (Robin and Jakub also author the present book), a book on the same topic for a different programming language (R). The structure, topics, and most of the theoretical discussions were adapted from that earlier publication.
We thank the authors of the Python language, and the authors of the **shapely**, **pandas**, **geopandas**, and **rasterio** packages which are used extensively in the book, for building these wonderful tools.
We acknowledge of GitHub users [Will Deakin](https://github.com/anisotropi4), [Sean Gillies](https://github.com/sgillies), [Josh Cole](https://github.com/JoshCole-DTA), and [Jt Miclat](https://github.com/jtmiclat) (at the time of writing; full list [here](https://github.com/geocompx/geocompy/graphs/contributors)) for their contributions during the open-source development of the book.