|
| 1 | +# geocoder |
| 2 | + |
| 3 | +```julia |
| 4 | +D = geocoder(address::String; options=String[]) |
| 5 | +``` |
| 6 | + |
| 7 | +Get the geocoder info for a given address by calling the GDAL/OGR |
| 8 | +[geocoding functions](https://gdal.org/doxygen/ogr__geocoding_8h.html). |
| 9 | + |
| 10 | +### Arguments |
| 11 | +- `address`: The string to geocode. |
| 12 | + |
| 13 | +- `options`: These are the options passed to GDAL and in the form of a vector of strings. For example, |
| 14 | + the default is equivalent to `options=["SERVICE", "OSM_NOMINATIM"]`. |
| 15 | + - ``"CACHE_FILE"`` : Defaults to ``"ogr_geocode_cache.sqlite"`` (or otherwise ``"ogr_geocode_cache.csv"`` if the |
| 16 | + SQLite driver isn't available). Might be any CSV, SQLite or PostgreSQL datasource. |
| 17 | + - ``"READ_CACHE"`` : ``"TRUE"`` (default) or "FALSE" |
| 18 | + - ``"WRITE_CACHE"`` : ``"TRUE"`` (default) or "FALSE" |
| 19 | + - ``"SERVICE"``: ``"OSM_NOMINATIM"`` (default), ``"MAPQUEST_NOMINATIM"``, ``"YAHOO"``, ``"GEONAMES"``, |
| 20 | + ``"BING"`` or other value. |
| 21 | + Note: ``"YAHOO"`` is no longer available as a free service. |
| 22 | + - ``"EMAIL"``: used by ``"OSM_NOMINATIM"``. Optional, but recommended. |
| 23 | + - ``"USERNAME"``: used by ``"GEONAMES"``. Compulsory in that case. |
| 24 | + - ``"KEY"``: used by BING. Compulsory in that case. |
| 25 | + - ``"APPLICATION"``: used to set the User-Agent MIME header. Defaults to GDAL/OGR version string. |
| 26 | + - ``"LANGUAGE"``: used to set the Accept-Language MIME header. Preferred language order for showing search results. |
| 27 | + - ``"DELAY"``: minimum delay, in second, between 2 consecutive queries. Defaults to 1.0. |
| 28 | + - ``"QUERY_TEMPLATE"``: URL template for GET requests. Must contain one and only one occurrence of %s in it. |
| 29 | + If not specified, for ``["SERVICE", "OSM_NOMINATIM"]``, ``"MAPQUEST_NOMINATIM"``, ``"YAHOO"``, ``"GEONAMES"`` |
| 30 | + or ``"BING"``, the URL template is hard-coded. |
| 31 | + - ``"REVERSE_QUERY_TEMPLATE"``: URL template for GET requests for reverse geocoding. Must contain one and only |
| 32 | + one occurrence of {lon} and {lat} in it. If not specified, for ``["SERVICE", "OSM_NOMINATIM"]``, |
| 33 | + ``"MAPQUEST_NOMINATIM"``, ``"YAHOO"``, ``"GEONAMES"`` or ``"BING"``, the URL template is hard-coded. |
| 34 | + |
| 35 | + |
| 36 | +Returns |
| 37 | +------- |
| 38 | +A \myreflink{GMTdataset} with the longitude, latitude, and full attribute dictionary returned by the geocoder for |
| 39 | +the input address. This dataset contains only one point but geocoding service resturns also a BoundingBox |
| 40 | +containing that point. When the `address` is very specific that BB is tiny arround the point, but when the |
| 41 | +query is general (for example,just the name of a city or even a country), the BB is large and may be very |
| 42 | +useful to use in the `mosaic` program. For that purpose, the returned BB is sored in the \myreflink{GMTdatset} |
| 43 | +``ds_bbox`` field. |
| 44 | + |
| 45 | +Examples |
| 46 | +-------- |
| 47 | + |
| 48 | +```julia |
| 49 | + geocoder("Paris, France") |
| 50 | +``` |
| 51 | + |
| 52 | +See Also |
| 53 | +-------- |
| 54 | + |
| 55 | +\myreflink{mosaic} |
0 commit comments