gpt4 book ai didi

java - 无法使用 geotools : Invalid empty measure 从naturalearthdata 打开大多数形状文件

转载 作者:行者123 更新时间:2023-12-02 05:53:31 25 4
gpt4 key购买 nike

发现我无法打开大部分shape files from NaturalEarthData使用 GeoTools 11.0。

我正在运行教程"Maven Quickstart"它加载给定的形状文件并显示它。 Swing 架内部出现错误,用

打开
JMapFrame.showMap(map)

线。

错误如下:

SEVERE: Invalid empty measure '', was expecting a number, eventually followed by px, m or ft
java.lang.IllegalArgumentException: Invalid empty measure '', was expecting a number, eventually followed by px, m or ft
at org.geotools.styling.visitor.Measure.processLiteralExpression(Measure.java:97)
at org.geotools.styling.visitor.Measure.<init>(Measure.java:63)
at org.geotools.styling.visitor.UomRescaleStyleVisitor.rescale(UomRescaleStyleVisitor.java:92)
at org.geotools.styling.visitor.UomRescaleStyleVisitor.rescale(UomRescaleStyleVisitor.java:170)
at org.geotools.styling.visitor.UomRescaleStyleVisitor.rescaleFill(UomRescaleStyleVisitor.java:211)
at org.geotools.styling.visitor.UomRescaleStyleVisitor.visit(UomRescaleStyleVisitor.java:204)
at org.geotools.styling.PolygonSymbolizerImpl.accept(PolygonSymbolizerImpl.java:140)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.copy(DuplicatingStyleVisitor.java:471)
at org.geotools.styling.visitor.DuplicatingStyleVisitor.visit(DuplicatingStyleVisitor.java:278)
at org.geotools.renderer.lite.StreamingRenderer.rescaleFeatureTypeStyle(StreamingRenderer.java:2464)
at org.geotools.renderer.lite.StreamingRenderer.applyUnitRescale(StreamingRenderer.java:2325)
at org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:2011)
at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:837)
at org.geotools.swing.RenderingTask.call(RenderingTask.java:106)
at org.geotools.swing.RenderingTask.call(RenderingTask.java:41)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

最佳答案

我今天遇到了同样的异常,并通过使用摆脱了它

Style style = SLD.createPolygonStyle(....)

而不是

Style style = SLD.createSimpleStyle(featureSource.getSchema());

希望对您有所帮助。

关于java - 无法使用 geotools : Invalid empty measure 从naturalearthdata 打开大多数形状文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23324456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com