<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div><span title="Responder al remitente (r)" style="" name="btnTbl_compose:reply_to_sender" id="btnTbl_compose:reply_to_sender" cellpadding="0" class="comboButton colorBTK4 comboButtondown"><span id="btnTbl_compose:reply_to_sender_outter" class="buttonOutter buttonOutter-menu buttonOutter-menu buttonOutterflatRight colorBT1 colorBTK4 buttonOutterdown" style="">Hello,<br>This is my 'amateur' solution:<br><br>def getXYfromFoto(foto):<br>&nbsp; proc=subprocess.Popen('exif -mt GPSLatitude '+foto, shell=True,stdout=subprocess.PIPE)#foto: is the route to a jpg image from a camera Sony&nbsp; DSC-HX5V<br>&nbsp; stdout_value = proc.communicate()[0]<br>&nbsp; da=stdout_value[0:len(stdout_value)-1]<br>&nbsp; sp=da.split(', ')<br>&nbsp;
 lat=float(sp[0].replace(',','.'))+float(sp[1].replace(',','.'))/60+float(sp[2].replace(',','.')[0:5])/3600<br>&nbsp; print lat<br>&nbsp; proc2=subprocess.Popen('exif -mt GPSLongitude '+foto, shell=True,stdout=subprocess.PIPE)<br>&nbsp; stdout_value = proc2.communicate()[0]<br>&nbsp; da2=stdout_value[0:len(stdout_value)-1]<br>&nbsp; sp2=da2.split(', ')<br>&nbsp; lon=float(sp2[0].replace(',','.'))+float(sp2[1].replace(',','.'))/60+float(sp2[2].replace(',','.')[0:5])/3600<br>&nbsp; print lon<br>&nbsp; proc3=subprocess.Popen('exif -mt GPSLongitudeRef '+foto, shell=True,stdout=subprocess.PIPE)<br>&nbsp; stdout_value = proc3.communicate()[0]<br>&nbsp; da3=stdout_value[0:len(stdout_value)-1]<br>&nbsp; print da3<br>&nbsp; if da3[0:1]=='W':<br>&nbsp;&nbsp;&nbsp; lonLat='"-'+str(lon)+' '+str(lat)+'"'<br>&nbsp; else:<br>&nbsp;&nbsp;&nbsp; lonLat='"'+str(lon)+' '+str(lat)+'"' <br>&nbsp; print lonL #in wgs84 <br>&nbsp; proc4=subprocess.Popen('echo '+lonLat+' |
 m.proj -i --quiet', shell=True,stdout=subprocess.PIPE)#GRASS must be running, in my case eur50 datum.<br>&nbsp; stdout_value = proc4.communicate()[0]<br>&nbsp; da4=stdout_value[0:len(stdout_value)-1]<br>&nbsp; print 'da4'<br>&nbsp; print da4<br>&nbsp; pse=da4.split(' ')<br>&nbsp; XY=pse[0].replace('\t',',')<br>&nbsp; print 'XY'<br>&nbsp; print XY<br>&nbsp; return XY# in UTM eu50 30N<br><br>hope usefull for you<br>Juan M. Garijo<br></span></span></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De:</span></b> Joshua Arnott &lt;josh@snorfalorpagus.net&gt;<br><b><span style="font-weight: bold;">Para:</span></b> grass-user@lists.osgeo.org<br><b><span style="font-weight: bold;">Enviado:</span></b> sáb,14 mayo, 2011 16:55<br><b><span style="font-weight:
 bold;">Asunto:</span></b> [GRASS-user] Vector point from EXIF GPS data<br></font><br>Hi everyone,<br><br>Has anyone tried to import the GPS data stored in a JPEG's EXIF metadata into GRASS? I've had some luck, but the system I've come up with is very clunky (mixture of python pexif module and then m.proj to assist import). I'm wondering if anyone has come across anything more robust, maybe as a shell script with jhead?<br><br>Josh.<br>_______________________________________________<br>grass-user mailing list<br><a ymailto="mailto:grass-user@lists.osgeo.org" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></div></div>
</div></body></html>