2
$\begingroup$

I am creating plots (ContourPlot, SmoothDensityHistogram, etc.) that I then need to project onto geographic polygons. When this is done with GeoStyling[{"GeoImage", _}] the images are projected onto GeoGraphics polygons have greatly reduced image quality to the actual plots.

How can the quality of the image in GeoGraphics be specified?

Minimal example:

adOK = AdministrativeDivisionData[{"Oklahoma", "UnitedStates"}];
geoBounds = Round[GeoBounds[adOK], .1];

cp = ContourPlot[Cos[long] + Cos[lat], 
  Evaluate[Sequence @@ Reverse@MapThread[Prepend, {geoBounds, {lat, long}}]], 
  AspectRatio -> Divide @@ Reverse@Apply[Subtract, Reverse[geoBounds, {1, 2}], 2],
  Frame -> None, PlotRangePadding -> None, ImagePadding -> None]

enter image description here

GeoGraphics[{EdgeForm[Gray], Gray, GeoStyling[{"GeoImage", cp}], adOK["Polygon"]}, 
  GeoBackground -> None, GeoRangePadding -> None]

enter image description here

As you can see above the quality of the image in the GeoGraphics is many times lower than the image quality of the plot. How can the quality of the image in GeoGraphics be specified?

$\endgroup$
  • 1
    $\begingroup$ Why not preprocess cp with Rasterize[]? $\endgroup$ – J. M. is away Jul 14 '16 at 13:55
  • $\begingroup$ @J.M. Yup. That will do it. 0_o $\endgroup$ – Edmund Jul 14 '16 at 14:44

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.