I have a geojson file with polygon data around the British Isles. Using php, I am trying to import this file into a mysql database so I can perform spacial queries.
The geojson file uses the WGS 84 (EPSG:4326) coordinate system. I want to convert these coordinates into lat/lng. I have found found some code here to do the conversion of each point, https://stackoverflow.com/a/18336137/1485815
However, it is requiring a UTM number. This is fine, but the British Isles are split into 3 different UTM codes 29,30 and 31 so I do not know which one to use or do I need to work out which one to use on a per coordinate basis
I am doing a project using such translations myself. Try this. proj4php\Proj4php I have found it able to convert any datum I have come across so far without an issue. As a tip for looping functions, only include some of the code shown in the github example to re-run every loop or else it will greatly slow the process down. The following is how I implement it.
I use this at the start of the php file:
and right before calling the function I set the source projection:
For a full list of all EPSGs available: Spatial Reference List
Enjoy and good luck!!