mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
use X/Y max/min functions instead of box making
There is a strange bug in postgis where for some coordinates it does not make a proper box around a point.
This commit is contained in:
@@ -71,8 +71,8 @@
|
||||
|
||||
// Get the bounding box and outline polygon
|
||||
$sSQL = "select ST_AsText(geometry) as outlinestring,";
|
||||
$sSQL .= "ST_Y(ST_PointN(ExteriorRing(ST_Box2D(geometry)),4)) as minlat,ST_Y(ST_PointN(ExteriorRing(ST_Box2D(geometry)),2)) as maxlat,";
|
||||
$sSQL .= "ST_X(ST_PointN(ExteriorRing(ST_Box2D(geometry)),1)) as minlon,ST_X(ST_PointN(ExteriorRing(ST_Box2D(geometry)),3)) as maxlon";
|
||||
$sSQL .= "ST_YMin(geometry) as minlat,ST_YMax(geometry) as maxlat,";
|
||||
$sSQL .= "ST_XMin(geometry) as minlon,ST_XMax(geometry) as maxlon";
|
||||
$sSQL .= " from placex where place_id = $iPlaceID";
|
||||
$aPointPolygon = $oDB->getRow($sSQL);
|
||||
IF (PEAR::IsError($aPointPolygon))
|
||||
|
||||
Reference in New Issue
Block a user