I'm working on a GeoGraphics
plot of hurricane wind field data, which I have set up as the following (first two values are the lat and lng, the rest are values for the chart).
forecast = {
{19.1, -82.7, 20, 0, 0, 0, 40, 40, 0, 30, 100, 80, 40, 90},
{20.7, -83.5, 20, 20, 15, 20, 50, 50, 30, 40, 110, 100, 60, 100},
{22.7, -84.0, 25, 25, 20, 20, 60, 50, 40, 50, 130, 120, 80, 110},
{24.5, -84.0, 30, 30, 25, 25, 70, 60, 50, 60, 140, 130, 100, 130},
{26.1, -83.8, 40, 40, 30, 35, 80, 70, 60, 70, 160, 140, 110, 150},
{27.2, -83.5, 0, 0, 0, 0, 80, 70, 60, 70, 180, 130, 120, 150},
{28.0, -83.2, 0, 0, 0, 0, 90, 50, 60, 80, 180, 130, 120, 150}
}
If I use the following, I get a chart just fine:
GeoGraphics[
{
Red,
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[3]], "nmi"], {0, 90}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[4]], "nmi"], {90, 180}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[5]], "nmi"], {180, 270}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[6]], "nmi"], {270, 360}],
Yellow,
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[7]], "nmi"], {0, 90}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[8]], "nmi"], {90, 180}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[9]], "nmi"], {180, 270}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[10]], "nmi"], {270, 360}],
Blue,
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[11]], "nmi"], {0, 90}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[12]], "nmi"], {90, 180}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[13]], "nmi"], {180, 270}],
GeoDisk[{forecast[[1]][[1]], forecast[[1]][[2]]},
Quantity[forecast[[1]][[14]], "nmi"], {270, 360}]
}, GeoRange -> Quantity[500, "NauticalMiles"]
]
However, if I replace the first value with a variable, say a
, and plot, it fails.
a->1;
GeoGraphics[
{
Red,
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[3]], "nmi"], {0, 90}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[4]], "nmi"], {90, 180}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[5]], "nmi"], {180, 270}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[6]], "nmi"], {270, 360}],
Yellow,
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[7]], "nmi"], {0, 90}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[8]], "nmi"], {90, 180}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[9]], "nmi"], {180, 270}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[10]], "nmi"], {270, 360}],
Blue,
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[11]], "nmi"], {0, 90}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[12]], "nmi"], {90, 180}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[13]], "nmi"], {180, 270}],
GeoDisk[{forecast[[a]][[1]], forecast[[a]][[2]]},
Quantity[forecast[[a]][[14]], "nmi"], {270, 360}]
}, GeoRange -> Quantity[500, "NauticalMiles"]
]
Part::pkspec1: The expression a cannot be used as a part specification.
Part::pkspec1: The expression a cannot be used as a part specification.
Part::pkspec1: The expression a cannot be used as a part specification.
General::stop: Further output of Part::pkspec1 will be suppressed during this calculation.
Part::partw: Part 3 of forecast[[a]] does not exist.
Part::partw: Part 4 of forecast[[a]] does not exist.
Part::partw: Part 5 of forecast[[a]] does not exist.
General::stop: Further output of Part::partw will be suppressed during this calculation.
GeoDisk::cntr: {forecast, a} is not a valid center location.
GeoDisk::cntr: {forecast, a} is not a valid center location.
GeoDisk::cntr: {forecast, a} is not a valid center location.
General::stop: Further output of GeoDisk::cntr will be suppressed during this calculation.
Out[2]= GeoGraphics[-Graphics-, GeoBackground -> {GeoStyling[StreetMapNoLabels], GeoStyling[VectorLabels]},
> GeoCenter -> GeoPosition[{28.02, -82.14}], GeoGridLines -> None, GeoGridLinesStyle -> GrayLevel[0.4, 0.3],
> GeoProjection -> {LambertAzimuthal, Centering -> GeoPosition[{28.02, -82.14}]},
> GeoRange -> {{19.6594, 36.3705}, {-91.5651, -72.7149}}, GeoRangePadding -> Full, GeoResolution -> Automatic,
> GeoServer -> {Automatic}, GeoZoomLevel -> 6,
> MetaInformation ->
> <|GeoMetaInformation ->
> <|Attribution ->
> Hyperlink[Wolfram Knowledgebase, https://www.wolfram.com/],
> Hyperlink[⌐ MapTiler, https://www.maptiler.com/copyright/],
> Hyperlink[⌐ OpenStreetMap contributors, https://www.openstreetmap.org/copyright],
> AttributionType -> Tooltip, GeoModel -> ITRF00, LonLatBox -> {{-93.1605, -71.1195}, {19.3397, 36.6857}},
> PlotRange -> {{-0.155062, 0.155062}, {-0.145791, 0.1511}},
> Projection -> {LambertAzimuthal, Centering -> GeoPosition[{28.02, -82.14}],
> LongitudeDetermination -> -82.14}, Software -> Created with the Wolfram Language: www.wolfram.com,
> TileSources -> {Wolfram, OSM, MapTiler}|>|>]