Using AutoLISP / Visual Lisp to Geo-Locate Geotagged Images

Using AutoLISP / Visual Lisp to Geo-Locate Geotagged Images

CodeDing
Advisor Advisor
6,095 Views
23 Replies
Message 1 of 24

Using AutoLISP / Visual Lisp to Geo-Locate Geotagged Images

CodeDing
Advisor
Advisor

Hello all,

 

I had to come up with a unique solution recently and I feel that it may benefit others here. I have attached the Lisp "PHOTOS.lsp" (that is also the command name).

 

The lisp accomplishes 1 task: Locate any Geotagged photos (from user selected folder [and all sub-folders]) and show their locations in a Geo-Located dwg via a block you choose, which gets hyperlinked to the image.

 

When you open the lisp, you will need to update the "Variable Inputs" section at the beginning of the PHOTOS command (toward bottom). Here's a preview of that section:

  ;; Variable Inputs
  (setq blkName "MyBlockName"        ;<-- the block to insert for all photo locations (do NOT use dynamic block)
        blkDWG "C:\\users\\my folder\\myblockdrawing.dwg" ;<-- if block not in current dwg, where to find it
        lyrName "_Geo-Photos"        ;<-- layer where blocks will be inserted
        lyrColor 11                  ;<-- if necessary to create layer
        defaultBrowseLocation "C:\\" ;<-- the default path that LM's folder browser opens to
  );setq

 

Here's some screenshots of the workflow:

Run command

CodeDing_0-1618518608529.png

 

Browse folders dialog will appear, select the folder which you want to search for all photos

image.png

 

The command begins, once complete you will be prompted:

CodeDing_1-1618518801744.png

 

Here is an example of what my final product looks like.

CodeDing_2-1618518819947.png

(no, I won't be sharing my camera block)

 

 

SOME IMPORTANT NOTES:

- Clearly this only works if your drawing is Geo-Located (any vertical)

- Most images are taken from phones, and their GPS accuracy can vary, so the location is NOT 100% reliable. I think on average it's about a 40 foot radius of accuracy.

- Sometimes a phone coordinate can be the same for multiple photos, so you might see multiple stacked above each other.

- Yes, hyperlinks are created and when you Ctrl + Click the application is Minimized... AutoCAD knows about this 'feature' and has never fixed it (it's probably not an easy fix, idk).

- Not all images are Geotagged, so if you are noticing that not all photos are being captured, it's most likely because they were not Geotagged.

 

If you have any questions, please ask.

Best,

~DD

 

Accepted solutions (1)
6,096 Views
23 Replies
Replies (23)
Message 21 of 24

JanardFugro
Contributor
Contributor

Hi CodeDing,

 

Now it is working, Thank you very much for your help. 

Message 22 of 24

cslatteryAXGRE
Advocate
Advocate

I am using this also. It works great. But is there a way to rotate the block to match the image rotation so I can see what direction the photo was taken.

0 Likes
Message 23 of 24

CodeDing
Advisor
Advisor

@cslatteryAXGRE ,

 

Yes, it's possible.

Post your block please and I'll see what I can put together for everyone.

 

Actually, please post 2 blocks:

- One as a generic block for images with no direction properties

- One as a directional block, for images with direction properties

 

Best,

~DD

0 Likes
Message 24 of 24

cslatteryAXGRE
Advocate
Advocate

Sorry, I forgot about this thread. I have attached 1 block. I do not know what to do with it to make it a direction block.

 

Chris

0 Likes