- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我真的陷入了使用 L.timedimension 的困境。
我的地理服务器从 Psql 中以下列格式询问日期:
TO_TIMESTAMP(cast(cast(bc_issued_date as date) as varchar)|| '00:00:00' ,'YYYY-MM-DD hh24:mi:ss')::timestamp as time
"2013-01-08 00:00:00"
"2022-07-09 00:00:00"
"2021-09-08 00:00:00"
Geoserver 正确显示图层,但是当我使用 L.timedimension 时,什么也没有显示。我检查了日志,似乎时间到了,如下所示的 UTC Ember :
RawKvp = {FORMAT=image/png, STYLES=PolygonVariableThick, WIDTH=256, TIME=2012- 07-24T18:00:00.000Z, ENV=color:#808000, HEIGHT=256, LAYERS=localhost:BuildingConset_TimeSlider_v1_2017, REQUEST=GetMap, SRS=EPSG:4326, BBOX=174.72656250000003,-36.597889133070204,175.078125,-36.3151251474805, VERSION=1.1.0, SERVICE=WMS, TRANSPARENT=true, CQL_FILTER=1=1}
RemoteOwsType = null
RemoteOwsURL = null
Request = GetMap
RequestCharset = UTF-8
ScaleMethod = null
Sld = null
SldBody = null
SldVersion = null
SortBy = null
SortByArrays = null
SRS = EPSG:4326
StartIndex = null
StyleBody = null
StyleFormat = sld
Styles = [StyleImpl[ name=PolygonVariableThick]]
StyleUrl = null
StyleVersion = null
Tiled = false
TilesOrigin = null
*****Time = [Tue Jul 24 18:00:00 UTC 2012]*****
Transparent = true
ValidateSchema = false
Version = 1.1.0
ViewParams = null
Width = 256
所以,我的问题是如何强制 timedimension 向我发送正确的日期格式或如何强制 GeoServer/Postgresql 转换时间?
<!DOCTYPE html>
<html>
<head>
<title>WMS example - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js" integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw==" crossorigin=""></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.control.min.css" />
<script type="text/javascript" src="https://cdn.rawgit.com/nezasa/iso8601-js-period/master/iso8601.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/socib/Leaflet.TimeDimension/master/dist/leaflet.timedimension.min.js">
</script><link href="Scripts2/Leaflet.TimeDimension-master/src/leaflet.timedimension.control.css" rel="stylesheet" />
<style>
html, body {
height: 100%;
margin: 0;
}
#map {
width: 1000px;
height: 900px;
}
</style>
</head>
<body>
<div id='map'></div>
<script type="text/javascript">
var startDate = new Date();
startDate.setUTCHours(12, 0, 0, 0);
var map = L.map('map', {
center: [-36.924930, 174.853682],
zoom: 10,
fullscreenControl: true,
timeDimension: true,
timeDimensionControl: true,
timeDimensionOptions: {
//timeInterval: startDate.toISOString() + "/P1W",
timeInterval: "2010-01-01/2018-02-02",
period: "PT6H",
currentTime: startDate.getTime()
},
});
var testLayer = L.tileLayer.wms('https://xxx.yyy/geoserver/localhost/wms',
{
layers: 'localhost:BuildingConset_TimeSlider_v1_2017', format:
'image/png', transparent: true, opacity: 0.4,
version: '1.1.0', styles: 'PolygonVariableThick', env:
'color:#808000', CQL_FILTER: '1=1'//,time:2016
, crs: L.CRS.EPSG4326,
})
var testTimeLayer = L.timeDimension.layer.wms(testLayer, {
updateTimeDimension: false,
});
testTimeLayer.addTo(map);
</script>
最佳答案
时间(和海拔)在 WMS 规范中作为特殊参数处理。因此,您需要使用 TIME
参数而不是 CQL 过滤器。
关于postgresql - L.timeDimension 以 UTC 形式将时间发送到 GeoServer 而不是 iso8601,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51296544/
我最近尝试在 Lubuntu 14.04 服务器上安装带有 Tomcat7 的 GeoServer,但遇到了很多问题,因为 Tomcat7 的 Java 默认版本设置为 1.7。昨晚我为此苦苦挣扎,我
有人知道为什么geoserver在设置图层时不实现直接sql查询吗? 最佳答案 开发人员还没有抽出时间来解决这个问题。 (对此功能的需求并不大,因为 GeoServer 可以像表格一样轻松地提供数据库
这几天一直在纠结一个大问题——如何通过Geoserver获取矢量图 block ?我找了很多文档和博客,有一些对问题有用的资源,一步一步操作很容易: http://suite.opengeo.org/
我是 GeoServer/数据库世界的新手。我以前从未做过任何数据库工作,但作为学生实习的一部分,我需要使用 GeoServer 设置 WMS。 我在独立模式下使用 GeoServer 2.0.1(使
我试图通过在geoserver中使用WFS GetFeature来获取一些按GML格式的日期过滤的数据,但该操作忽略了时间参数,只返回一个包含所有数据的巨大GML文件。这是我正在使用的查询: http
我想在我的 tomcat Web 服务器中运行 geoserver web archive。我使用的是 tomcat 8。 我从 geoserver 下载 GeoServer 2.7.1.1 web
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 6年前关闭。 Improve this qu
我正在使用 Geoserver 2.1.1 版、Postgres 9 和 PostGIS 2.0 我想要实现的目标应该(我认为!)非常直截了当。我想在 map 上绘制一条线,代表地球表面两个城市之间的
我一直在搜索很多,但没有找到关于 Geoserver 可以处理多少并发用户的明确经验法则,无论是在 Tomcat 还是 Glassfish 容器中。 假设在高峰时段可能有大约 400 个并发用户,并且
我正在对 Geoserver 源代码进行一些更改。 我使用了来自 here 的快速入门指南.我完成了指南中的所有步骤,效果很好。当我使用 web-app/org.geoserver.web/start
我准备使用redis作为geoserver的web缓存,所以需要了解geoserver中的数据库连接。我已经在 Eclipse 中导入了 geoserver,并且有两个名为 gs-sec-jdbc 和
本文整理了Java中org.geoserver.wfs.WFSException类的一些代码示例,展示了WFSException类的具体用法。这些代码示例主要来源于Github/Stackoverfl
本文整理了Java中org.geoserver.wms.WMSInfoImpl类的一些代码示例,展示了WMSInfoImpl类的具体用法。这些代码示例主要来源于Github/Stackoverflow
本文整理了Java中org.geoserver.catalog.WMTSStoreInfo类的一些代码示例,展示了WMTSStoreInfo类的具体用法。这些代码示例主要来源于Github/Stack
本文整理了Java中org.geoserver.security.WorkspaceAccessLimits类的一些代码示例,展示了WorkspaceAccessLimits类的具体用法。这些代码示例
本文整理了Java中org.geoserver.wfs.WFSGetFeatureOutputFormat类的一些代码示例,展示了WFSGetFeatureOutputFormat类的具体用法。这些代
本文整理了Java中org.geoserver.ysld.YsldHandler类的一些代码示例,展示了YsldHandler类的具体用法。这些代码示例主要来源于Github/Stackoverflo
我正在使用 Geoserver 和 SQL Server 2008。 我有一个表,其中有一列 [geography] 类型。我能够看到 Geoserver 中显示的表(我已经安装了 SQL Serve
我使用 geoserver 2.0.1,我使用 textsymbolizer 来标记 map 上的要素。地理服务器可能不支持 '' 标签,因为我尝试更改字体大小、字体系列或 .. 它没有效果。如何在不
我在 OS X 10.10 上的 Tomcat 7.0.62 上运行 GeoServer 2.7.1。我已经使用 Homebrew 安装了 Tomcat,并将 GeoServer 2.7.1 war
我是一名优秀的程序员,十分优秀!