jifalops / geo-codec

An element to perform geocoding and reverse geocoding using the Google maps API.
MIT License
3 stars 1 forks source link

Existing geocode function is unusable #1

Open sshikov opened 7 years ago

sshikov commented 7 years ago

Geocoder shoud be able to process multiple results of address->coordinates geocoding, filter candidates by address type, location type, order by some quality criteria.

Filtering and sorting should be customizable.

It will be freat if geocode provider will be also customizable, i.e. not Google Maps only, but OpenStreetMap, Yandex, etc, etc.

jifalops commented 7 years ago

It currently only handles one operation at a time by design. Processing of aggregate results is highly dependent on end users' needs and isn't something I plan on implementing at this time.

Being compatible with other providers is something I need to look into. Do you know if the APIs are similar?

sshikov commented 7 years ago

You can just add one or two functions for results processing, like existing onComplete.

sshikov commented 7 years ago

I know about yandex maps geocoding API in detail, and about Esri (ArcGIS). They are all similar to each other.

sshikov commented 7 years ago

Only difference in general is returned JSON structure - i.e. object and field names.

sshikov commented 7 years ago

Just for example: to geocode street address, we can ask google/arcgis/yandex/openstreetmap, filter results by quality (remove results like city/region, not street with buiding number), order by quality, and if we still have more that 1 result, return 1st one - as you have implemented right now.

If you don't do filtering at all - list of candidates could be used to show suggestions. I.e. this is just another use case for the same code.