【问题标题】:OpenLayers 3: 3D WKT-PointOpenLayers 3:3D WKT 点
【发布时间】:2016-03-31 14:07:05
【问题描述】:

我的 SQL 数据库中有一些 SqlGeometries 代表点并包含 Z 坐标。

一旦我使用ol.format.WKT().readFeature('POINT (1 2 3)', { ... }),我就会收到以下错误:

Error: Unexpected `445.332` at position 29 in `POINT (600000.631 200000.848 445.332)`
   at ol.format.WKT.Parser.prototype.parsePointText_ (http://localhost:33464/app/lib/openLayers/ol-debug.js:94728:3)
   at ol.format.WKT.Parser.prototype.parseGeometry_ (http://localhost:33464/app/lib/openLayers/ol-debug.js:94687:7)
   at ol.format.WKT.Parser.prototype.parse (http://localhost:33464/app/lib/openLayers/ol-debug.js:94663:3)
   at ol.format.WKT.prototype.parse_ (http://localhost:33464/app/lib/openLayers/ol-debug.js:94287:3)
   at ol.format.WKT.prototype.readGeometryFromText (http://localhost:33464/app/lib/openLayers/ol-debug.js:94368:3)
   at ol.format.WKT.prototype.readFeatureFromText (http://localhost:33464/app/lib/openLayers/ol-debug.js:94307:3)
   at ol.format.TextFeature.prototype.readFeature (http://localhost:33464/app/lib/openLayers/ol-debug.js:84053:3)

现在我不介意 OpenLayers 无法处理 3D 坐标,但我可以告诉它忽略第三个值而不是引发错误吗?

【问题讨论】:

    标签: openlayers-3


    【解决方案1】:

    您必须使用 POINTZ() 而不是 POINT(),因为它是 3D 的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多