What I'm trying to do is create a grid where the y axis is north aligned. I have a origin Lat/Lon point which is the bottom left corner of the grid and each cell should be 100 by 100 meters. So I projected my points to SRID 2163 (US Equal Area) and figured id use each the grid x,y values with the cell size relative to my origin point.

like this:

cell_bottom_left = { lon: origin.lon + (100 * x), lat: origin.lat + (100 * y)}
cell_top_left    = { lon: origin.lon + (100 * x), lat: origin.lat + (100 * y) + 100}
cell_bottom_right= { lon: origin.lon + (100 * x) + 100, lat: origin.lat + (100 * y)}
cell_top_right   = { lon: origin.lon + (100 * x) + 100, lat: origin.lat + (100 * y) + 100}

it worked fine, except the grid was tilted. I then found out that 2163 is not north aligned which explains what is happening here.

How would I go about creating a north aligned grid?

  • It would seem that your grid is north-aligned. It just isn't orthogonal on the screen. Are you asking for a projection that will make your grid both north-aligned and orthogonal?
    – Patrick
    Commented Aug 11, 2011 at 3:18
  • Wouldn't that only be achievable by rotating the map? Either way, I guess I just need it to be orthogonal then if I understand correctly.
    – ilia choly
    Commented Aug 11, 2011 at 3:51
  • No, not necessarily. If you rotate the grid and leave the coordinate system the same, your top will not be due north of your bottom.
    – Patrick
    Commented Aug 11, 2011 at 3:55

1 Answer 1


You'll need to change the projection of the map (but not necessarily the grid) to one in which north is orthogonal, such as Mercator. Note that changing the map projection will only change the way the image appears - it won't change the underlying data in the grid, so I assume you need an orthogonal grid for graphics reasons.

I'm not as familiar with PostGIS's method for displaying spatial data, so if there is no "map" with a projection, just reproject your grid to some form of Mercator, and I assume PostGIS will display it orthoganally.

  • Yes, my dilemma is purely aesthetic based. Basically i'm generating a grid table. Then I'll be doing a join query on some points and the grid table and group them by the cell they fall into to create histograms.
    – ilia choly
    Commented Aug 11, 2011 at 4:21
  • Okay! Write back if you have questions about the details of changing projections in PostGIS. Hopefully someone with more experience with it will chime in.
    – Patrick
    Commented Aug 11, 2011 at 4:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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