2

I am working on a project in TileMill for the first time. I am trying to overlay a Graticule of the British national square grid.

I generated a series of LineString for the grid into PostGIS, which are stored as native EPSG:27700 (OSGB36, BNG)

I only have a small area of interest, so it is only 100x100 orthogonal lines

My grid is accurately rendered in QGIS [image:2], which I check by comparing with the "Authorative source" on Bing maps [image:1] (this is a raster of the 1:50000 British ordnance survey map reprojected to EPSG:3857 for web mapping)

When I add this layer to Tilemill image:3], it is all skewed and incorrectly re-projected from its native SRS to 900913 (Tilemill's native CRS)

I can actually see some of this issue in QGIS also, when zoomed out: [image:4 & image:6]

But when zoomed in they are accurate: [image:5 & image:7]

Unfortunately, The output from TileMill is always incorrect. [image:8]

Please could somebody give me some pointers on how to get my grid true.

composite image of examples:~700kB (I do not have the reputation to post more than 2 images)

4
  • How did you generate your OS grid? What I'm getting at is, does each line in the grid have only two vertices, one at the start and one at the end?
    – nhopton
    May 7, 2016 at 11:12
  • Yes. Do you think I should generate a multiline string with a point for each (1km) intersection? May 7, 2016 at 11:21
  • 2
    Something like that would be worth trying. One way would be (with the grid on the screen in EPSG:27700) Vector -> Geometry Tools -> Densify Geometries...
    – nhopton
    May 7, 2016 at 11:42
  • Excellent. I now understand the issue. Only the vertices get reprojected. The centre of a line doesn't and so does not reflect the difference in the CRS models at that position. "Densify geometries" was the solution, and I just selected "98" intermediary points giving me an exact 1km grid. I uploaded the shapefile into TileMill and it is displayed as I expect. @nhopton Please add something to this effect (but in proper GIS speak) as an Answer and I'll mark it correct. May 7, 2016 at 12:12

1 Answer 1

3

This is a problem I've experienced when reprojecting map gridlines from the Ordnance Survey National Grid system to Spherical Mercator. My solution was to add many more vertices to the linestrings. This can be done using "Densify Geometries": Vector -> Geometry Tools -> Densify Geometries...

1
  • 2
    Note that the deinsify should always be done right after the grid creation, before any reprojection of the project or the layer.
    – AndreJ
    May 7, 2016 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.