我需要帮助Georgef我的ima
我有将近2000张地图和一个txt文件,其中包含插入点的名称和坐标:(:(。我需要一个lsp,可以将每个图像插入到其位置。*类似georef的东西*问题是如何从txt文件中插入图像名称,以及我需要将图像文件放置在何处。我的想法是:(重复(长度列表A)
(setq)
氏族(N brojac lista)
x(第n个0族)
y(第1个氏族)
ime(第2个氏族)
tackaumetanja(列表x y)
)
(命令“\u IMAGE”“\u ATTACH”ime(tackaumetanja)1000 0.0)
(setq brojac(+brojac 1)) 从我的谷歌代码下载此文件
https://code.google.com/p/geaux-cad/downloads/detail?name=GeoRefImg.VLX&can=2&q=
它是一个工具栏,用于处理地理参考图像。 它是如何工作的?我已经在txt:geek中找到了放置和图像文件的坐标:。。。接下来我需要做什么?
它说当我点击插入的图像时,并没有找到文件。此外,我只使用普通Autocad 一个重缩放的图像lisp你需要有jpg和一个文本文件jgw为每个,插入点不重要使用0,0
;;;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)
;« Last Edit: April 12, 2011, 09:43:43 am by ronjonp »
(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 <" 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)
(command "draworder" (entlast) "" "B")
;« Last Edit: Dec 16 2011 send to back added by alan »
但是如果我没有世界档案呢。我的意思是jgw tiff等。我只有文本(.txt)文件,有两个点和缩放图像列表
我不太熟悉这个世界的东西:叹气: 这是一个JGW示例,它与单个图像JPG匹配。co ORD是262004.6475773917.244
2.411324381479
0
0
-2.411324381479
262004.647635524630
5773917.244163344000 谢谢你,比格尔。如果我成功了,我会告诉你的 从上述链接下载并加载lisp文件后
通过键入GeoRefImg命令启动GeoRefImg。GeoRefImg提示选择对象(现有图像),然后执行由世界文件(TFW、TFWx、JGW、JPW、PGW、GFW、BPW、SDW、EWW、WLD…)控制的重新定位和缩放。在原始光栅文件的文件夹中搜索世界文件。
附加命令WORLDOUT可以从现有定位图像创建新的世界文件。自版本2.5以来,支持旋转图像。
GeorgeFimg检查世界文件的格式,并拒绝使用“可疑”世界文件更新图像。您可以控制公差(精度)和一些飞行前检查:
(setq GeoRefCheckTol 0.03)
(setq GeoRefCheckIgnore T) Jonathann添加了“从上述链接下载并加载lisp文件后”。
很抱歉
页:
[1]
2