Google Street View vanuit een tekening

Deze code rekent de RD positie om naar lat/lon om deze vervolgens in Google maps weer te geven op de kaart en met Street View. Zo krijg je snel inzicht in de locatie van het ontwerp (mits geo-gerefereerd). Het ondersteunt tekeningen gemaakt in zowel millimeter [mm] als meter [m]. Let even op juiste instelling van [Units] in uw tekening. Deze lispcode is getest en te gebruiken in AutoCAD, BricsCAD en GstarCAD Op een pdf tekening wordt dit weergegeven met een cirkel.

Tekening


(defun c:gsv (/)
(command "UCS" "World")									; forced!
(setq getp (getpoint "Select Point to see in Street View"))
(setq getunits (getvar "insunits"))

  (if (= getunits 4)
        (setq rad 2500)
        (setq rad 2.5))
    (entmake (list '(0 . "CIRCLE") (cons 10 getp) (cons 40 rad)))
    (command "-hatch" "s" "l" "" "p" "solid" "")

(if (= getunits 0) (princ "\nDrawing is Unitless! Please correct the units") ()) 	; warning
(if (= getunits 4) (setq getp_x (* (car getp) 0.001)) (setq getp_x (car getp))) 	; for [mm] dwg, otherwise [m] is default
(if (= getunits 4) (setq getp_y (* (cadr getp) 0.001)) (setq getp_y (cadr getp))) 	; for [mm] dwg, otherwise [m] is default
      
;; "Onze Lieve Vrouwetoren" in the The city "Amersfoort" is used as reference "Rijksdriehoek" 
;;  with coordinats [x,y] 155000,463000
                
    (setq referenceRdX 155000)
    (setq referenceRdY 463000)        
    (setq dX (* (- getp_x referenceRdX) 0.00001))
    (setq dY (* (- getp_y referenceRdY) 0.00001))

    (setq sumN (+ 
       (* 3235.65389  dY)
       (* -32.58297 (expt dX 2))  
       (* -0.2475  (expt dY 2))
       (* -0.84978  (expt dX 2)  dY)
       (* -0.0655  (expt dY 3))
       (* -0.01709  (expt dX 2)  (expt dY 2))
       (* -0.00738  dX)
       (* 0.0053  (expt dX 4))
       (* -0.00039  (expt dX 2)  (expt dY 3)) 
       (* 0.00033  (expt dX 4)  dY)
       (* -0.00012 dX  dY)))
		
   (setq sumE (+ 
        (* 5260.52916  dX)
        (* 105.94684 dX  dY)
        (* 2.45656 dX  (expt dY 2))
        (* -0.81885  (expt dX 3))
        (* 0.05594  dX  (expt dY 3))
        (* -0.05607  (* (expt dX 3) dY))
        (* 0.01199  dY)
        (* -0.00256  (expt dX 3)  (expt dY 2))
        (* 0.00128  dX  (expt dY 4)) 
        (* 0.00022  (expt dY 2))
        (* -0.00022  (expt dX 2))
        (* 0.00026  (expt dX 5))))


;;; "Onze Lieve Vrouwetoren" in the city "Amersfoort" is also used as reference 
;;; "WGS84" lat / lon 52.15517 / 5.387208 
	
    (setq referenceWgs84X 52.15517)
    (setq referenceWgs84Y 5.387206)
    (setq latitude (+ referenceWgs84X (/ sumN 3600)))
    (setq longitude (+ referenceWgs84Y (/ sumE 3600)))
    (princ "\n")
    (princ latitude)
    (princ "\n")
    (princ longitude)
    (princ)
	
(setq gsv (strcat "https://maps.google.com/maps?q=&layer=c&cbll=" (rtos latitude 2 4) "," (rtos longitude 2 4)))
(princ "\n")
(princ gsv)
(command "_.-HYPERLINK" "I" "O" "last" "" gsv gsv gsv)

;(startapp "C:\\Program files\\Internet Explorer\\iexplore.exe" (strcat "https://maps.google.com/maps?q=&layer=c&cbll=" (rtos latitude 2 4) "," (rtos longitude 2 4)))    
;(startapp "explorer" (strcat "https://maps.google.com/maps?q=&layer=c&cbll=" (rtos latitude 2 4) "," (rtos longitude 2 4)))

(command "browser" (strcat "https://maps.google.com/maps?q=&layer=c&cbll=" (rtos latitude 2 4) "," (rtos longitude 2 4)))
)




Dutch NL English EN German DE