Command line tool for scraping GeoJSON from ThinkGIS sites
Project description
thinkgisdump
Command line tool for scraping GeoJSON from ThinkGIS sites. Based on pyesridump.
Install
You can install thinkgisdump
using pip with the following command:
pip install thinkgisdump
This will add the script thinkgis2geojson
to your path.
Usage
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.
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.
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size thinkgisdump-0.2.0-py3-none-any.whl (6.2 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size thinkgisdump-0.2.0.tar.gz (5.2 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for thinkgisdump-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 348151fcc98d3bc66129548bcc44844035405823806857bac1c342f3808a8c5d |
|
MD5 | ca68456e3c0cbfa383e3e5f9aeccdf1d |
|
BLAKE2-256 | 276a4898cbf3515aa87a2a78a1f5f4802728c48c577aa39670b254de4698154e |