เจอปัญหา geoserver บางทีมันหา bounding box ของ layer ผิด (น้อยกว่าที่ควรจะเป็น) ทำให้แผนที่แสดงออกมาไม่ครบ…

เจอปัญหา geoserver บางทีมันหา bounding box ของ layer ผิด (น้อยกว่าที่ควรจะเป็น) ทำให้แผนที่แสดงออกมาไม่ครบ  ค้นไปค้นมาก็เจอว่าปัญหามันอยู่ที่ PostGIS’ “estimated extent” function ซึ่งวิธีแก้แบบบ้านๆ ก็คือ  disable ฟังก์ชั่นนี้ทิ้งไปซะ ซึ่งจะทำให้ geoserver ต้อง full scan เพื่อหา bounding box ซึ่งมันจะนานหน่อย แต่มันก็ให้ค่าที่ถูกต้อง

โดย Paul Ramsay:
replace the existing function(s) with a no-op so that GeoServer is forced to fall back to a full scan:

 create or replace function st_estimated_extent(text,text) 
 returns box2d as ‘select null::box2d’ language sql;

 create or replace function st_estimated_extent(text,text,text) 
 returns box2d as ‘select null::box2d’ language sql;

http://gis.stackexchange.com/questions/75536/geoserver-not-reading-bounding-box-from-postgis-geometry-correctly

http://gis.stackexchange.com/questions/75536/geoserver-not-reading-bounding-box-from-postgis-geometry-correctly

Leave a comment