# Convert Latitude and Longitude from a Data sheet to points on canvas

**URL:** <https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160>\
**Category:** Libraries\
**Tags:** homework\
**Created:** [March 29, 2020, 11:45pm UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160 "2020-03-29T23:45:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![daileydrabble](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@daileydrabble](https://discourse.processing.org/u/daileydrabble)\
**Post date:** [March 29, 2020, 11:45pm UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160/1 "2020-03-29T23:45:03Z")

</div>

Hi, I’m having an issue in my beginning coding class. I want to take the latitude and longitude for cave locations in Missouri and put them over an image of the state where they are. I have an excel sheet with the latitude and longitude, but I don’t know how to convert that into points for my 280x325 canvas.

It’s been a while since I’ve been in a math class and my coding teacher hasn’t gotten back to me on whether I can visualize this data like this. Is there a way to convert the points to show where they are in relation to each other? Is there some formula I can do either in the excel sheet or in processing to make this conversion so I can map these points?

Thank you!

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [March 30, 2020, 2:30am UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160/2 "2020-03-30T02:30:27Z")

</div>

Please check [unfoldingmap](http://unfoldingmaps.org/) library. It should allow you to do this. Start by running the simple demos. Make sure you are using the P2D renderer.

If you want to transform the value manually, you can do a quick google search and you will get the algorithm:

- [https://www.youtube.com/watch?v=ZiYdOwOrGyc](https://www.youtube.com/watch?v=ZiYdOwOrGyc)
- [Mapping Earthquake Data Coding Challenge – Geeks out of the box](https://antwerpenhomeschooling.wordpress.com/2017/03/19/mapping-earthquake-data-coding-challenge/)

The first link shows the code in javascript.

Kf

---

<div class="post-metadata">

**Author:** ![daileydrabble](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@daileydrabble](https://discourse.processing.org/u/daileydrabble)\
**Post date:** [March 31, 2020, 8:44am UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160/3 "2020-03-31T08:44:42Z")

</div>

The Unfolding Map unfortunately isn’t compatible with the version of Processing I have, so I can’t load any of the examples and watching the videos helped me understand the conversion, but the version of Processing I have also can’t read the function command so I don’t know how to translate the algorithm into the code.

Is there a way to make the Unfolding map compatible with what I have?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 31, 2020, 1:30pm UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160/4 "2020-03-31T13:30:56Z")

</div>

You could try to download an older version of processing

---

<div class="post-metadata">

**Author:** ![PhTruillet](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/phtruillet/32/66_2.png) [@PhTruillet](https://discourse.processing.org/u/PhTruillet)\
**Post date:** [April 3, 2020, 8:17pm UTC](https://discourse.processing.org/t/convert-latitude-and-longitude-from-a-data-sheet-to-points-on-canvas/19160/5 "2020-04-03T20:17:59Z")

</div>

Actually, you may change the renderer in Processing 3 🙂  
Switch to FX2D instead and it will work!
