0

I'm using R to plot some points on a Map using the Maps Library. Here is a sample code of what it may look like.

map(database='world', fill=TRUE, border=0, bg='gray', col='white') p <- points(43.951, -79.43155, col=2, pch=20,cex=20)

Basically, I'm plotting a Longitude and Latitude point on a Map. Then, I'm exporting this Image onto a PNG file. I want to figure out how to retrieve where the Point is on X and Y coordinate of the Image. Thank you.

Edit: I'm actually using a Jpeg file and this is the code that outputs to the image file.

jpeg(path.jpg, width=5000, height=5000) mapping and plotting functions dev.off()

Steven
  • 604
  • 6
  • 11
  • You could read the jpeg with readJPEG in the jpeg package and then search the raster to find the red pixels. Not sure why you would want to do this though. – Richard Telford Apr 04 '16 at 21:12
  • I'm embedding this image into a JavaFX application. I wanted to output the x,y coordinates into a txt or csv files to make a more dynamic GUI. For example, clicking a city plotted by Longitude and latitude will center on JavaFX, that location. – Steven Apr 04 '16 at 21:17

0 Answers0