Jump to content

Bing Aerial Imagery into AutoCAD 2012 or AutoCADMAP 2011?


Recommended Posts

Posted

As per title?

 

Is it possible to bring Bing Aerial Imagery into AutoCAD 2012 or AutoCADMAP 2011?

 

Regards

Posted

Not OOTB to where they are scaled and located where they need to be like you can with Google Earth images. You may want to check the Open Source site for Map Guide and see if anyone uses it in MapGuide OS and if they have any pointers.

Posted

Do it every day just create a jpg and if you can a JGW this is the georeferenced link, just insert an image.

 

The source of the jpg varies Google earth etc or in our case from our own internal aerial photos using our mapping system.

 

Basic level bring and rescale based on two known points.

 

Using jgw put image anywhere any scale and run the rescale lisp the source was I think from The Swamp.

 

;;;Reads world tiff file (.jgw) to scale and place image correctly in autocad.
;;;First insert all tiff images into drawing at whatever scale and insertion point.
;;;If the jgw exists in same directory and is named the same as the image selected,
;;;it will automatically be found and the image will be scaled and placed. If it is
;;;not in the same directory, the user can browse for the file.
;;;03.23.2011 Added support to create jgw files as well as support rotated images 
;;;Needs a file with 6 lines (ScaleX Rotation -Rotation -ScaleY TopLeftXCoord TopLeftYCoord)
 (vl-load-com)
 (defun ss->lst (ss / e n out)
   (setq n -1)
   (while (setq e (ssname ss (setq n (1+ n)))) (setq out (cons (vlax-ename->vla-object e) out)))
 )
 (defun _writefile (filename lst / file result)
   (cond ((and (eq 'str (type filename)) (setq file (open filename "w")))
   (foreach x lst
     (write-line
       (cond ((= (type x) 'str) x)
      ((= (type x) 'int) (itoa x))
      ((= (type x) 'real) (rtos x 2 6))
      ((vl-prin1-to-string x))
       )
       file
     )
   )
   (close file)
   filename
  )
   )
 )
 (defun _readfile (filename / file result)
   (cond
     ((and (eq 'str (type filename)) (setq file (open filename "r")))
      (while (setq line (read-line file)) (setq result (cons (vl-string-trim " " line) result)))
      (close file)
      (reverse result)
     )
   )
 )
 (setq opt "ReadIt")
 (initget 0 "ReadIt WriteIt")
 (setq opt (cond ((getkword (strcat "\nImage World File [ReadIt/WriteIt] <" opt ">: ")))
   (opt)
    )
 )
 (princ "\nSelect image(s): ")
 (setq pre (getvar 'dwgprefix))
 (if (and (setq ss (ssget '((0 . "image")))) (setq ss (ss->lst ss)))
   (foreach image ss
     (setq name    (vlax-get image 'name)
    hgt     (vlax-get image 'height)
    wdth    (vlax-get image 'width)
    imhgt   (vlax-get image 'imageheight)
    imwdth  (vlax-get image 'imagewidth)
    rot     (vlax-get image 'rotation)
    bpt     (vlax-get image 'origin)
    imgpath (vl-filename-directory (vlax-get image 'imagefile))
    jgw     (strcat imgpath "\\" name ".jgw")
     )
     (if (= opt "ReadIt")
(progn
  (if (and (or (setq jgw (findfile (strcat pre name ".jgw")))
        (setq jgw (findfile (strcat imgpath "\\" name ".jgw")))
        (setq jgw (getfiled (strcat "***Select <<" name ".jgw>>***") pre "jgw" 16))
    )
    (setq pre (strcat (vl-filename-directory jgw) "\\"))
    (setq data (mapcar 'atof (_readfile jgw)))
    (> (length data) 5)
    (setq l1 (car data))
    (setq mvpt (list (nth 4 data) (nth 5 data) 0.0))
      )
    (progn (vla-put-imageheight image (* hgt l1))
    (vla-put-imagewidth image (* wdth l1))
    (vla-put-rotation image (cadr data))
    (setq rot (vlax-get image 'rotation))
    (setq bpt (polar bpt (+ (/ pi 2.) rot) (* hgt l1)))
    (vlax-invoke image 'move bpt mvpt)
    (princ (strcat "\njgw File Read - " jgw))
    )
    (princ "\njgw file NOT found or not correctly formatted!")
  )
)
(progn (setq bpt (polar bpt (+ (/ pi 2.) rot) imhgt))
       (if (setq jgw (_writefile
         (strcat imgpath "\\" name ".jgw")
         (list (/ imhgt hgt)
        rot
        (strcat "-" (rtos (abs rot) 2 6))
        (strcat "-" (rtos (abs (/ imwdth wdth)) 2 6))
        (rtos (car bpt) 2 6)
        (rtos (cadr bpt) 2 6)
         )
       )
    )
 (print jgw)
 (princ "\nError writing file...")
       )
)
     )
   )
 )
 (princ)


;  « Last Edit: April 12, 2011, 09:43:43 am by ronjonp »  

  • 7 months later...
Posted

You can also use Plex.Earth, it an AutoCAD add-on that lets you import georeferenced images from Google Earth with just a few clicks.

 

It's a commercial program but they give a 2-week fully functional trial version:

 

http://www.plexscape.com/?ptnsrc=bavas

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...