Project - Maple Help

DataSets[Builtin][WorldMap]

 Project
 project longitude-latitude pairs to different projections

 Calling Sequence Project(x,y,opts) Project(xy,opts)

Parameters

 x - a longitude value between -180 and 180 y - a latitude value between -90 and 90 xy - an $n$ by 2 Array or Matrix, or a list of $n$ lists each consisting of 2 numbers: the input points opts - (optional) equation(s) of the form projection=proj or mode=m, where proj is one of the projections in List of Projections and m is one of point, points, curve, or polygon

Description

 • The Project command applies the specified projection to the set of input points.
 • For the first calling sequence, unless projection=Globe, this command returns a two element list of the projected x and y coordinates.
 • If projection=Globe, a three element list of the projected x, y, and z coordinates is returned.
 • For the second calling sequence, a list of lists is returned if the input is a list of lists. Otherwise, a Matrix is returned.
 • The projection option determines which projection is used. The default is the Geographic projection.
 • If projection=Globe, then the mode option is ignored. Otherwise:
 – If mode=points (the default value), then each input point is projected and one corresponding output point is returned.
 – The option mode=point is a synonym for mode=points.
 – If mode=curve, then the $n$ input points are interpreted as describing a sequence of $n-1$ line segments between these points in the Geographic projection. In order to draw the same curve in the given projection, it may not suffice to just project the input points and draw straight line segments between them. Using the mode=curve option instructs Maple to insert extra points in between the original input points to remedy this.
 – If mode=polygon, then the same process as for mode=curve is followed, but any points projected to coordinates that evaluate to non-numeric values (i.e., positive or negative infinity, or undefined) to be removed from the end result.
 • Unlike most other commands in the WorldMap package, this command does not operate on a WorldMap object.
 • For a large number of points, it is more efficient to use the second form of the command than projecting each point separately.

Examples

The Mercator projection diverges at the poles.

 > $\mathrm{DataSets}:-\mathrm{Builtin}:-\mathrm{WorldMap}:-\mathrm{Project}\left(0,-90,\mathrm{projection}=\mathrm{Mercator}\right)$
 $\left[{0.}{,}{Float}{}\left({-}{\mathrm{\infty }}\right)\right]$ (1)
 > $X≔\mathrm{Statistics}:-\mathrm{Sample}\left(\mathrm{Uniform}\left(-180,180\right),5000\right):$
 > $Y≔\mathrm{Statistics}:-\mathrm{Sample}\left(\mathrm{Uniform}\left(-1,1\right),5000\right):$
 > $Y≔\mathrm{~}\left[\mathrm{-}\right]\left(\mathrm{~}\left[\mathrm{arccos}\right]\left(Y\right)\left(\frac{180}{\mathrm{\pi }}\right),\mathrm{ },90\right):$
 > $\mathrm{pts}≔\left[\mathrm{seq}\left(\left[X\left[i\right],Y\left[i\right]\right],i=1..5000\right)\right]:$
 > $\mathrm{ppts}≔\mathrm{DataSets}:-\mathrm{Builtin}:-\mathrm{WorldMap}:-\mathrm{Project}\left(\mathrm{pts},\mathrm{projection}=\mathrm{Bonne}\right):$
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{plottools}:-\mathrm{point}\left(\mathrm{ppts}\right)\right)$

The line segment connecting the following two points in the geographic projection runs through the Sahara desert.

 > $\mathrm{x1}≔\left[-90,10\right]$
 ${\mathrm{x1}}{≔}\left[{-90}{,}{10}\right]$ (2)
 > $\mathrm{x2}≔\left[70,30\right]$
 ${\mathrm{x2}}{≔}\left[{70}{,}{30}\right]$ (3)
 > $\mathrm{input}≔\left[\mathrm{x1},\mathrm{x2}\right]$
 ${\mathrm{input}}{≔}\left[\left[{-90}{,}{10}\right]{,}\left[{70}{,}{30}\right]\right]$ (4)
 > $m≔\mathrm{DataSets}:-\mathrm{Builtin}:-\mathrm{WorldMap}\left(\right):$
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{Display}\left(m\right),\mathrm{plottools}:-\mathrm{curve}\left(\mathrm{input}\right)\right)$

But in the Bonne projection, the line segment runs through Ireland.

 > $\mathrm{output}≔\mathrm{DataSets}:-\mathrm{Builtin}:-\mathrm{WorldMap}:-\mathrm{Project}\left(\mathrm{input},\mathrm{projection}=\mathrm{Bonne}\right)$
 ${\mathrm{output}}{≔}\left[\left[{-1.31989493325449}{,}{0.0765476835245464}\right]{,}\left[{0.938346490412134}{,}{0.156410313611208}\right]\right]$ (5)
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{Display}\left(m,\mathrm{projection}=\mathrm{Bonne}\right),\mathrm{plottools}:-\mathrm{curve}\left(\mathrm{output}\right)\right)$

