乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 10|回复: 10

[编程交流] 我需要帮助Georgef我的ima

[复制链接]

2

主题

8

帖子

6

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 18:35:04 | 显示全部楼层 |阅读模式
我有将近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))
回复

使用道具 举报

35

主题

140

帖子

108

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
177
发表于 2022-7-5 18:46:02 | 显示全部楼层
从我的谷歌代码下载此文件
 
https://code.google.com/p/geaux-cad/downloads/detail?name=GeoRefImg.VLX&can=2&q=
 
它是一个工具栏,用于处理地理参考图像。
回复

使用道具 举报

2

主题

8

帖子

6

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 18:48:04 | 显示全部楼层
它是如何工作的?我已经在txt:geek中找到了放置和图像文件的坐标:。。。接下来我需要做什么?
 
它说当我点击插入的图像时,并没有找到文件。此外,我只使用普通Autocad
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 18:53:44 | 显示全部楼层
一个重缩放的图像lisp你需要有jpg和一个文本文件jgw为每个,插入点不重要使用0,0
 
  1. ;;;Reads world tiff file (.jgw) to scale and place image correctly in autocad.
  2. ;;;First insert all tiff images into drawing at whatever scale and insertion point.
  3. ;;;If the jgw exists in same directory and is named the same as the image selected,
  4. ;;;it will automatically be found and the image will be scaled and placed. If it is
  5. ;;;not in the same directory, the user can browse for the file.
  6. ;;;03.23.2011 Added support to create jgw files as well as support rotated images
  7. ;;;Needs a file with 6 lines (ScaleX Rotation -Rotation -ScaleY TopLeftXCoord TopLeftYCoord)
  8. ;  « Last Edit: April 12, 2011, 09:43:43 am by ronjonp »  
  9. (vl-load-com)
  10. (defun ss->lst (ss / e n out)
  11.    (setq n -1)
  12.    (while (setq e (ssname ss (setq n (1+ n)))) (setq out (cons (vlax-ename->vla-object e) out)))
  13. )
  14. (defun _writefile (filename lst / file result)
  15.    (cond ((and (eq 'str (type filename)) (setq file (open filename "w")))
  16.    (foreach x lst
  17.      (write-line
  18.        (cond ((= (type x) 'str) x)
  19.              ((= (type x) 'int) (itoa x))
  20.              ((= (type x) 'real) (rtos x 2 6))
  21.              ((vl-prin1-to-string x))
  22.        )
  23.        file
  24.      )
  25.    )
  26.    (close file)
  27.    filename
  28.   )
  29.    )
  30. )
  31. (defun _readfile (filename / file result)
  32.    (cond
  33.      ((and (eq 'str (type filename)) (setq file (open filename "r")))
  34.       (while (setq line (read-line file)) (setq result (cons (vl-string-trim " " line) result)))
  35.       (close file)
  36.       (reverse result)
  37.      )
  38.    )
  39. )
  40. (setq opt "ReadIt")
  41. ;  (initget 0 "ReadIt WriteIt")
  42. ;  (setq        opt (cond ((getkword (strcat "\nImage World File [ReadIt/WriteIt] <" opt ">: ")))
  43. ;                  (opt)
  44. ;            )
  45. ; )
  46. (princ "\nSelect image(s): ")
  47. (setq pre (getvar 'dwgprefix))
  48. (if (and (setq ss (ssget '((0 . "image")))) (setq ss (ss->lst ss)))
  49.    (foreach image ss
  50.      (setq name    (vlax-get image 'name)
  51.     hgt            (vlax-get image 'height)
  52.     wdth    (vlax-get image 'width)
  53.     imhgt   (vlax-get image 'imageheight)
  54.     imwdth  (vlax-get image 'imagewidth)
  55.     rot            (vlax-get image 'rotation)
  56.     bpt            (vlax-get image 'origin)
  57.     imgpath (vl-filename-directory (vlax-get image 'imagefile))
  58.     jgw            (strcat imgpath "\" name ".jgw")
  59.      )
  60.      (if (= opt "ReadIt")
  61. (progn
  62.   (if (and (or (setq jgw (findfile (strcat pre name ".jgw")))
  63.                (setq jgw (findfile (strcat imgpath "\" name ".jgw")))
  64.                (setq jgw (getfiled (strcat "***Select <<" name ".jgw>>***") pre "jgw" 16))
  65.            )
  66.            (setq pre (strcat (vl-filename-directory jgw) "\"))
  67.            (setq data (mapcar 'atof (_readfile jgw)))
  68.            (> (length data) 5)
  69.            (setq l1 (car data))
  70.            (setq mvpt (list (nth 4 data) (nth 5 data) 0.0))
  71.       )
  72.     (progn (vla-put-imageheight image (* hgt l1))
  73.            (vla-put-imagewidth image (* wdth l1))
  74.            (vla-put-rotation image (cadr data))
  75.            (setq rot (vlax-get image 'rotation))
  76.            (setq bpt (polar bpt (+ (/ pi 2.) rot) (* hgt l1)))
  77.            (vlax-invoke image 'move bpt mvpt)
  78.            (princ (strcat "\njgw File Read - " jgw))
  79.     )
  80.     (princ "\njgw file NOT found or not correctly formatted!")
  81.   )
  82. )
  83. (progn (setq bpt (polar bpt (+ (/ pi 2.) rot) imhgt))
  84.        (if (setq jgw (_writefile
  85.                        (strcat imgpath "\" name ".jgw")
  86.                        (list (/ imhgt hgt)
  87.                              rot
  88.                              (strcat "-" (rtos (abs rot) 2 6))
  89.                              (strcat "-" (rtos (abs (/ imwdth wdth)) 2 6))
  90.                              (rtos (car bpt) 2 6)
  91.                              (rtos (cadr bpt) 2 6)
  92.                        )
  93.                      )
  94.            )
  95.         (print jgw)
  96.         (princ "\nError writing file...")
  97.        )
  98. )
  99.      )
  100.    )
  101. )
  102. (princ)
  103. (command "draworder" (entlast) "" "B")
  104. ;  « Last Edit: Dec 16 2011 send to back added by alan »
回复

使用道具 举报

2

主题

8

帖子

6

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 19:00:57 | 显示全部楼层
但是如果我没有世界档案呢。我的意思是jgw tiff等。我只有文本(.txt)文件,有两个点和缩放图像列表
我不太熟悉这个世界的东西:叹气:
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 19:10:31 | 显示全部楼层
这是一个JGW示例,它与单个图像JPG匹配。co ORD是262004.6475773917.244
 
2.411324381479
0
0
-2.411324381479
262004.647635524630
5773917.244163344000
回复

使用道具 举报

2

主题

8

帖子

6

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-5 19:13:55 | 显示全部楼层
谢谢你,比格尔。如果我成功了,我会告诉你的
回复

使用道具 举报

35

主题

140

帖子

108

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
177
发表于 2022-7-5 19:22:17 | 显示全部楼层
从上述链接下载并加载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)
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 19:24:33 | 显示全部楼层
Jonathann添加了“从上述链接下载并加载lisp文件后”。
回复

使用道具 举报

35

主题

140

帖子

108

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
177
发表于 2022-7-5 19:33:15 | 显示全部楼层
 
很抱歉
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 13:25 , Processed in 0.806886 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表