- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 KML {raster} 将光栅文件写入 KML,并尝试使用 MAPC2MAPC 将它们转换为在移动设备上使用。
但是,MAPC2MAPC 显然不适用于这些导出的 KML。我注意到我导出的 KML 和 Google Earth 导出的 KML 之间的唯一区别(由 MAPC2MAPC 毫无问题地转换)是命名空间定义。然后我手动修复了 kml 中的命名空间并且 MAPC2MAPC 正在工作。现在我尝试在 R 中以编程方式修复命名空间,但没有成功。
默认 KML 的顶部节点如下所示:
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<kml xmlns="http://www.opengis.net/kml/2.2">
最佳答案
试试这个:
library(XML)
# just a sample kml file... needs to be well-formed
z <-
'<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Folder>
<name>Some Name</name>
<Placemark>
<name>Jackson</name>
<Polygon><outerBoundaryIs><LinearRing><coordinates>-91.151982,44.136728 -91.152627,44.158372 -91.152677,44.170618 -91.152732,44.183928 -91.152372,44.187182 -91.15244,44.187307 -91.152495,44.208702 -91.152892,44.222784 -91.153829,44.24758 -91.165786,44.247429 -91.165936,44.2546 -91.166159,44.272973 -91.166311,44.303743 -91.166469,44.306118 -91.166056,44.30943 -91.165995,44.33161 -91.16614,44.334932 -91.166128,44.335102 -91.16648,44.339077 -91.165909,44.343314 -91.166149,44.34968 -91.165604,44.37626 -91.165545,44.378794 -91.164813,44.418752 -91.164768,44.42248 -91.164873,44.451251 -91.164858,44.45132 -91.164915,44.451544 -91.165155,44.473148 -91.165187,44.480189 -91.165197,44.482528 -91.165636,44.496874 -91.1657,44.498476 -91.16588,44.509756 -91.165916,44.528032 -91.165696,44.550109 -91.165666,44.565612 -91.165408,44.567894 -91.165713,44.567989 -91.165619,44.596987 -91.130969,44.596692 -91.125674,44.596666 -91.119816,44.596285 -91.114632,44.596343 -91.043609,44.596609 -91.026595,44.596426 -91.009307,44.59663 -90.992352,44.596619 -90.990775,44.596447 -90.972986,44.596516 -90.94268,44.596582 -90.92235,44.596293 -90.922637,44.591081 -90.922579,44.580701 -90.922618,44.543798 -90.922775,44.512564 -90.923104,44.509838 -90.801852,44.509573 -90.80194,44.458502 -90.801949,44.429518 -90.801928,44.422301 -90.764289,44.422345 -90.760977,44.422336 -90.72215,44.422293 -90.719005,44.422213 -90.705154,44.422289 -90.680591,44.422218 -90.619465,44.422127 -90.558746,44.42221 -90.497221,44.422613 -90.436472,44.422546 -90.397588,44.423279 -90.31605,44.424673 -90.317397,44.337429 -90.31766,44.291998 -90.317938,44.249963 -90.318107,44.248791 -90.312035,44.248758 -90.31257,44.240933 -90.3125,44.194598 -90.312225,44.19244 -90.312083,44.187037 -90.31249,44.184046 -90.312575,44.155284 -90.435728,44.161022 -90.461889,44.16082 -90.488949,44.160944 -90.49033,44.16076 -90.546446,44.160284 -90.553421,44.160309 -90.591977,44.160163 -90.653047,44.159585 -90.672674,44.159319 -90.774673,44.159056 -90.792783,44.158862 -90.817517,44.158692 -90.817713,44.158644 -90.887873,44.158429 -90.888823,44.158484 -90.8929,44.158323 -90.906152,44.158316 -90.912893,44.154445 -90.916033,44.153313 -90.919834,44.150576 -90.922496,44.147593 -90.927157,44.14646 -90.930865,44.14648 -90.936741,44.147456 -90.939122,44.147337 -90.942552,44.144407 -90.945184,44.146673 -90.947547,44.147332 -90.948945,44.146008 -90.950352,44.143296 -90.952723,44.141954 -90.956902,44.141823 -90.958111,44.140704 -90.958909,44.137424 -90.962404,44.136491 -90.9641,44.137405 -90.966729,44.136248 -90.96894,44.133218 -90.97016,44.129621 -90.971909,44.128667 -90.976753,44.129869 -90.978639,44.127998 -90.978398,44.12666 -90.97364,44.124266 -90.971168,44.122493 -90.967644,44.119582 -90.968004,44.118533 -90.970286,44.117542 -90.973565,44.116895 -90.972764,44.070775 -91.023637,44.071134 -91.04639,44.071139 -91.057154,44.071141 -91.090641,44.071239 -91.091691,44.071192 -91.111766,44.071094 -91.151768,44.071014 -91.151843,44.079656 -91.151901,44.095396 -91.151975,44.114529 -91.151982,44.136728</coordinates></LinearRing></outerBoundaryIs></Polygon>
</Placemark>
</Folder>
</Document>
</kml>'
xmlDoc <- xmlInternalTreeParse(z)
# this is the important bit...
ns <- c(gx="http://www.google.com/kml/ext/2.2",
kml="http://www.opengis.net/kml/2.2",
atom="http://www.w3.org/2005/Atom")
ensureNamespace(xmlDoc, ns)
# save it...
saveXML(xmlDoc,"sample.kml")
gx:
和
atom:
命名空间,但不会添加
kml:
命名空间(因为它已经存在)。所以我不确定它是否可以在移动设备上运行,但可以尝试一下。
关于xml - 使用 R 的 XML 包从头开始构建具有完整命名空间信息的 KML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21632399/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!