Is there a method in PHP to covert a shapefile to GeoJSON? I need to upload shapefile and load it into a PostgreSQL table. I tried PHP exec(), but it didn't work.
[GIS] Convert a shapefile to GeoJSON with PHP
geojsonPHP
geojsonPHP
Is there a method in PHP to covert a shapefile to GeoJSON? I need to upload shapefile and load it into a PostgreSQL table. I tried PHP exec(), but it didn't work.
Best Answer
PHP
exec()
should work, what error do you get? And what commands/utilities are you using to convert?For example with ogr2ogr:
You should use escapeshellarg if any of these params are coming from user input