Class OpenStreetMapShapefileLoader


  • public class OpenStreetMapShapefileLoader
    extends java.lang.Object
    • Constructor Detail

      • OpenStreetMapShapefileLoader

        public OpenStreetMapShapefileLoader()
    • Method Detail

      • isOSMPlacesSource

        public static boolean isOSMPlacesSource​(java.lang.Object source)
        Returns true if the specified Shapefile source is an OpenStreetMap Shapefile containing placemarks, and false otherwise. The source is considered to be an OpenStreetMap source if it can be converted to an abstract path, and the path's filename is equal to "places.shp", ignoring case.
        Parameters:
        source - the source of the Shapefile.
        Returns:
        true if the Shapefile is an OpenStreetMap Shapefile; false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if the source is null or an empty string.
      • makeLayerFromOSMPlacesSource

        public static Layer makeLayerFromOSMPlacesSource​(java.lang.Object source)
        Creates a Layer from an OpenStreetMap Shapefile source of placemarks. The source type may be one of the following:
        • InputStream
        • URL
        • absolute URI
        • File
        • String containing a valid URL description or a file or resource name available on the classpath.

        The returned Layer renders each Shapefile record as a surface circle with an associated screen label. The label text is taken from the Shapefile record attribute key "name". This determines each surface circle's appearance from the Shapefile record attribute key "type" as follows:

        Mapping
        TypeColor
        hamletBlack
        villageGreen
        townCyan
        cityYellow
        Parameters:
        source - the source of the OpenStreetMap Shapefile.
        Returns:
        a Layer that renders the Shapefile's contents on the surface of the Globe.
        Throws:
        java.lang.IllegalArgumentException - if the source is null or an empty string.
      • makeLayerFromOSMPlacesShapefile

        public static Layer makeLayerFromOSMPlacesShapefile​(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
        Creates a Layer from an OpenStreetMap Shapefile of placemarks.

        The returned Layer renders each Shapefile record as a surface circle with an associated screen label. The label text is taken from the Shapefile record attribute key "name". This determines each surface circle's appearance from the Shapefile record attribute key "type" as follows:

        Mapping
        TypeColor
        hamletBlack
        villageGreen
        townCyan
        cityYellow
        Parameters:
        shp - the Shapefile to create a layer for.
        Returns:
        a Layer that renders the Shapefile's contents on the surface of the Globe.
        Throws:
        java.lang.IllegalArgumentException - if the Shapefile is null, or if the Shapefile's primitive type is unrecognized.