4
$\begingroup$

GeoHistogram appears to be leaving out some of the data given to it. A minimal example follows.

SeedRandom[4123];
dOne = MultinormalDistribution[{-45, 90}, {{15^2, 1}, {1, 30^2}}];
dTwo = MultinormalDistribution[{45, -90}, {{15^2, 1}, {1, 30^2}}];

dsTest = <|"GeoPosition" -> GeoPosition@#|> & /@ RandomVariate[dOne, 200] // Dataset;

dsTest holds points close enough together for GeoHistogram to plot all of them.

GeoGraphics[{Red, Point@GeoPosition[Identity @@@ Normal@dsTest[All, "GeoPosition"]]}, 
 ImageSize -> Large]

Mathematica graphics

GeoHistogram[Normal@dsTest[All, "GeoPosition"], Quantity[500, "Kilometers"], 
 PlotStyle -> {Opacity[.8]}, ImageSize -> Large]

Mathematica graphics

However, when a few points are added further away from this set of points some of them are not plotted by GeoHistogram.

dsTest = Join[dsTest, <|"GeoPosition" -> GeoPosition@#|> & /@ 
    RandomVariate[dTwo, 5] // Dataset];

GeoGraphics[{Red, Point@GeoPosition[Identity @@@ Normal@dsTest[All, "GeoPosition"]]}, 
 ImageSize -> Large]

Mathematica graphics

GeoHistogram[Normal@dsTest[All, "GeoPosition"], Quantity[500, "Kilometers"], 
 PlotStyle -> {Opacity[.8]}, ImageSize -> Large]

Mathematica graphics

The points on the right-hand side in the Pacific Ocean and in North America are not plotted.

Ideas?

Update

Actually it is worse that I thought. It seems GeoHistogram only considers a region in the neighborhood of the first point. Consider the following.

Start with a few points on one area and then add a lot of points a distance away.

dsTest = <|"GeoPosition" -> GeoPosition@#|> & /@ RandomVariate[dOne, 5] // Dataset;
dsTest = Join[dsTest, <|"GeoPosition" -> GeoPosition@#|> & /@ 
    RandomVariate[dTwo, 200] // Dataset];

Then

GeoGraphics[{Red, Point@GeoPosition[Identity @@@ Normal@dsTest[All, "GeoPosition"]]}, 
 ImageSize -> Large]

Mathematica graphics

GeoHistogram[Normal@dsTest[All, "GeoPosition"], Quantity[500, "Kilometers"], 
 PlotStyle -> {Opacity[.8]}, ImageSize -> Large]

Mathematica graphics

Here it can be seen that only the area near to the first point (near Australia) is considered. The massive number of points in North America are not plotted.

Update Confirmed bug CASE:3725237

$\endgroup$
  • $\begingroup$ It's a glitch in the GeoRange, try Graphics[lastPlot[[1, 1]]] where lastPlot is your last example to see what I mean. $\endgroup$ – rcollyer Sep 27 '16 at 14:32
  • $\begingroup$ Workaround: ReleaseHold["OriginalInput" /. (Method /. Options[lastPlot, Method])] $\endgroup$ – rcollyer Sep 27 '16 at 14:36
  • $\begingroup$ Still very broken if I need to it be on a certain GeoCenter. Eg. GeoHistogram[Normal@dsTest[All, "GeoPosition"], Quantity[500, "Kilometers"], PlotStyle -> {Opacity[.8]}, GeoRange -> "World", GeoCenter -> {-45, 130}, ImageSize -> Large] on the second definition of dsTest $\endgroup$ – Edmund Sep 27 '16 at 14:48
  • $\begingroup$ The workaround works for me even with that example. $\endgroup$ – rcollyer Sep 27 '16 at 14:57
  • $\begingroup$ I think it could be an issue with modding (since the globe is cut to make a rectangle). I say this because setting res = GeoHistogram[...] and running res /. Polygon[pts_List] :> Polygon[pts /. {x_Real, y_} :> {Mod[x, 360, -270], y}] OR Show[res, PlotRange -> All] seem to fix it on my machine. $\endgroup$ – Chip Hurst Sep 27 '16 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.