TransWikia.com

How to plot geographic coordinates with tikz?

TeX - LaTeX Asked by JosephRob on March 28, 2021

Hello I’m trying to plot geographic coordinates of a route between real locations. I’m struggling to show the graph in full page or zoomed in. I searched a bit on internet and I can’t seem to find the answer I’m looking for.

I’m thinking about either having an alternative to showing the exact positions of the nodes or just finding a method to correctly plot these nodes. Here’s what I currently have:

begin{tikzpicture}[shorten >=1pt,scale=0.8,every node/.style={scale=1}]
  tikzstyle{vertex}=[circle,fill=black!25,minimum size=14pt,inner sep=0pt]
    
  foreach name/x/y/z in { -1/45.695555/-73.491674/-1, 7/45.654718/-73.494169/7, 18/45.672313/-73.534913/18, 22/45.661651/-73.549355/22, 32/45.603429/-73.636702/32, 39/45.605645/-73.626765/39, 34/45.610551/-73.619080/34, 33/45.620115/-73.626962/33, 41/45.592402/-73.645209/41, 42/45.602253/-73.637504/42, 44/45.601379/-73.637200/44, 40/45.586000/-73.649305/40, 36/45.594348/-73.625702/36, 38/45.621705/-73.626161/38,-1/45.695555/-73.491674/-1}
      node[circle,draw] (G-name) at (x,y){$z$} ;
    
  foreach from/to in {-1/7,7/18,18/22,22/32,32/39,39/34,34/33,33/41,41/42,42/44,44/40,40/36,36/38,38/-1}
    draw (G-from) -- (G-to) node [midway,above,sloped](G-from-to){};
    
end{tikzpicture}

Do you know a way to show my content in a full page ?

Thank you.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP