geojson-converter is a PHP library for converting GPX and KML files into GeoJSON format. This library is particularly useful for projects that require a quick and reliable conversion of mapping file formats.
To install geojson-converter, use the following command in your project:
composer require lraveri/geojson-converterTo convert a GPX file to GeoJSON:
$content = file_get_contents('/path/to/file.gpx');
$gpxConverter = new GpxConverter($content);
$geoJson = $gpxConverter->convert();` To convert a KML file to GeoJSON:
$content = file_get_contents('/path/to/file.kml');
$kmlConverter = new KmlConverter($content);
$geoJson = $kmlConverter->convert();` - PHP 7.1 or higher.
Interested in contributing? Fantastic! You can open a pull request or an issue on the GitHub repository.
This project is released under the MIT License. See the LICENSE file for more details.
If you have any questions or issues, feel free to create an issue on the GitHub repository.