世界风渲染

时间:2014-07-28 14:07:38

标签: worldwind

我遇到了World Wind的问题,我的英语不是很好,但是你会理解我对这两张照片的问题:

Here is the original image

Here is the same image on World Wind

我不知道为什么图像会被更改" ...

这是我的代码:

public class WorldWindTemplate extends ApplicationTemplate
{
    public WorldWindTemplate()
    {
        Configuration.setValue(AVKey.GLOBE_CLASS_NAME, EarthFlat.class.getName());

        app = new AppFrame();
    }

    public class AppFrame extends ApplicationTemplate.AppFrame
    {        
        private RenderableLayer coucheSP;

        public AppFrame()
        {
            super(true, true, false);

            coucheSP = new RenderableLayer();
            coucheSP.setName("SP");
            coucheSP.setPickEnabled(false);

            Shapefile shapeFile = new Shapefile(new File("shapefile.shp"));

            while (shapeFile.hasNext()) {
                ShapefileRecord record = shapeFile.nextRecord();        
                VecBuffer vectorBuffer = record.getPointBuffer(0);

                ShapeAttributes normalAttributes = new BasicShapeAttributes();
                normalAttributes.setOutlineOpacity(1);

                float[] ft = {0, 1, 0, 0, 1, 0, 1, 1};
                Polygon polygon = new Polygon(vectorBuffer.getPositions());
                polygon.setTextureImageSource("echiquier.gif", ft, 4);
                polygon.setAttributes(normalAttributes);
                coucheSP.addRenderable(polygon);
            }

            //Closing shape file
            shapeFile.close();

            insertBeforeCompass(getWwd(), coucheSP);
            getWwd().getView().getGlobe().setElevationModel(new ZeroElevationModel());
        }
    }
}

在我的shapefile中,有一个用于创建多边形的4个角度的实体。 shapefile是使用QGIS生成的。实际上,我确实需要在World Wind中显示相同的图像(和相同的像素)。

我试图找到这个问题的其他线程,但我找不到任何东西......

我是World Wind的初学者,如果你能给我一些帮助或暗示,我会很感激。如果您需要更多信息或者没有理解,请告诉我。


编辑30/07:

我可能有一个提示,看起来像是因为我在创建shapefile时在QGIS中使用了投影。

有人知道我必须为法国使用(并得到WorldWind的支持)吗?我尝试了一些,并没有得到World Wind的支持。

gov.nasa.worldwind.exception.WWRuntimeException: Unsupported projection
gov.nasa.worldwind.Projection.Unknown
    at gov.nasa.worldwind.formats.shapefile.Shapefile.initialize(Unknown Source)
    at gov.nasa.worldwind.formats.shapefile.Shapefile.initializeFromFile(Unknown Source)
    at gov.nasa.worldwind.formats.shapefile.Shapefile.<init>(Unknown Source)
    at gov.nasa.worldwind.formats.shapefile.Shapefile.<init>(Unknown Source)

引起的

Shapefile shapeFile = new Shapefile(new File("shapefile.shp"));

0 个答案:

没有答案
相关问题