Hacker News new | ask | show | jobs
by anc84 2613 days ago
Please be aware that you MUST NOT use this for geographic coordinates such as "GPS" or "WGS84" latitude & longitude pairs. Depending on the longitude areas are of different sizes. You must use code that knows about that or your results will be utterly wrong.
3 comments

The OP makes a related mistake (although for their data, it worked out OK). It uses this grid:

  x_grid=np.arange(x_min-h,x_max+h,grid_size)
  y_grid=np.arange(y_min-h,y_max+h,grid_size)
where h is a small constant, and the range ends are the min/max of the data. In general, this will result in rectangular pixels, which you probably don't want.

In your example, even for a small geographic area, a degree of longitude will typically translate to a smaller distance than a degree of latitude, so as you say you can't treat them the same.

This would only skew density maps not counts maps.
Well, this is about density maps unless I overlooked something?
How does this factor for tools like Datashader?
Same idea for datashader.

If you're overlaying datashader on a map, use the projected coordinates as input (to both datashader and/or any heatmap).