[Mapbender-commits] r10094 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Apr 2 03:22:49 PDT 2019


Author: armin11
Date: 2019-04-02 03:22:49 -0700 (Tue, 02 Apr 2019)
New Revision: 10094

Modified:
   trunk/mapbender/http/php/transformgeojson.php
Log:
Fix for new postgis version - see https://stackoverflow.com/questions/51189704/transform-geom-couldnt-parse-proj4-output-string-projection-not-named

Modified: trunk/mapbender/http/php/transformgeojson.php
===================================================================
--- trunk/mapbender/http/php/transformgeojson.php	2019-03-27 07:21:04 UTC (rev 10093)
+++ trunk/mapbender/http/php/transformgeojson.php	2019-04-02 10:22:49 UTC (rev 10094)
@@ -35,7 +35,7 @@
 
     foreach($json as $feat) {
         if(preg_match('/point/i', $feat->geometry->type)) {
-            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2)) as geom";
+            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2::INT)) as geom";
             $v = array('POINT(' . $feat->geometry->coordinates[0] . ' ' . $feat->geometry->coordinates[1] . ')', $epsg);
             $t = array('s', 'i');
             $res = db_prep_query($sql,$v,$t);
@@ -44,7 +44,7 @@
             $feat->geometry = $geom;
         }
         if(preg_match('/linestring/i', $feat->geometry->type)) {
-            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2)) as geom";
+            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2::INT)) as geom";
             $geom = 'LINESTRING(';
             $coords = array();
             foreach($feat->geometry->coordinates as $coord) {
@@ -59,7 +59,7 @@
             $feat->geometry = $geom;
         }
         if(preg_match('/polygon/i', $feat->geometry->type)) {
-            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2)) as geom";
+            $sql = "SELECT st_asgeojson(st_transform(st_setsrid(st_geomfromtext($1), 4326), $2::INT)) as geom";
             $geom = 'POLYGON((';
             $coords = array();
             foreach($feat->geometry->coordinates[0] as $coord) {



More information about the Mapbender_commits mailing list