I have a grid of data that is in a gnomonic projection, centered on a lat/long point (WGS-84). The grid has a 1km spacing. Given this I can easily obtain the x,y coordinates/distances from centre point where the latitude and longitude is known.

What is the best way to obtain the lat/long for any arbitrary datum in this grid (ie, how can I create a grid of lat/long pairs)?


You can set up a custom projection in proj4 for a gnomonic projection on every point of the world:

+proj=gnom +lat_0=51 +lon_0=7 +x_0=0 +y_0=0 +R=6371000 +towgs84=0,0,0,0,0,0,0

You can reproject Natural Earth world boundary data to this CRS using QGIS, and create a regular vector grid on it:

enter image description here

After densifying and reprojecting to Pseudo Mercator, the grid gets bended:

enter image description here

You can as well create a WGS84 degree grid, and reproject it to gnomonic:

enter image description here

For single coordinates, you can use GDAL cs2cs to convert the data from and to WGS84:

cs2cs +init=epsg:4326 +to +proj=gnom +lat_0=51 +lon_0=7 +x_0=0 +y_0=0 +R=6371000 +towgs84=0,0,0,0,0,0,0  -f %%f in.txt >out.txt

cs2cs +proj=gnom +lat_0=51 +lon_0=7 +x_0=0 +y_0=0 +R=6371000 +towgs84=0,0,0,0,0,0,0 +to +init=epsg:4326 -f %%f in.txt >out.txt

Just make sure your data is on the same hemisphere as your origin. The projection is not valid worldwide.

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.