After a year of normal use by external parties, a few desired features have been mentioned to me in person, as well as in the form of commentary on github and google groups.
This document provides a proposal for various features that aim to satisfy a majority of these use cases and concerns while mitigating backwards incompatibilities as much as possible.
## Sub Packages ### GeocodersThe geocoders
package will be used to contain all supported Geocoder
implementations. The aim of this package is to provide a default set of Geocoder
s that make the other functionality provided by Point
to be interesting and useful "right-out-of-the-box" for a majority of use cases.
Pull Requests to implement new Geocoder
s are welcome, but not required to work with the library. Much in the spirit of mymysql
and libpq
in relation to golang's database/sql
package; other Geocoder
implementations can be made outside of the library and pulled in with an import
statement.
There will be three default supported Geocoder
s upon the release of 1.0.0
:
- Google Geocoder
- Mapquest Geocoder
- Opencage Geocoder
There will be one supported Indexer
upon the release of 1.0.0
:
MySQLIndexer
(previously known asSQLMapper
)
## API Changes ### Point
The following parts of the Point
in this library will be changed wit the release of 1.0.0
:
- Lat: Previously unexported as
lat
, this field will now be exported. - Lng: Previously unexported as
lng
, this field will now be exported.
The following illustrates the proposed changes Geocoders
will receive with the release of 1.0.0
:
Geocode(string) ([]Point, error)
:Geocoder
s will now return a slice ofPoint
or anerror
when geocoding.- Previously, Geocode would only ever return the first point from the response endpoint. This would return all points.
ReverseGeocode(*Point) ([]string, err)
:Geocoder
s will now return a slice ofstring
or anerror
when reverse geocoding.- Previously, ReverseGeocode would only ever return the first address from the response endpoint. This would return all addresses.