Skip to content

Commit

Permalink
Fix projection of ShapeTiles (map for Katastralgemeinden)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzlabing committed Apr 2, 2023
1 parent 7c4b589 commit 4944648
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RMBTMapServer/src/at/rtr/rmbt/mapServer/ShapeTiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ protected byte[] generateTile(final ShapeTileParameters params, final int tileSi
//debugging hint: St_AsText allows human-readable representation of a geometry object
final String sql = String.format(
"WITH box AS"
//input from Browser is converted to 900913; has to be transformed to 31287 for use with bev data
//input from Browser is converted to 3857; has to be transformed to 31287 for use with bev data
+ " (SELECT ST_Transform(ST_SetSRID(ST_MakeBox2D(ST_Point(?,?),"
+ " ST_Point(?,?)), 900913), 31287) AS box)"
+ " ST_Point(?,?)), 3857), 31287) AS box)"
+ " SELECT"
//output has to be transformed to 900913 for Browsers
+ " ST_SnapToGrid(ST_Transform(ST_intersection(p.geom, box.box), 900913), ?,?,?,?) AS geom,"
//output has to be transformed to EPSG:3857 for Browsers
+ " ST_SnapToGrid(ST_Transform(ST_intersection(p.geom, box.box), 3857), ?,?,?,?) AS geom,"
+ " count(\"%1$s\") count,"
+ " quantile(\"%1$s\",?) val"
+ " FROM box, bev_vgd p"
Expand Down

0 comments on commit 4944648

Please sign in to comment.