2

I have geotagged pictures which I have linked in QGIS to a point shapefile. In the attribute table of the shapefile, you can find the complete path to every picture, so theoretically it is clickable. In QGIS I have an action which opens the photo.

Now I would like to create a 3D map with qgis2threejs where I have these points for the photos and the photos should be openable / clickable within the browser view.

So by clicking on the object of the 3D map in my web browser I would like to have a clickable path to the photo (opens by clicking) in the attribute table. Now I have only the path which I can copy and paste.

Even better would be if I could somehow put the whole picture into the object's attribute table or a clickable thumb nail of it.

Do I need to put the file path somehow in a clickable mode (hHTML?) after I have created the 3D map?


When I open my 3D map's JavaScript file with Notepad++ I see the following code for the point layer that contains the file path to the photo (excerpt):

// Layer 1
lyr = project.addLayer(new Q3D.PointLayer({q:1,objType:"Box",type:"point",name:"161020_Site_visit"}));
lyr.a = ["filepath","filename","DateTimeOr","GPSAltitud","GPSAltit_1","GPSDateSta","GPSImgDire","GPSImgDi_1","GPSLatitud","GPSLatit_1","GPSLongitu","GPSLongi_1","GPSMapDatu","GPSSatelli","GPSTimeSta","GPSVersion","ImageDescr"];

lyr.f[0] = {d:0.267671923173,h:0.267671923173,m:0,rotateX:90,w:0.267671923173,pts:[[-51750.4998443,-122555.375632,0.178447948782]]};

lyr.f[0].a = ["D:\\Photos\\DSCN2858.JPG","DSCN2858.JPG","2016:10:20 10:44:55","undef","0",null,"undef",null,"0",null,"0",null,null,null,"00:00:00","2 3 0 0",null];

Is there no way to manually (by adding some code like Photo1) make the photos clickable like an clickable URL, so that one could just click on D:\Photos\DSCN2858.JPG to open the photo?

I found this Stack Overflow Q&A that deals with a very similar question, but I don't know how to implement it for this purpose.


The problem seems to be that web browsers (this is where you watch the 3D map) don't allow top open local files (the photos). There seems to be a way to circumvent this, but apparently it requires more coding skills to not break the JavaScript file which comes with your 3D map.

1

I suppose you only have different information about the shape file when you open the attribute table. Also, you open this info by going to Properties or clicking the layer with the 'Info' pointer.

I don't think qgis2threejs is capable of that function. From my experience, I think that it is only capable for viewing layers in a 3D environment without actually interacting with them. Maybe a suitable option would be ArcScene together with ArcGIS online which may have that functionality.

  • Thanks for the reply. I'm still wondering if there is no way to make the file path which I can see in the table when I click on the object in the 3D map (within a web browser) clickable? Wouldn't it be possible to make the file path clickable like an URL by editing it in the Java files that qgis2threejs created? – SnoopyTheCat Oct 24 '16 at 8:19
  • So basically it would just be a clickable file path to the photo like an URL. – SnoopyTheCat Oct 24 '16 at 8:59
  • I've updated the question and precised it regarding manually changing the java script file that belongs to the 3D map created by Qgis2threejs. – SnoopyTheCat Oct 25 '16 at 8:13
0

My images are labeled '1.jpg' - '104.jpg' to go along with my points labeled with an attribute table entry ranging from '1' - '104'. My images are located in a new folder that I've created below where my HTML file lives. My file path is '.../assets/images/'

What I've done is to make a series of four new entries in my attribute table and then concatenate them to form a line of HTML which the browser will be able to read.

Station Label - Numerical label of your station

Prefix - All should read something like '<img src=assets/images/'

Suffix - '.jpg>'

Image - This should concatenate all three of the previous columns. The expression in this example would be "Prefix" || "Station Label" || "Suffix"

This results in a line of HTML that the browser can read:

<img src=assets/images/04.jpg>

Then you can delete the Prefix, Suffix, and Station Label (if you want). Once you export then the images will be rendered in your attribute table. You may want to adjust the styling in the Qgis2threejs.css file to adjust the way that these images are displayed.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.