Search in sources :

Example 1 with TriangulatedIrregularNetworkLayer

use of com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer in project com.revolsys.open by revolsys.

the class LayerGroup method openFile.

public int openFile(int index, final URL url) {
    final String urlString = url.toString();
    final Map<String, Object> properties = new HashMap<>();
    properties.put("url", urlString);
    String name = UrlUtil.getFileBaseName(url);
    name = FileUtil.fromSafeName(name);
    properties.put("name", name);
    Layer layer;
    if (IoFactory.hasFactory(TriangulatedIrregularNetworkReadFactory.class, url)) {
        layer = new TriangulatedIrregularNetworkLayer(properties);
    } else if (IoFactory.hasFactory(GriddedElevationModelReadFactory.class, url)) {
        layer = new GriddedElevationModelLayer(properties);
    } else if (IoFactory.hasFactory(GeoreferencedImageReadFactory.class, url)) {
        layer = new GeoreferencedImageLayer(properties);
    } else if (IoFactory.hasFactory(PointCloudReadFactory.class, url)) {
        layer = new PointCloudLayer(properties);
    } else if (IoFactory.hasFactory(RecordReaderFactory.class, url)) {
        final FileRecordLayer recordLayer = new FileRecordLayer(properties);
        final GeometryStyleRenderer renderer = recordLayer.getRenderer();
        renderer.setStyle(GeometryStyle.newStyle());
        layer = recordLayer;
    } else {
        layer = null;
    }
    if (layer != null) {
        layer.setProperty("showTableView", isShowNewLayerTableView());
        if (index == -1) {
            addLayer(layer);
        } else {
            addLayer(index++, layer);
        }
    }
    return index;
}
Also used : HashMap(java.util.HashMap) FileRecordLayer(com.revolsys.swing.map.layer.record.FileRecordLayer) FileRecordLayer(com.revolsys.swing.map.layer.record.FileRecordLayer) TriangulatedIrregularNetworkLayer(com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer) PointCloudLayer(com.revolsys.swing.map.layer.pointcloud.PointCloudLayer) GriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelLayer) GeoreferencedImageLayer(com.revolsys.swing.map.layer.raster.GeoreferencedImageLayer) GeoreferencedImageLayer(com.revolsys.swing.map.layer.raster.GeoreferencedImageLayer) PointCloudLayer(com.revolsys.swing.map.layer.pointcloud.PointCloudLayer) GeometryStyleRenderer(com.revolsys.swing.map.layer.record.renderer.GeometryStyleRenderer) TriangulatedIrregularNetworkLayer(com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer) GriddedElevationModelReadFactory(com.revolsys.elevation.gridded.GriddedElevationModelReadFactory) GriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelLayer) PointCloudReadFactory(com.revolsys.elevation.cloud.PointCloudReadFactory)

Example 2 with TriangulatedIrregularNetworkLayer

use of com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer in project com.revolsys.open by revolsys.

the class LayerGroup method openFile.

public int openFile(final Class<? extends IoFactory> factoryClass, int index, final URL url) {
    final String urlString = url.toString();
    final Map<String, Object> properties = new HashMap<>();
    properties.put("url", urlString);
    String name = UrlUtil.getFileBaseName(url);
    name = FileUtil.fromSafeName(name);
    properties.put("name", name);
    Layer layer;
    if (factoryClass == TriangulatedIrregularNetworkReadFactory.class) {
        layer = new TriangulatedIrregularNetworkLayer(properties);
    } else if (factoryClass == GriddedElevationModelReadFactory.class) {
        layer = new GriddedElevationModelLayer(properties);
    } else if (factoryClass == GeoreferencedImageReadFactory.class) {
        layer = new GeoreferencedImageLayer(properties);
    } else if (factoryClass == PointCloudReadFactory.class) {
        layer = new PointCloudLayer(properties);
    } else if (factoryClass == RecordReaderFactory.class) {
        final FileRecordLayer recordLayer = new FileRecordLayer(properties);
        final GeometryStyleRenderer renderer = recordLayer.getRenderer();
        renderer.setStyle(GeometryStyle.newStyle());
        layer = recordLayer;
    } else {
        layer = null;
    }
    if (layer != null) {
        layer.setProperty("showTableView", isShowNewLayerTableView());
        if (index == -1) {
            addLayer(layer);
        } else {
            addLayer(index++, layer);
        }
    }
    return index;
}
Also used : HashMap(java.util.HashMap) FileRecordLayer(com.revolsys.swing.map.layer.record.FileRecordLayer) FileRecordLayer(com.revolsys.swing.map.layer.record.FileRecordLayer) TriangulatedIrregularNetworkLayer(com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer) PointCloudLayer(com.revolsys.swing.map.layer.pointcloud.PointCloudLayer) GriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelLayer) GeoreferencedImageLayer(com.revolsys.swing.map.layer.raster.GeoreferencedImageLayer) GeoreferencedImageLayer(com.revolsys.swing.map.layer.raster.GeoreferencedImageLayer) PointCloudLayer(com.revolsys.swing.map.layer.pointcloud.PointCloudLayer) GeometryStyleRenderer(com.revolsys.swing.map.layer.record.renderer.GeometryStyleRenderer) TriangulatedIrregularNetworkLayer(com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer) GriddedElevationModelReadFactory(com.revolsys.elevation.gridded.GriddedElevationModelReadFactory) GriddedElevationModelLayer(com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelLayer) PointCloudReadFactory(com.revolsys.elevation.cloud.PointCloudReadFactory)

Aggregations

PointCloudReadFactory (com.revolsys.elevation.cloud.PointCloudReadFactory)2 GriddedElevationModelReadFactory (com.revolsys.elevation.gridded.GriddedElevationModelReadFactory)2 GriddedElevationModelLayer (com.revolsys.swing.map.layer.elevation.gridded.GriddedElevationModelLayer)2 TriangulatedIrregularNetworkLayer (com.revolsys.swing.map.layer.elevation.tin.TriangulatedIrregularNetworkLayer)2 PointCloudLayer (com.revolsys.swing.map.layer.pointcloud.PointCloudLayer)2 GeoreferencedImageLayer (com.revolsys.swing.map.layer.raster.GeoreferencedImageLayer)2 FileRecordLayer (com.revolsys.swing.map.layer.record.FileRecordLayer)2 GeometryStyleRenderer (com.revolsys.swing.map.layer.record.renderer.GeometryStyleRenderer)2 HashMap (java.util.HashMap)2