https://github.com/pjsier/thinkgisdump
Command line tool for scraping GeoJSON from ThinkGIS sites
https://github.com/pjsier/thinkgisdump
cli gis scraping
Last synced: 5 months ago
JSON representation
Command line tool for scraping GeoJSON from ThinkGIS sites
- Host: GitHub
- URL: https://github.com/pjsier/thinkgisdump
- Owner: pjsier
- License: mit
- Created: 2020-12-14T01:05:20.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T14:19:00.000Z (over 2 years ago)
- Last Synced: 2025-08-20T02:18:53.300Z (10 months ago)
- Topics: cli, gis, scraping
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thinkgisdump
[](https://github.com/pjsier/thinkgisdump/actions)

Command line tool for scraping GeoJSON from [ThinkGIS](https://www.wthgis.com/) sites. Based on [pyesridump](https://github.com/openaddresses/pyesridump).
## Install
You can install `thinkgisdump` using pip with the following command:
```shell
pip install thinkgisdump
```
This will add the script `thinkgis2geojson` to your path.
## Usage
```shell
usage: thinkgis2geojson [-h] [-l LAYER_ID] [-o OUTPUT] [-q QUIET] url
Scrape GeoJSON from ThinkGIS sites
positional arguments:
url ThinkGIS server URL, layer ID will be parsed from the dsid query param if present
optional arguments:
-h, --help show this help message and exit
-l LAYER_ID, --layer-id LAYER_ID
Layer ID (in the dsid query param) to be scraped
-o OUTPUT, --output OUTPUT
Output file name, defaults to stdout
-q QUIET, --quiet QUIET
Suppress logging of feature requests
```
Because of the defaults and setting the layer ID based on query params, the following two command are equivalent.
```shell
thinkgis2geojson https://richlandil.wthgis.com --layer-id 1283 -o richland-precincts.geojson
thinkgis2geojson 'https://richlandil.wthgis.com?dsid=1283' > richland-precincts.geojson
```
## Notes
To get the parameters you'll need to scrape a given ThinkGIS layer, you can open the "Index" section on a map page. On the map index panel that opens up, you can open developer tools to see the full URL of the link for the layer you're interested in. The layer ID will be in the `dsid` parameter. You can also use this full URL including the query parameter in the `url` argument and it will be used without supplying `--layer-id` separately.
ThinkGIS returns point and multipoint geometries as polygon circles. When these are encountered, the mean point of the circle is used to create a point or multipoint GeoJSON geometry. Line shapes are also returned as polygons, and currently these are returned as polygons without further transformation.