To get a faithful projection of the line segment, we can use the mode=curve option. This inserts a number of extra points into the result.

 > $\mathrm{output2}≔\mathrm{DataSets}:-\mathrm{Builtin}:-\mathrm{WorldMap}:-\mathrm{Project}\left(\mathrm{input},\mathrm{projection}=\mathrm{Bonne},\mathrm{mode}=\mathrm{curve}\right)$
 ${\mathrm{output2}}{≔}\left[\left[{-1.31989493325449}{,}{0.0765476835245464}\right]{,}\left[{-1.29256326783059}{,}{0.0478314496886835}\right]{,}\left[{-1.26448054378988}{,}{0.0197188498060384}\right]{,}\left[{-1.23565803298054}{,}{-0.00776402479505300}\right]{,}\left[{-1.20610799727771}{,}{-0.0345912350898463}\right]{,}\left[{-1.17584369277183}{,}{-0.0607370320970162}\right]{,}\left[{-1.14487937249012}{,}{-0.0861758952402840}\right]{,}\left[{-1.11323028760505}{,}{-0.110882571275687}\right]{,}\left[{-1.08091268708605}{,}{-0.134832113725395}\right]{,}\left[{-1.04794381575225}{,}{-0.157999922756107}\right]{,}\left[{-1.01434191068702}{,}{-0.180361785437272}\right]{,}\left[{-0.980126195976903}{,}{-0.201893916311600}\right]{,}\left[{-0.945316875740763}{,}{-0.222572998207730}\right]{,}\left[{-0.909935125417463}{,}{-0.242376223222316}\right]{,}\left[{-0.874003081283474}{,}{-0.261281333796375}\right]{,}\left[{-0.837543828175043}{,}{-0.279266663808369}\right]{,}\left[{-0.800581385392824}{,}{-0.296311179604319}\right]{,}\left[{-0.763140690770379}{,}{-0.312394520883138}\right]{,}\left[{-0.725247582891611}{,}{-0.327497041353458}\right]{,}\left[{-0.686928781445975}{,}{-0.341599849076466}\right]{,}\left[{-0.648211865714256}{,}{-0.354684846407619}\right]{,}\left[{-0.609125251181761}{,}{-0.366734769448737}\right]{,}\left[{-0.569698164279988}{,}{-0.377733226920688}\right]{,}\left[{-0.529960615262143}{,}{-0.387664738365863}\right]{,}\left[{-0.489943369222299}{,}{-0.396514771588787}\right]{,}\left[{-0.449677915272525}{,}{-0.404269779242610}\right]{,}\left[{-0.409196433896948}{,}{-0.410917234468807}\right]{,}\left[{-0.368531762506372}{,}{-0.416445665497265}\right]{,}\left[{-0.327717359221894}{,}{-0.420844689113989}\right]{,}\left[{-0.286787264920744}{,}{-0.424105042904013}\right]{,}\left[{-0.245776063582448}{,}{-0.426218616177633}\right]{,}\left[{-0.204718840978353}{,}{-0.427178479488943}\right]{,}\left[{-0.163651141752392}{,}{-0.426978912656734}\right]{,}\left[{-0.122608924945969}{,}{-0.425615431199179}\right]{,}\left[{-0.0816285180246800}{,}{-0.423084811095352}\right]{,}\left[{-0.0407465694695173}{,}{-0.419385111788565}\right]{,}\left[{0.}{,}{-0.414515697348653}\right]{,}\left[{0.0405740474985149}{,}{-0.408477255712818}\right]{,}\left[{0.0809382592664034}{,}{-0.401271815927384}\right]{,}\left[{0.121055203098666}{,}{-0.392902763315813}\right]{,}\left[{0.160887381825075}{,}{-0.383374852501643}\right]{,}\left[{0.200397287751122}{,}{-0.372694218218555}\right]{,}\left[{0.239547457965078}{,}{-0.360868383843608}\right]{,}\left[{0.278300530412376}{,}{-0.347906267593791}\right]{,}\left[{0.316619300634618}{,}{-0.333818186330383}\right]{,}\left[{0.354466779066786}{,}{-0.318615856920217}\right]{,}\left[{0.391806248782705}{,}{-0.302312395107810}\right]{,}\left[{0.428601323575518}{,}{-0.284922311857386}\right]{,}\left[{0.464816006256864}{,}{-0.266461507129149}\right]{,}\left[{0.500414747055641}{,}{-0.246947261059687}\right]{,}\left[{0.535362501994694}{,}{-0.226398222522116}\right]{,}\left[{0.569624791121508}{,}{-0.204834395047472}\right]{,}\left[{0.603167756467013}{,}{-0.182277120095026}\right]{,}\left[{0.635958219604960}{,}{-0.158749057665351}\right]{,}\left[{0.667963738682970}{,}{-0.134274164256478}\right]{,}\left[{0.699152664795367}{,}{-0.108877668169945}\right]{,}\left[{0.729494197567248}{,}{-0.0825860421802103}\right]{,}\left[{0.758958439818882}{,}{-0.0554269735876578}\right]{,}\left[{0.787516451179659}{,}{-0.0274293316822001}\right]{,}\left[{0.815140300521130}{,}{0.00137686734860754}\right]{,}\left[{0.841803117079558}{,}{0.0309604980261510}\right]{,}\left[{0.867479140139492}{,}{0.0612893656543250}\right]{,}\left[{0.892143767151502}{,}{0.0923302488054544}\right]{,}\left[{0.915773600159084}{,}{0.124048944157070}\right]{,}\left[{0.938346490412134}{,}{0.156410313611208}\right]\right]$ (6)
 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{Display}\left(m,\mathrm{projection}=\mathrm{Bonne}\right),\mathrm{plottools}:-\mathrm{curve}\left(\mathrm{output2}\right)\right)$
 > 

Compatibility

 • The DataSets[Builtin][WorldMap][Project] command was introduced in Maple 2018.