From the point of view GIS professionals this question will be sure very primitive, but please keep in mind - i'm totally newbie in this area - and this is my 1st question here.

Have several GPS coordinates and need draw them as pins the into world-map image. On the internet i found one "public domain" image of the world. (attached a resized smaller version here - in reality I need 2000 pixel wide image).

I know perl - so, decided to use:

  • GD.pm (or Image::Magick) - for graphics operations
  • and installed the Geo::Proj4 perl module to cartographic conversions.

The manual says:

$proj->forward(LATITUDE, LONGITUDE)

Perform a forward projection from LATITUDE and LONGITUDE (LL) to the cartographic projection (XY) represented by the Geo::Proj4 instance


Returned are two values, usually X and Y in meters, or whatever units are relevant to the given projection

If I understand right - that is enough for me, need only convert the meters to my pixels in my map image.

For using the above forward routine, it need an $proj instance what must define the map projection TYPE, like:

$proj = Geo::Proj4->new(proj => "merc", ellps => "clrk66", lon_0 => -96);
my $proj = Geo::Proj4->new(init => "epsg:28992");

#and like (many-many-many possibilities).

As the manual says - It is not easy. :(

The object defines the target projection, but that's easier said than done: projections have different parameter needs. The parameters which can (or need to) be used are listed with cs2cs -lP. The manual page of cs2cs explains how the configuration works.

Now the questions:

  • In what projection is the attached map? - or how to determine it?
  • How i can decide how to initialize the Proj4 instance for this image?
  • I'm totally lost how to continue - the cs2cs -lP. returns me approx 150 different projections :(
  • if this image is not usable - is here some better way to get an better defined map? Because need generate many-many-many bitmap images, can't use google API or like)

Thank you for a patience.

enter image description here

  • The main problem is you can't overlay world map with points without base layer coordinates. Most of the time, you use a shapefile of the world to generate an image like above and you add on the top another layer to draw your points. Only as a comment because not perl based, you can look at python with fiona and shapely macwright.org/2012/10/31/gis-with-python-shapely-fiona.html and also matplotlib matplotlib.org/basemap/users/examples.html – ThomasG77 May 19 '13 at 9:42
  • @ThomasG77 The mapplotlib was an GREAT suggestion. The solution for me is: do not use the above image, but start with and empty bitmap image and draw the map itself as 1st step. The python package contains the drawcoastlines method for this and contains some DATA for the drawing too. I'm not an python expert, but sure can learn from the sources how to do it. Definitely, your answer helps. Thank you for now. – jm666 May 19 '13 at 18:50

Basically you can do this by overlay vector(GPS data) on raster(world-map-image). If you want a map viewer to view both. you can use QGIS for desktop or if you want a web page, please consider OpenLayers/Leaflet.

Or you may be looking to create a png/jpeg image with both data on it. This case you can use qgis/grass/mapserver's shp2img. The easy way is QGIS/GRASS GIS.

For QGIS run with --snapshot and --project option to get output image

for GRASS GIS load the data and save the result to file either using PNG monitor or GRASS export commands from Map Display

  • BTW, mapserver has a perl bindings – rkm May 19 '13 at 10:10
  • Will take a closer look to shp2img and maybe on the mapserver will find an easy way how to plot my own world map. Thank you for the suggestion. – jm666 May 19 '13 at 18:47

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.