1
$\begingroup$

I have a long list of data (over 1,000,000 points) in the following format.

data={{36.4045, 127.977, 3.64633}, {36.4042, 127.989, 3.64633}, {36.404, 
  128., 2.73436}, {36.4038, 128.011, 2.36786}, {36.4035, 128.023, 
  3.15759}, {36.4033, 128.034, 3.15759}, {36.4031, 128.046, 
  2.73436}, {36.4028, 128.057, 2.05048}, {36.4026, 128.068, 
  2.05048}, {36.4024, 128.08, 1.77565}, {36.4021, 128.091, 1.53765}};

GeoGraphics[{{Blend[{Red, Blue}, #3], PointSize[.001], 
     Point@GeoPosition@{#1, #2}}} & @@@ data, 
 GeoProjection -> "Mercator", Frame -> True, 
 GeoScaleBar -> "Kilometers", GeoRange -> {{0, 60}, {100, 170}}]

The first two columns are latitude and longitude respectively, and the third column is the data value on that coordinate. How do I plot these data with different colours based on the date value on a geographic map in Mercator projection?

I am able to plot such geographic map with the above code. However, maybe there are too many points that the calculation is very time consuming or the Kernel even quits during evaluation.

Many thanks in advance.

$\endgroup$
  • $\begingroup$ Hi; Could be interesting. Could you flesh the question out to mention that you want this done with Mathematica and provide some of your work? An example of your code would do. $\endgroup$ – bobbym Dec 19 '16 at 3:56
  • $\begingroup$ I updated the message above. I am able to plot a geographic map with these data in different colours. However, maybe there are too many points that the Kernel always quits during evaluation. $\endgroup$ – wkong Dec 19 '16 at 5:56
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Dec 19 '16 at 7:18
4
$\begingroup$
data = {{36.4045, 127.977, 3.64633}, {36.4042, 127.989, 
    3.64633}, {36.404, 128., 2.73436}, {36.4038, 128.011, 
    2.36786}, {36.4035, 128.023, 3.15759}, {36.4033, 128.034, 
    3.15759}, {36.4031, 128.046, 2.73436}, {36.4028, 128.057, 
    2.05048}, {36.4026, 128.068, 2.05048}, {36.4024, 128.08, 
    1.77565}, {36.4021, 128.091, 1.53765}};

valRange = MinMax[data[[All, 3]]];

GeoGraphics[{
  GeoMarker[Most[#],
     "Color" -> 
      ColorData["ThermometerColors"][Rescale[#[[3]], valRange]]] & /@ 
   data},
 GeoProjection -> "Mercator"]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks a lot. Your suggestion works. However, since there are over 1,000,000 data points. It takes a very long time to finish the plotting, and sometimes the Kernel even quits. Any method to simplify the calculation? or it is unavoidable? $\endgroup$ – wkong Dec 19 '16 at 6:02
  • $\begingroup$ @wkong are you sure that you need to plot all those points? You won't be able to distinguish them in most displays or printed output anyway, so you could start by drastically reducing which ones you plot e.g. using data[[All, ;; ;; 1000]] (this will select one every thousand points) and then adjusting your selection to best suit your data. $\endgroup$ – MarcoB Dec 19 '16 at 7:25
  • $\begingroup$ @wkong Or you can use GeoHistogram $\endgroup$ – Kuba Dec 19 '16 at 7:36

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.