Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Drawing a distance circle on map

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 2, 2017 4:12 AM
(9013 views)

Dear All,

It's my first post here, I hope someone can help.

I'm plotting several port cities on a map as part of an simple application I'm building.

Next step I want to take is to draw circles on the map indicating a user-defined distance from the city defined by a value in the data-table which is modified via scripting. Simple example: plot the location of port of Rotterdam on a map, and draw a 10 nm circle around this location on the map.

Do you have any suggestions how to program this in JSL (if necessary) and plot this?

Thanks in advance for your help.

Regards,

Bart

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted
As chance would have it, I've done this... The attached script should give you some clues as to how to approach the problem. change the centX and centY variables to the coordinates of your location. You can find these using google maps, right-clicking on the location and selecting "what is here?".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

7 REPLIES 7

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

I don't know if this solution will eventually involve a script, but even if it will, I recommend performing the action interactively first, if possible. I also recommend using JMP objects as much as possible instead of 'starting from scratch.' I suggest that you use Graph Builder. It has a role (drop zone) for shapes or maps. Your data will include the latitude and longitude for each city. They will go into the Y and X roles, respectively. The Graph Builder also has a role for size. You can experiment with different values in this column for each city to obtain the correct diameter.

You can save the script for this finished Graph Builder to re-use it or to start your own script.

Learn it once, use it forever!

Highlighted
As chance would have it, I've done this... The attached script should give you some clues as to how to approach the problem. change the centX and centY variables to the coordinates of your location. You can find these using google maps, right-clicking on the location and selecting "what is here?".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

Thank you both; I ended up using the 2nd solution. I did a brief cross-check to sort out the conversion of miles to degrees based on a known distance between two locations and the results match.

Regards,

Bart

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

I have a brief additional question that I would like to ask.

The radius of the circles is user-defined and may change while using the

script. What would be straightforward way of updating the circles radius

interactively?

I have already experience with updating individual graphical elements

via references, but little experience with updating ranges of graphical

elements. Would I need to store this information (the reference to the

relevant circles?) in a list or matrix?

Thanks again for your help,

Regards,

Bart

The radius of the circles is user-defined and may change while using the

script. What would be straightforward way of updating the circles radius

interactively?

I have already experience with updating individual graphical elements

via references, but little experience with updating ranges of graphical

elements. Would I need to store this information (the reference to the

relevant circles?) in a list or matrix?

Thanks again for your help,

Regards,

Bart

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

The method for doing this would be to "Remove Graphics Script" and then to reapply "Add Graphics Script" with the new coordinates

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

https://community.jmp.com/t5/Uncharted/Sunshine-Map/ba-p/21004 and https://community.jmp.com/t5/Uncharted/IP-Night-Light/ba-p/21041 might have useful examples as well.

Craige

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Drawing a distance circle on map

Dear Craige, Nelson,

Thank you for your suggestions, the removal of graphicsscript approach

worked well, and I'm now able to adjust the range circles interactively,

based on a user-defined variable.

Regards,

Bart

Thank you for your suggestions, the removal of graphicsscript approach

worked well, and I'm now able to adjust the range circles interactively,

based on a user-defined variable.

Regards,

Bart