Code Monkey home page Code Monkey logo

geocoder's People

Contributors

andrea-cristaudo avatar antoinelemaire avatar arubacao avatar atymic avatar baachi avatar chris53897 avatar dependabot[bot] avatar gelolabs avatar giosh94mhz avatar gpirrotta avatar gyndav avatar havvg avatar jbelien avatar jsor avatar kornrunner avatar makasim avatar mtmail avatar norkunas avatar nyholm avatar ollietb avatar pyrech avatar ronanguilloux avatar stadly avatar svrdlic avatar themouette avatar toin0u avatar vicchi avatar warmans avatar willdurand avatar xabbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geocoder's Issues

Would you be willing to dual license MIT / GPL?

Hi,

I'm one of the maintainers for the geocoder module for Drupal (an open-source content-management system). You can see the module page here: http://drupal.org/project/geocoder

We'd like to make extensive of your awesome Geocoder library in our project. Ideally we would like to distribute it packaged with our module, but given that Drupal is licensed under the GPLv2 and Geocoder library is licensed as MIT that is not currently possible. Would you be willing to dual-license your project as both GPLv2 and MIT? This would allow us to legally distribute it with our module.

FYI, jQuery is also dual-licensed MIT and GPLv2 (http://jquery.org/license/) so that it can be legally shipped with GPL projects.

Thank you for your consideration,

~Patrick Hayes

Refactoring providers

I'm not really fan of my implementation of providers, especially since reverse geocoding has been added.

Unable To Retrieve Location from Lat , Long

Hello,

I'm trying to retrieve locations using latitude and longitude, but am currently receiving null.
I thought it might be to-do with some wrong lat & long coordinates, but I'm using the coordinates in the example of http://geocoder-php.org/ (top of the page), and am still receiving null.

So I've tried this
$result = $geocoder->reverse(44.9817,-93.2783);
//
and this
$result = $geocoder->geocode(44.9817,-93.2783);

I've also tried wrapping the coordinates in speech marks/apostrophes, to apply coordinates as strings.

I can however retrieve the location with an IP, using the example;
$result = $geocoder->geocode('68.145.37.34');

Seperate to GeocoderIp and GeocoderAddress

Hello,

First I'm glad to see this project!

But I think I makes sense to seperate the two options "Geocode by Ip" and "Geocode by Address".

ATM there is only $geocoder->geocode($value)

Add a result object

The ->geocode() method should return an object, which implements the ArrayAccessInterface and has two methods : fromArray(), toArray().

We can name this object Result\Geocoded and we can do the same for the reverse() method (Result\Reversed).

There is nothing to invent as we just have to move the code in the `Geocoder class.

cc @themouette

William

OpenStreetMapsProvider - Error

If $searchResult is not set on Line 53, the whole foreach does not work and on line 63 it will throw a fatal error:

Fatal error: Call to a member function getAttribute() on a non-object in /***/vendor/Geocoder/src/Geocoder/Provider/OpenStreetMapsProvider.php on line 63

Add local adapter

It some use cases, a locale database would be usefull.

e.g.:
Your project use the YahooPlaceFinder provider. You'r requests are limited from Yahoo!.
If your limit is reached, it will throw some error's - that's bad.

Solution:
You create a Fallback provider that wrap the YahooPlaceFinder provider and the Locale provider.

  1. Geocoder ask the Fallback provider.
  2. The Fallback provider ask in first place the YahooProvider.
  3. If the request fails, the fallback ask the Locale provider.

Syntax error install_vendors.sh

I got a syntax error in file install_vendors.sh

markus@development:/var/www/geocoder/Geocoder$ sh ./bin/install_vendors.sh
: not foundll_vendors.sh: 2:
./bin/install_vendors.sh: 3: function: not found
: not foundll_vendors.sh: 4: {
Installing/Updating
: not foundll_vendors.sh: 6:
./bin/install_vendors.sh: 30: Syntax error: end of file unexpected (expecting "then")

How to include/autoload geocoder into Zend

Hello!

Actually i'm trying to setup up the geocoder lib to work within our ZF application. Therefore i want to use the ZF autoloader function. But without the ZF compatible namespaces or class naming autloading of the classes, i'm not sure to do this.

Can you explain me how to autload the geocoder library in a ZF application. I added the src-folder locally to the folder:

"D:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library"

best regards

Adding locale

It should be possible to specify a locale for both, normal and reverse lookups.

Caching

Perhaps beyond the scope of the project, but I think it would be useful to make for a fully featured geocoder, pretty much all other aspects are already covered.

I quite like the implementation in https://github.com/dsyph3r/GoogleGeolocationBundle, something similar with an additional field in the log for whichever provider was used, and uniqueness of search based off the values inputted and provider used:

CREATE TABLE `geolocation_location` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `search` varchar(255) NOT NULL,
  `provider` varchar(255) NOT NULL,
  `matches` smallint(6) NOT NULL,
  `status` varchar(20) NOT NULL,
  `result` longtext NOT NULL,
  `hits` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;

NB: He has also implemented a generic API log, which may also be useful:

CREATE TABLE `geolocation_api_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lastStatus` varchar(20) NOT NULL,
  `requests` int(11) NOT NULL,
  `created` date NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_26CE10BDB23DB7B8` (`created`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

Adding more adapters

It may be useful to add new adapters like a CurlHttpAdapter or a FopenAdapter even if Buzz provides this kind of abstraction.

Adding reverse geocoding feature

Assuming you have coordinates, you may want to get information from them (street address actually).
It can be easily doable by changing the ProviderInterface:

  • Tweak the getData() method;
  • Adding a reverse() method.
  • Adding a reverse() method in the GeocoderInterface.

Use composer for autoloading

I think the current solution for autoload classes is very obscure.

We should use composer for autoloading. Composer can create automaticly a classmap.
For BC reasons i would create a closure to load the classes, if no composer is available. (Maybe with a warning)?

Class 'Buzz\Browser' not found

Hello,

I'm using Geocoder (http://geocoder-php.org/) in my application.
I've installed it using the steps provided on the website.

Problem:
When I run the application, I receive the error;
Fatal error: Class 'Buzz\Browser' not found in D:\xampp\htdocs\dmp\geocoder\src\Geocoder\HttpAdapter\BuzzHttpAdapter.php on line 31

Line 31:
-- code --
$this->browser = new Browser();
-- /code --

I have this in my autoload.php file;
-- code --

Notice error Bing Provider

gecoding of "Hannover" (city in Germany) causes notice error:

Notice: Undefined property: stdClass::$postalCode
Notice: Undefined property: stdClass::$adminDistrict2

Need to check with property_exists

Add getRawData() method somewhere

It could be nice to provide a getRawData() method somewhere so that people can use raw data to get extra information.
It should probably be located in the providers as they already contain raw data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.