帖子
|
嗨。我试图使用UNtools(2.6.2)的“导出资产包”功能,但我遇到了一个相当恼人的错误,我希望有人能帮助我纠正它。由于我测试了一些关于数据加载工作簿的其他功能,我在同一个本地地理数据库中创建了多个Utility网络。这导致在我创建的第二个Utility网络中,类名以“_1”结尾。这适用于公用事业网络模型中所有不同的名称。名称问题的例子当我试图出口这个联合国assetpackage,我得到以下错误:“623行,parse_un_class提高ValueError(““{}”不满足正则表达式”.format(名字))ValueError: StructureBoundary_1不满足正则表达式”如果我看看623行“common.py”文件中的错误是指它的以下功能:@lru_cache () def parse_un_class (class_name: str, structure_as_none: bool = False) - >元组:"""解析class_name,提取域名和类类型参数:class_name (str): UN类的路径。structure_as_none (bool):返回结构网络为“None”;默认为“False”。返回:元组:(域名,类类型)示例:>>> parse_un_class("Naper.un. electricline ") ("Electric", "Line") >>> parse_un_class("C:/con.sde/Naper.un.Electric/Naper.un.StructureBoundary") ("Structure", "StructureBoundary") >>> parse_un_class("C:/con.sde/Naper.un.Electric/Naper.un. un. Line")。StructureBoundary", structure_as_none=True) (None, "StructureBoundary")引发:ValueError:如果' ' class_name ' '不是一个有效的UN类。 """ if class_name is None: return None, None # TODO: rewrite this to handle duplicate class names (eg StructureJunction_2) name = os.path.split(class_name)[-1].rpartition('.')[-1] # Using lazy quantifier so Subnet is included with Line and not the domain name res = re.findall('(.+?)(Assembly|Device|Junction|Line|SubnetLine|Boundary|EdgeObject|JunctionObject)$', name, re.IGNORECASE) if not res: raise ValueError("'{}' did not satisfy regex".format(name)) else: domain, class_type = res[0] # Structure domain class types are 'Structure(Junction|Line|Boundary)' if domain.upper() == 'STRUCTURE': class_type = "Structure" + class_type if structure_as_none: domain = None return domain, class_type Now I can see the creator has put in a "TODO" for him/her/it self to rewrite the function so it can support duplicate class names. Does anyone have any ideas about how I would go about editing part of the "parse_un_class(class_name: str, structure_as_none: bool = Fals) -> Tuple:" function so it would accept my "_1" UN elements? I tried to edit: res = re.findall('(.+?)(Assembly|Device|Junction|Line|SubnetLine|Boundary|EdgeObject|JunctionObject)$', name, re.IGNORECASE) to have "_1" at the end like so: res = re.findall('(.+?)(Assembly_1|Device_1|Junction_1|Line|SubnetLine_1|Boundary_1|EdgeObject_1|JunctionObject_1)$', name, re.IGNORECASE) But it throws the same error as before. I don't want to edit too much around in places I have no business editing, but I spend WAY too much time setting up the model to just throw it away and do it again. Any tips, thoughts or ideas are most welcome! PS. I can't upgrade to a higher untools version, since I'm forced to stick to the version of our enterprise server where the UNM will eventually end up.
...查看更多
07-15-2021上午02:03
|
0
|
0
|
499
|
帖子
|
嗨,乔。“Trapez”中奇怪的标志(我在翻译的两个地方都发现了同样的缺陷)。现在我将尝试导入表,也许可以按照您的建议使用join等操作。就像现在一样,从excel导入的表似乎丢失了字段信息(如您所描述的)。我正在组建一个有几个不同学科的新墨西哥大学,作为一名排水工程师,我在电场方面的翻译技能将有所欠缺。让更有知识的专业人员在“熟悉的”电子表格中进行翻译将是一个巨大的优势。如果有什么我能做的,来报答你花时间帮忙,请尽管开口
...查看更多
05-25-202103:09我
|
0
|
0
|
1548
|
帖子
|
嗨,乔。非常感谢您的回复。我将附上Excel文件。如果您对导出/导入时的复选标记有任何提示,我将非常感激
...查看更多
05-20-2021下午11点
|
0
|
2
|
1576
|
帖子
|
嗨。我最近尝试将资产包应用于新创建的UNM。在资产包中,我已经创建了一个重命名表(丹麦语),但是在翻译了许多需要重命名的字段之后,我得到了“必须是Unicode或xml”的错误。为了找出可能在哪里添加了一些不需要的字符,我在重命名表中进行了多次迭代,添加了越来越多的翻译。除了一些关于哪个python行有错误的信息外,似乎没有明确的指示错误发生在哪里,但是我有点犹豫是否要深入研究不同的脚本。我不知道我是否重命名了依赖于“系统”的东西或者发生了什么。PS.必须在ArcGIS Pro中重新命名是乏味的,我想知道是否有可能导出表格,在Excel中重新命名,然后重新导入表格?重命名错误
...查看更多
05-17-2021十二11点
|
0
|
4
|
1622
|
帖子
|
业主希望将人孔设计成垂直线。这听起来很聪明。我经常被要求在人孔中从上到下创建线条(这是在CAD软件中)。这与用于挖掘新排水系统的机器有关。他们有一些IFC软件(我想)只能读取简单的行型。我知道你在购买X距离管道时所支付的长度是从开始人孔中心到接收人孔中心计算的。这当然是对你的资产建模的一种方式。谢谢你的回复,我已经开始根据你的建议取得一些进展
...查看更多
02-17-202104:33我
|
0
|
0
|
1047
|
帖子
|
非常感谢你的回复,兰德尔。你有任何想法,我可以找到一些资源直接在工作簿中使用python代码?在我的源数据中,我有一个字符串字段类型,其中包含有关点类型(80个不同的缩写)的信息,我想将其映射到各自的表。这些点不仅限于人孔,还包括出水口、管道的标高点、泵站等。我认为与工作簿的数据映射工具可能是一个很好的方法去,但我不确定如何在excel中直接应用python代码。我认为这将是有益的,如果有一个选项告诉表达式字段在工作簿应该使用什么。py文件。理想情况下,所有的数据加载工作流程都可以自动运行,这就是为什么我花了这么多时间试图找出最聪明的方法。但等我到了我会放火烧了那座桥。还有一件事突然浮现在我的脑海里。通过为不同的表定义规则,在重新映射过程中节省一些时间,这样明智吗? Example: If an assettype is of "X, Y or Z" value, set cover type to "X" value Arcade expressions is not exactly my strong suite, but by looking at the rules that comes with the assetpackage I might be able to write some fairly simple rules. I'll go have a look and see if this is something that has already been answered prior to this. I really can't thank you enough for taking the time to reply Randall, it really helps me to understand and reflect on things.
...查看更多
02-16-202112:26我
|
0
|
3.
|
2610
|
帖子
|
还有另一个后续!是否建议添加、更改、编辑规则、关系等?在公用事业网络模型中,然后将该模型作为资产包导出,或者您是否会在资产包中进行任何调整,然后将其应用于公用事业网络模型?如果我正确地阅读了资产包的文档介绍,那么将我已经编辑过的资产包应用到现有的UNM中将不会改变UNM中的属性。因此,我认为我应该在UNM中进行更改,然后进行导出。当尝试将包配置为应用于企业服务器上的UNM时,这可能很有用。(我认为与服务器的通信将比我的SSD内部慢)我将坚持推荐的编码值范围(学科之间共享结构的重叠范围)。
...查看更多
02-15-2021上午12:56
|
0
|
0
|
1072
|
帖子
|
哦,我要再加一个问题。是否有一个问题,我添加了很多额外的字段,以结构连接表作为信息持有人?源数据中有描述点的微站元素名称、项目特定坐标系等的字段。这不是UNM所需要的信息,但我宁愿把它放在那里而不显示它,也不愿丢失信息并请求它。你永远不知道可能会出现什么需求,作为一个好的小GIScout(我是一个父亲,所以我可以说一些不好的双关语),我希望能够促进请求。我再次担心我的表现会受到影响,但我只是不确定,如果有人有类似的想法,并且知道我会崩溃和燃烧,我很乐意做好准备
...查看更多
02-15-202112点45
|
0
|
0
|
1076
|
帖子
|
感谢你花时间写了这么长又有深度的回复,兰德尔。我真的很感激它,我看了一下数据加载工具,电子表格相当漂亮。我可能在这一点上是错的,我经常是错的,但数据加载工具将允许“一对一”翻译,对吗?然而,我将要导入的数据将包含关于什么类型的资产组和该点将代表什么类型的资产类型的信息。这就是为排水学科目前使用的方案设置数据库的方式。到目前为止,我一直在使用FME根据源数据中的一个字段来分配资产组和资产类型代码值。示例:源数据包含排水“点”类型的信息。* KO为X型人孔,带Y型盖,疏砂过滤Z厘米,尺寸1000mm圆形混凝土井。在同一字段中,它可能会说“I”,这是一个入口点(从壕沟或类似的地方)。现在我不确定我是否应该将这一点添加到建设表中,或者它是否应该驻留在一个雨水表中。 I'm thinking that I have to not only import data from the source data into the structure network, but also import a lot of that same data to the Stormwater Device tables as well, and hopefully if I set things up correctly, the pipe connections, inlets, outlets etc. will be contained within the structure containers. I'm fearing that the structure network will be severely under pressure, when I have add all the other disciplines as well. But I guess it will be possible to add "views?" where I can sort on different asset groups, and or types, so the true heroes, the maintenance staff, can benefit from having the best possible information available on what ever mobile solutions we decide to go for. Would there be any major issues in adding more fields to the structure network, like diameter, last cleanout date, cover diameter, cover material etc? And I'm a bit confused about what tool that will put the Stormwater Device "Inlet", which is an assembly I thing, inside the Structure Junction "Manhole" that is a container. My initial thought is to import the same point features that displays the manholes into the inlet asset type along with pipe connection and then end up with having one entry from the source data, being loaded into several tables in the model. We have an enterprise server, and hopefully I'll be able to stage an UNM on the test environment on that very soon. I'm keen to hear about user experiences, and practices that has is using the solution. I can't change the structure of my source data, so I have to create something that will function in the UNM based on the source data, which means my translation has to be spot on. And that is where I'm starting to shake a bit, but I'm sure it's doable
...查看更多
02-14-2021下午11:23
|
0
|
5
|
2627
|
帖子
|
谢谢你的回复
...查看更多
02-12-202106:08我
|
0
|
0
|
2651
|