> Am 19.08.2025 12:25, schrieb Greg Troxel: > > Hi Greg, > > > If you aren't using postgis, then your question is really off topic! > > I know it and I already said it at the beginning... > > > In that case, you should use gdal, which also uses proj. And, it can > > read/write postgis. > > > > https://gdal.org/en/stable/ > > > > and in particular the ogr2ogr program is useful. > > I need to do it in my program, and unfortunately there is no actual GDAL- > library for PHP. > Any other idea where can I get some sample code which works? > > Thanks > Luca Bertoncello > (lucab...@lucabert.de)
In my PHP programs I do one of 2 things 1) If I have a file I'm converting the coordinates of I call ogr2ogr from a php system command https://www.php.net/manual/en/function.system.php ogr2ogr is a commandline tool so can be used in php if the web context has the right access. But I haven't done that in some time so don't have code readily handy to share and this does assume you have GDAL installed on your server. 2) If it's user input I'm trying to convert, I just call an SQL ST_Transform statement as Greg mentioned https://postgis.net/docs/en/ST_Transform.html in a php PDO command. And as Greg mentioned, if we start getting into too many PHP details, then it's off-topic for this mailing list.