You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,30 @@ From there, we have a set of options passed to every geocoder:
84
84
-`longitude`: longitude column name
85
85
-`geojson`: store results as GeoJSON, instead of in latitude and longitude columns
86
86
-`spatialite`: store results in a SpatiaLite geometry column, instead of in latitude and longitude columns
87
+
-`raw`: store raw geocoding results in a JSON column
87
88
88
89
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.
89
90
91
+
## Using SpatiaLite
92
+
93
+
The `--spatialite` flag will store results in a [geometry column](https://www.gaia-gis.it/gaia-sins/spatialite-cookbook-5/cookbook_topics.adminstration.html#topic_TABLE_to_SpatialTable), instead of `latitude` and `longitude` columns. This is useful if you're doing other GIS operations, such as using a [spatial index](https://www.gaia-gis.it/fossil/libspatialite/wiki?name=SpatialIndex). See the [SpatiaLite cookbook](https://www.gaia-gis.it/gaia-sins/spatialite-cookbook-5/index.html) and [functions list](https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html) for more of what's possible.
94
+
95
+
## Capturing additional geocoding data
96
+
97
+
Geocoding services typically return more data than just coordinates. This might include accuracy, normalized addresses or other context. This can be captured using the `--raw` flag. By default, this will add a `raw` column and store the full geocoding response as JSON. If you want to rename that column, pass a value, like `--raw custom_raw`.
98
+
99
+
The shape of this response object will vary between services. You can query specific values using [SQLite's built-in JSON functions](https://www.sqlite.org/json1.html). For example, this will work with Google's geocoder:
100
+
101
+
```sql
102
+
select
103
+
json_extract(raw, '$.formatted_address') as address,
104
+
json_extract(raw, '$.geometry.location_type') as location_type
105
+
from
106
+
innout_test
107
+
```
108
+
109
+
Check each geocoding service's documentation for what's included in the response.
110
+
90
111
## Python API
91
112
92
113
The command line interface aims to support the most common options for each geocoder. For more fine-grained control, use the Python API.
0 commit comments