本文将分享织梦给arclist列表自动编号教程的详细内容,并且还将对织梦怎么自动采集发布进行详尽解释,此外,我们还将为大家带来关于ArcGisPython脚本——要素图斑自动编号,自上而下,从左到右、
本文将分享织梦给arclist列表自动编号教程的详细内容,并且还将对织梦怎么自动采集发布进行详尽解释,此外,我们还将为大家带来关于ArcGis Python脚本——要素图斑自动编号,自上而下,从左到右、dedecms arclist列表循环调用顶级栏目名称方法、DedeCMS织梦arclist的分页使用教程、dedecms织梦模板标签 arclist列表循环调用顶级栏目名称的相关知识,希望对你有所帮助。
本文目录一览:- 织梦给arclist列表自动编号教程(织梦怎么自动采集发布)
- ArcGis Python脚本——要素图斑自动编号,自上而下,从左到右
- dedecms arclist列表循环调用顶级栏目名称方法
- DedeCMS织梦arclist的分页使用教程
- dedecms织梦模板标签 arclist列表循环调用顶级栏目名称
织梦给arclist列表自动编号教程(织梦怎么自动采集发布)
今天看见一个标签[field:global runphp='yes' name=autoindex][/field:global]开始有点奇怪他的原理,后来分析了下模板。还是很简单的。
arclist标签在执行过程中,会声明一个全局变量$GLOBALS['autoindex']=0,然后随着执行每一条数据对其自增长$GLOBALS['autoindex']++,而runphp='yes'是你想在标签内进行有限的PHP编程前必须声明的。
织梦列表自动编号的办法(注意autoindex itemindex 的使用心得区别 ):
[field:global name=autoindex runphp="yes"]@me=@me+1;[/field:global]
{dede:global name=itemindex runphp="yes"}@me=@me+1;{/dede:global}
其他几个列表标签的自增长如下,在网上找的,新版是否一样还需要验证
arclist 标签下使用 [field:global.autoindex/] 默认从1开始
channel 标签下使用 [field:global.autoindex/] 默认从0开始
channelartlist 标签下使用 {dede:global.itemindex/} 默认从1开始
对这个自增标签进行一个简单的小扩展,
<span>[field:global runphp='yes' name=autoindex]
if (@me < 9) @me = 0.@me;
else @me = @me;
[/field:global] </span>
这样就会显示 01 02 03...09这样的编号列表样式
本文章网址:http://www.ppssdd.com/code/10798.html。转载请保留出处,谢谢合作!ArcGis Python脚本——要素图斑自动编号,自上而下,从左到右
插个广告,制作ArcGIS的Tool工具学习下面的教程就对了:
零基础学习Python制作ArcGIS自定义工具观看链接
《零基础学习Python制作ArcGIS自定义工具》课程简介
以下是正文:
原理:
利用图斑最小外包矩形的左上角坐标(数学坐标)Y坐标将序、X坐标升序的方式获取自上而下,从左到右的要素记录排序,然后遍历编号。
"!shape.extent.xmin!"计算要素最小外包矩形的左上角X坐标;
"!shape.extent.ymax!" 计算要素最小外包矩形的左上角Y坐标;
字段计算器中可做Python脚本表达式用,Arcpy中其类型为Python_9.3,在“解析ArcGis字段计算器”相关博文中,已对上面代码信息进行过说明。
代码如下:
#要素类路径
fcpath="C:/Users/Administrator/Desktop/shp/demo.shp"
#新建Ymax/Xmin两个字段,分别计算图斑最小外包矩形的左上角Y、X坐标(数学坐标)
arcpy.AddField_management(fcpath,"Xmin","DOUBLE")
arcpy.AddField_management(fcpath,"Ymax","DOUBLE")
#字段计算,计算坐标,计算表达式类型为Python_9.3
arcpy.CalculateField_management(fcpath,"Xmin","!shape.extent.xmin!","PYTHON_9.3")
arcpy.CalculateField_management(fcpath,"Ymax","!shape.extent.ymax!","PYTHON_9.3")
#迭代更新游标,"Ymax D;Xmin A" 意为Ymax字段将序,Xmin字段升序
rows=arcpy.UpdateCursor(fcpath,"","","","Ymax D;Xmin A")
i=0 #code source: https://www.cnblogs.com/yzhyingcool/ QQ:975601416
for row in rows:
row.setValue("BSM",i+1) #BSM字段(整型)存放编号,每迭代一次+1
rows.updateRow(row)
i+=1
del row
del rows
arcpy.DeleteField_management(fcpath,"Xmin;Ymax")
dedecms arclist列表循环调用顶级栏目名称方法
-
添加到include/extend.func.PHP里function gettopname($aid){global $dsql;$sql = "SELECT tt.typename,tt.typedir from arctiny as a join arctype as t on a.typeid = t.id join arctype as tt on t.topid=tt.id where a.id = $aid" ;$row = $dsql->Getone($sql);$typename = $row['typename'];$typedir = $row['typedir'];$bodytag = str_replace("{cmspath}",$url,$typedir);return $lit_imglist = $typename;}2.arclist调用标签(显示顶级栏目名称)[field:id function='gettopname(@me)'/]
DedeCMS织梦arclist的分页使用教程
上一篇:dedecms织梦rss输出改成全文输出
下一篇:DEDECMS点击图片进入下一页功能实现教程
dedecms织梦模板标签 arclist列表循环调用顶级栏目名称
添加到include/extend.func.PHP里function gettopname($aid){
global $dsql;
$sql = "SELECT tt.typename,tt.typedir from arctiny as a join arctype as t on a.typeid = t.id join arctype as tt on t.topid=tt.id where a.id = $aid" ;
$row = $dsql->Getone($sql);
$typename = $row['typename'];
$typedir = $row['typedir'];
$bodytag = str_replace("{cmspath}",$url,$typedir);
return $lit_imglist = $typename;
}
2.arclist调用标签(显示顶级栏目名称)
[field:id function='gettopname(@me)'/]
今天的关于织梦给arclist列表自动编号教程和织梦怎么自动采集发布的分享已经结束,谢谢您的关注,如果想了解更多关于ArcGis Python脚本——要素图斑自动编号,自上而下,从左到右、dedecms arclist列表循环调用顶级栏目名称方法、DedeCMS织梦arclist的分页使用教程、dedecms织梦模板标签 arclist列表循环调用顶级栏目名称的相关知识,请在本站进行查询。
本文标签: