baraja-core / geocoder
Rewrite real address to geo coordinates.
Installs: 15 230
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- baraja-core/ecommerce-standard: ^0.0
Requires (Dev)
- nette/di: ^3.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.0
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-nette: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- roave/security-advisories: dev-master
- spaze/phpstan-disallowed-calls: ^2.0
This package is auto-updated.
Last update: 2024-10-08 18:03:21 UTC
README
Rewrite real address to geo coordinates.
Idea
The task of the address geocoding process is to rewrite a real address (which we get from the user or from another API) into real GPS coordinates. If the address is too general and represents a large area, we return the middle point in that area.
The process of transcribing an address to GPS is not always reliable and accurate. Data from many sources is used, but in some cases the transcription may fail or return an incorrect result.
When using a geocoder, always validate the output coordinates against a preset area in your application.
How to use
Simple create instance and call method:
$geocoder = new \Baraja\Geocoder\Geocoder(); $coordinates = new $geocoder->decode('Náměstí Míru Praha'); echo $coordinates->getLatitude(); // 50.075075836281066 echo $coordinates->getLongitude(); // 14.437529917970826