# Define functions on Geographic regions

Let's plot a parametric function $$(x_s(u,v), \:y_s(u,v))$$ on some $$uv$$ domain as shown below with an annulus as example.

    xs[u_, v_] := (1/4 - I/4)*Sqrt[Pi]*(-Erf[(1/2 + I/2)*u] + Erf[(1/2 +
I/2)*(u - I*v)] - Erfi[(1/2 + I/2)*u] + Erfi[(1/2 + I/2)*(u + I*v)]);

ys[u_, v_] := (1/4 + I/4)*Sqrt[Pi]*(-Erf[(1/2 + I/2)*u] + Erf[(1/2 +
I/2)*(u - I*v)] + Erfi[(1/2 + I/2)*u] - Erfi[(1/2 + I/2)*(u + I*v)]);

ParametricPlot[{{xs[u, v], ys[u, v]}}, Element[{u, v}, Annulus[{1, 1}, {0.5, 1}]]]


Now, I wish to take as domain, instead of an annulus, some geographical region, for instance Portugal. Up to now I've learned to plot such regions using

 GeoGraphics[{Polygon[Entity["Country", "Portugal"]]}, GeoBackground -> None]


but how to convert that plot into a mathematical set where I could evaluate ParametricPlot ?

• So, the $u$ and $v$ in your function would be latitude and longitude? May 30 at 16:25
• @J.M. True (for simplicity). Also, I would place the object on the first quadrant to have $u>0$ and $v>0$. May 30 at 16:31
• You have a first example in the book : Dauphiné A. Geographical Models with Mathematica, ISTE Press Elsevier, 2017, pages 231-232 May 30 at 17:28
• @Dauphine Nice. I'm gonna take a look. Thanks. May 30 at 17:51
• @Dauphine I checked it and that's not exactly what I'm looking for. That's simply a superposition, what I need to do is to take the domain and map it through a function. May 30 at 19:20

Here is a possible method:

Get the polygon you want to handle as a geo region:

georegion = Entity["Country", "Portugal"]["Polygon"]


You need to choose a geo projection to give meaning to the {u, v} pairs. If you need them to be {lon, lat} then choose "Equirectangular", but perhaps you need to start with "Mercator" coordinates, or "Mollweide" coordinates. Let us choose "Mercator". Discretize the result:

region = DiscretizeRegion[GeoGridPosition[georegion, "Mercator"]]


Now you can perform a computation (I use something simpler than your function):

map = ParametricPlot[{{u - v + 40, u + v}}, Element[{u, v}, region], PlotStyle -> Green]


Show both maps together (note that I use the same projection, for consistency of interpretation):

Show[GeoGraphics[{Red, EdgeForm[Red], georegion}, GeoProjection -> "Mercator", GeoBackground -> "VectorMonochrome"], map, PlotRange -> All]


• Great !! That's a simple, nice solution. Thank you so much. May 31 at 16:33