Skip to content

Commit dae0d01

Browse files
authored
Merge pull request #23 from eyeseast/geojson
GeoJSON and SpatiaLite support
2 parents d584442 + 33b8836 commit dae0d01

File tree

7 files changed

+445
-77
lines changed

7 files changed

+445
-77
lines changed

Diff for: .github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.6, 3.7, 3.8, 3.9]
10+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Set up Python ${{ matrix.python-version }}

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ dist/
1717
*.sqlite
1818

1919
.env
20-
.vscode
20+
.vscode
21+
Pipfile
22+
Pipfile.lock

Diff for: Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tests/%.db: tests/innout.geojson tests/innout.csv
66

77
.PHONY: test
88
test: tests/test.db
9-
geocode-sqlite test tests/test.db innout_test -p tests/test.db -l "{id}" -d .1
9+
geocode-sqlite test tests/test.db innout_test -p tests/test.db -l "{id}" -d .1 --spatialite
1010

1111
.PHONY: nominatim
1212
nominatim: tests/nominatim.db
@@ -45,8 +45,8 @@ mapbox: tests/mapbox.db
4545

4646
.PHONY: run
4747
run:
48-
datasette serve tests/*.db
48+
datasette serve tests/*.db --load-extension spatialite
4949

5050
.PHONY: clean
5151
clean:
52-
rm tests/test.db
52+
rm -f tests/test.db

Diff for: README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ Each geocoder needs to know where to find the data it's working with. These are
7373

7474
From there, we have a set of options passed to every geocoder:
7575

76-
- location: a [string format](https://docs.python.org/3/library/stdtypes.html#str.format) that will be expanded with each row to build a full query, to be geocoded
77-
- delay: a delay between each call (some services require this)
78-
- latitude: latitude column name
79-
- longitude: longitude column name
76+
- `location`: a [string format](https://docs.python.org/3/library/stdtypes.html#str.format) that will be expanded with each row to build a full query, to be geocoded
77+
- `delay`: a delay between each call (some services require this)
78+
- `latitude`: latitude column name
79+
- `longitude`: longitude column name
80+
- `geojson`: store results as GeoJSON, instead of in latitude and longitude columns
81+
- `spatialite`: store results in a SpatiaLite geometry column, instead of in latitude and longitude columns
8082

8183
Each geocoder takes additional, specific arguments beyond these, such as API keys. Again, [geopy's documentation](https://geopy.readthedocs.io/en/latest/#module-geopy.geocoders) is an excellent resource.
8284

0 commit comments

Comments
 (0)