Skip to content

Commit

Permalink
update SRID 900913 to 3857, update the_geom to geom
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Mar 16, 2017
1 parent 117560c commit add2914
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tiles/jsontile.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ function beginsWith($str, $sub) {
$intersect = "
ST_Intersection(
way,
ST_SetSRID('BOX3D($mllx $mlly, $murx $mury)'::box3d,900913)
ST_SetSRID('BOX3D($mllx $mlly, $murx $mury)'::box3d,3857)
)";
//transform( ST_GeomFromText('POLYGON(($llx $ury, $urx $ury, $urx $lly, $llx $lly, $llx $ury))', 4326 ), 900913 )
//transform( ST_GeomFromText('POLYGON(($llx $ury, $urx $ury, $urx $lly, $llx $lly, $llx $ury))', 4326 ), 3857 )
$table = array(
array('planet_osm_polygon','building IS NULL AND not exist(hstore(tags),\'building:part\') AND',$intersect),
array('planet_osm_line','building IS NULL AND not exist(hstore(tags),\'building:part\') AND',$intersect)
Expand All @@ -119,7 +119,7 @@ function beginsWith($str, $sub) {
from ".$table[$i][0]."
where
".$table[$i][1]."
ST_IsValid(way) AND way && ST_SetSRID('BOX3D($mllx $mlly, $murx $mury)'::box3d,900913);
ST_IsValid(way) AND way && ST_SetSRID('BOX3D($mllx $mlly, $murx $mury)'::box3d,3857);
";

// debug
Expand Down Expand Up @@ -208,13 +208,13 @@ function beginsWith($str, $sub) {
select
ST_AsGeoJSON(
ST_Intersection(
ST_SetSRID(the_geom, 4326),
ST_SetSRID(geom, 4326),
ST_SetSRID('BOX3D($llx $lly, $urx $ury)'::box3d, 4326)
)
, 9 )
from ".$table[$i]."
where
the_geom && ST_SetSRID('BOX3D($llx $lly, $urx $ury)'::box3d,4326);
geom && ST_SetSRID('BOX3D($llx $lly, $urx $ury)'::box3d,4326);
";

// perform query
Expand Down

0 comments on commit add2914

Please sign in to comment.