Giter VIP home page Giter VIP logo

geolocation's People

Contributors

10n avatar anthonymartin avatar briezler avatar ccarstens avatar chindit avatar demerzel3 avatar matheus-ro avatar pfuhrmann 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

geolocation's Issues

Bounding box appears to break with large radius

I've noticed that the longitude bounds for a given point don't appear to contain the origin longitude for a large enough distance. This test below works for the 1 kilometer example but breaks for the 1000 kilometer example.

It appears to break around the 472 kilometers mark, I'm not sure if that is a significant number or not.

<?php

namespace Tests\Unit;

use AnthonyMartin\GeoLocation\GeoPoint;
use PHPUnit\Framework\TestCase;

class BoundingBoxTest extends TestCase
{
    public function test_bounding_box_includes_origin()
    {
        $geoPoint = new GeoPoint(-36.9158, 174.6922);

        $smallBoundingBox = $geoPoint->boundingBox(1, 'kilometers');

        $this->assertTrue($geoPoint->getLatitude() >= $smallBoundingBox->getMinLatitude());
        $this->assertTrue($geoPoint->getLatitude() <= $smallBoundingBox->getMaxLatitude());
        $this->assertTrue($geoPoint->getLongitude() >= $smallBoundingBox->getMinLongitude());
        $this->assertTrue($geoPoint->getLongitude() <= $smallBoundingBox->getMaxLongitude());

        $largeBoundingBox = $geoPoint->boundingBox(1000, 'kilometers');

        $this->assertTrue($geoPoint->getLatitude() >= $largeBoundingBox->getMinLatitude());
        $this->assertTrue($geoPoint->getLatitude() <= $largeBoundingBox->getMaxLatitude());
        $this->assertTrue($geoPoint->getLongitude() >= $largeBoundingBox->getMinLongitude());
        $this->assertTrue($geoPoint->getLongitude() <= $largeBoundingBox->getMaxLongitude());
    }
}

Not correct boundingCoordinates

Hello,

I am trying to create boundingCoordinates from 48.1502228 17.0621223 with distance for example 10km.

Result are next coordinates
48.0602907806 16.9273279672
48.2401548194 17.1969166328

From both points distance is more than 10km (more than 13km).

What causes such a deviation?

Thanks

What's the difference between the classes GeoLocation and GeoPoint?

Hey Anthony,

looking at the source I'm stumbling across the classes GeoLocation and GeoPoint. What's the difference? They seem redundant - am I missing something? Feel free to just update the source documentation and/or readme instead of explaining it here.

Thank you for your efforts :)

Add tags

Hi,
Can you tag it pls?
We want to add this as a dependency to the one of our projects
Many Thanks

Require script in composer.json

Hi,

this must be a very idiotic question to you but I'm a noob.
What is the code for the composer.json. I mean the "require" code. I tried many things but doesnt seem to work for me.
Thank you.

Need To Know

The thing is i want to generate a fence on a specific location and want to match
if ( inputLocation -> isWithinTheFence) is true/false

Issue in readme GeoLocation

use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;

$location = 'New York City';
$response = GeoLocation::getGeocodeFromGoogle($location);
$latitude = $response->results[0]->geometry->location->lat; <--- lat not lng!!!!!
$longitude = $response->results[0]->geometry->location->lng;
echo $latitude . ', ' . $longitude;
#40.7143528, -74.0059731

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.