# Display Coordinates on a map

## Recommended Posts

Hello,

I have a list of coordinates that must be placed correctly on a map.
I've been trying to solve this problem for almost a week and I can't figure it out.'

I tried to solve this using several UDFs or various solutions but none helped me out to come up with something.

Any tips for a possible solution to this problem and dispaly the coordinates on the right place?

Thank you very much for your attention.

##### Share on other sites

I don't really need a code to work just an idea of how I could do the code by myself.

Thank you!

##### Share on other sites

Not very clear what you want to achieve from those coordinates.  Can you show a few examples ?  And explain further what you expect ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

For example I have coordinate 109.3.

I want to have a point which should be displayed in the right place according to the direction of the coordinate (ex : 109.3 will be somewhere between East (E) 90* and South (S) 180*.

##### Share on other sites

Yes I understood that.  But what would be the distance to put the point from the center ?  Random ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

It is ok if it is on the biggest line, non dotted.

##### Share on other sites

Is the circle fixed dimension ?  Do you you know the radius of the circle (in pixels) before ?   Who is drawing the circle, you ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

I know that the width of the circle is 450 and heigh 300 pixels.

##### Share on other sites

That does not help much.  Again, who is drawing the circle ?  Do you have the code ?

Not much of a signature but working on it...

Spoiler

##### Share on other sites

Unfortunately not. I just got the image from somewhere.

I'll try my best to see what I can do.

I also found out the Excel UDF which can create a radial chart but I don't figure out how. I m still trying now using this.

It is ok if it's generated in Excel too.

##### Share on other sites

It doesn't really matter if it's displayed on this chart or other or through other methods.

Just a radial in which I can put this value and be displayed on a circle.

The thing is that I have a lot of maritime data i work with and i want to do a script to show me the dominant current and it's intensity from a range of time. (Each hour represents a value)

##### Share on other sites

Alright, my first intuition would be to use GDI+ to draw the circle and the points.  You would control everything (radius, center of the circle, circumference, etc...).  You can easily draw points also with it (see _GDIPlus_GraphicsDrawEllipse for both circle and points).  To know the number of pixels between each degree, you just divide the circumference by 360.

Once you have that you can calculate the x,y coordinates of a point based on its degree and the radius of the circle.  My geometry is very very far, so I cannot give you right now the method of calculating it.  Another solution would be to create a 2D array of coordinates for each of the 360 degree.  Then you can extrapolate the position for in between degrees.

Edit Found it, was not so complicated after all :

```Const \$radius = 100

For \$angle = 0 to 360 step 45
ConsoleWrite("x = " & \$x & " / y = " & \$y & @CRLF)
Next```

That is calculating X,Y position from the center of the circle.  You will need to convert those coordinates to fit the 0,0 (upper left) client window position.  Also the 0 degree is right most position of the circle going counter-clockwise while yours is the top most going clockwise (conversion required here also).

Good luck.

Edited by Nine

Not much of a signature but working on it...

Spoiler

##### Share on other sites

I don't really need a code to work just an idea of how I could do the code by myself.

Ya, but you got me hook.  So I didn't work (having fun) for nothing :

```#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <Math.au3>

Opt("MustDeclareVars", True)

Global Const \$SIZE = 400, \$BORDER = 50, \$RADIUS = (\$SIZE - 2 * \$BORDER) / 2, \$CIRCLE_SIZE = 4

_GDIPlus_Startup()

Example()

Func Example()
Local Const \$aDegree = [10, 92, 318, 323, 325, 327]

Local \$hGUI = GUICreate("GDI+", \$SIZE, \$SIZE)
GUISetState(@SW_SHOW)

Local \$hGraphic = _GDIPlus_GraphicsCreateFromHWND(\$hGUI)
Local \$hPen = _GDIPlus_PenCreate(0xFFFF0000, \$CIRCLE_SIZE)
_GDIPlus_GraphicsSetSmoothingMode(\$hGraphic, \$GDIP_SMOOTHINGMODE_HIGHQUALITY)
_GDIPlus_GraphicsDrawEllipse(\$hGraphic, \$BORDER, \$BORDER, \$SIZE - \$BORDER * 2, \$SIZE - \$BORDER * 2, \$hPen)

For \$i = 0 To UBound(\$aDegree) - 1
_GDIPlus_GraphicsFillEllipse(\$hGraphic, \$x, \$y, \$CIRCLE_SIZE * 2, \$CIRCLE_SIZE * 2)
Next

Do
Until GUIGetMsg() = \$GUI_EVENT_CLOSE

_GDIPlus_PenDispose(\$hPen)
_GDIPlus_GraphicsDispose(\$hGraphic)
EndFunc   ;==>Example```

Edited by Nine

Not much of a signature but working on it...

Spoiler

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...