Question

I have searched a lot on this topic, and have found no answers.

I have my own statistics package where I'm saving the geoip data of my users (along with a bunch of other data). I'm using the maxmind geoip library to get this information.

So, in my backend I'm visualizing this data as text that have basically two columns, one for the country name and another for the number of visits from the country.

I'd like to generate a map with this data. something like a world map with the countries I have visits from highlighted. Heat mapping would be nice, but not required.

I dont really care if it's generated with php (GD image library) or jquery, since I'm already using both those technologies for the statistics backend. But I'd REALLY like to do this without google analytics or their graphing APIs.

Was it helpful?

Solution 2

i need to finally answer my own question here. for anyone else who stumbles across this:

i have been using the d3js library with the topojson extension. https://github.com/mbostock/topojson

OTHER TIPS

I will try to suppose. The way I would try do it ...

  1. Get FullHD (or HighRes world map)
  2. Coordinates I'd keep in WGS84 standard (float values, otherwise it is easy to convert)
  3. I would try to approach real coordinates to the scale of image, but before this ...

The major part in this work is Math. I'm actually not a mathematician, but I know that it should be applied here and why.

Main goal here is to project coordinates on a flat surface, bec. WGS84 uses oblate spheroid as a reference surface (with radius = 6378137 m; flattering = 1/298.257223563), so it is not ideal circumference and it should be taken into account. + image should be GEO binded somehow (you should know coordinates of corner angles of this image @least. it is the easiest case if so).

Calculations for this case are not very massive, everything leads to the elementary plane geometry.

Here is the library that could help you working with geospatial data http://www.gdal.org/.

My advice to you, to consult some specialists in this field if you know nothing about it (maybe SatCom spec. or MobCom spec. in some university/academy) (or try Google if you are familiar enough with math and GEO) and to ask for a math model for projection of GPS coordinates to the flat surface and you will definitely get the answer.

If you don't need very high accuracy, try it yourself maybe you'll have luck.

You can try yourself in MatLab (more applicable in this case) or Mathcad if you know math enough and try yourself to position few points on the raster.

If you will find the answer in the nearest future, I would be glad if you post it here or share with me your solution for the particular case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top