Message Boards Message Boards

0
|
4295 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Geocenter does not seem to result in a map aligned to the center.

Posted 3 years ago

I am working on a project to draw 3D Cuboids on county locations that can be animated to grow in height based on covid cases or deaths as a function of time in a time series.

With the following data for lat/lon

In[172]:= {uscovidcases[[2, 9]], uscovidcases[[2, 10]]}

Out[172]= {32.5395, -86.6441}

and generating a 3D texture with:

In[25]:= covidtexture3D = GeoGraphics[GeoCenter -> {uscovidcases[[2, 9]],
         uscovidcases[[2, 10]]}][[1, 1, 1]][[1]] /. {x_Real, y_Real} :> {x, y, 0}

Causes a map to be generated with a PlotRange that is offset from the requested coordinates. Note the requested range has lon/latbox with lats in the 32 range but the GeoRanges and the polygons are in the 34 range.

Here is a highly edited section of the output that illustrates the issue.

Any ideas of what is going on here would be appreciated as my cuboids based on the input do not fall in the range of the generated map.

Thanks

ColorFunction->RGBColor],
BoxForm`ImageTag[
        "Byte", ColorSpace -> "RGB", Interleaving -> False, 
         MetaInformation -> Association[
          "Exif" -> Association[
            "Software" -> "Created with the Wolfram Language: \
www.wolfram.com"], 
           "GeoMetaInformation" -> {
            "Software" -> "Created with the Wolfram Language: \
www.wolfram.com", 
             "TileSources" -> "Wolfram Knowledgebase with data from © \
OpenStreetMap contributors: http://www.openstreetmap.org/copyright", 
             "Projection" -> "Mercator", 
             "PlotRange" -> {{-86.83937072753906, \
-86.44866943359375}, {34.248504638671875`, 34.64057922363281}},
             "LonLatBox" -> {{-86.8389616283086, -86.44920291169139}, \
{32.37445131959778, 32.70459999408802}}, "GeoModel" -> "ITRF00"}]],
Selectable->False],
DefaultBaseStyle->"ImageGraphics",
ImageSizeRaw->{569., 571.},
PlotRange->{{0, 569.}, {0, 571.}}], "]"}], ",", 
InterpretationBox[
RowBox[{
TagBox["Polygon",
"SummaryHead"], "[", 
DynamicModuleBox[{Typeset`open$$ = True, Typeset`embedState$$ = 
        "Ready", Typeset`spolygon$$ = 
        Polygon[{{-86.8389616283086, 34.24884666851534, 
           0}, {-86.8389616283086, 34.640473525572325`, 
           0}, {-86.44920291169139, 34.640473525572325`, 
           0}, {-86.44920291169139, 34.24884666851534, 
           0}, {-86.8389616283086, 34.24884666851534, 0}}, 
         VertexTextureCoordinates -> {{
           0.00104708952034116, 0.0008723591290760169, 0}, {
           0.00104708952034116, 0.999730413384242, 0}, {
           0.9986345627570188, 0.999730413384242, 0}, {
           0.9986345627570188, 0.0008723591290760169, 0}, {
           0.00104708952034116, 0.0008723591290760169, 0}}]},
POSTED BY: vandel
3 Replies
Posted 3 years ago

Hi vandel,

Related posts on 3D geo graphics, this and this.

POSTED BY: Rohit Namjoshi
Posted 3 years ago

Thank you!!! That is the issue.

POSTED BY: vandel

I think the difference may be due to using Mercator coordinates. Does it look better aligned if you use GeoProjection -> "Equirectangular" ?

I think there are two main alternatives:

1) Using the "Equirectangular" projection, so that you have coordinates that are latitudes and longitudes. Use something like this instead of your input:

GeoGraphics[GeoCenter -> {32.5395, -86.6441}, 
    GeoProjection -> "Equirectangular"][[1, 1, 1]][[1]] /. {x_Real, y_Real} :> {x, y, 0}

2) Work in projected Mercator coordinates, but then you need to place your objects at the coordinates

In[15]:= GeoGridPosition[GeoPosition[{32.5395, -86.6441}], "Mercator"]
Out[15]= GeoGridPosition[{-86.6441, 34.4444}, "Mercator"]

and you see here where the 34.4 comes from. It is the Mercator Y coordinate corresponding to the latitude 32.5.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract