com.supermap.services.providers

Class RestMapProvider

    • Field Detail

      • DISTANCE

        public static final java.lang.String DISTANCE
        
    • Constructor Detail

      • RestMapProvider

        public RestMapProvider(RestMapProviderSetting setting)
        

        The constructor.

        Parameters:
        setting -
      • RestMapProvider

        public RestMapProvider()
        

        The constructor.

    • Method Detail

      • checkParameterNull

        protected static void checkParameterNull(java.lang.Object obj,
                              java.lang.String parameterName)
        
      • getNames

        public java.util.List<java.lang.String> getNames()
        

        Returns the list of map names.

        Specified by:
        getNames in interface MapProvider
        Returns:
        Map name list.
      • getMapParameter

        public MapParameter getMapParameter(java.lang.String mapName)
        

        Gets map parameters.

        Specified by:
        getMapParameter in interface MapProvider
        Parameters:
        mapName - The map name.
        Returns:
        Map parameters.
      • clearCache

        public void clearCache(java.lang.String mapName,
                      Rectangle2D bounds)
        

        Clears the cached tiles within the specified bounds.

        Specified by:
        clearCache in interface MapProvider
        Parameters:
        mapName - The map name.
        bounds - The specified map extent.
      • getMapImage

        public MapImage getMapImage(MapParameter mapParameter,
                           ImageOutputOption outputOption)
        

        Gets map images according to map parameters and image output settings.

        Specified by:
        getMapImage in interface MapProvider
        Parameters:
        mapParameter - Map parameter, can not be null.
        outputOption - Image output settings.
        Returns:
        The map image object.
      • getResource

        public java.lang.String getResource(java.lang.String mapName,
                                   ResourceParameter resourceParameter)
        

        Gets the resource image of a specified map according to a resource image parameter.

        Specified by:
        getResource in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        resourceParameter - The resource image parameter.
        Returns:
        The resource image address.
      • measureDistance

        public MeasureResult measureDistance(java.lang.String mapName,
                                    Point2D[] points,
                                    MeasureParameter measureParam)
        
        Description copied from interface: MapProvider

        Measures distances on a specified map based on 2D geographic coordinates and a measuring parameter.

        Specified by:
        measureDistance in interface MapProvider
        Parameters:
        mapName - The map name.
        points - The array of 2D geographic coordinates.
        measureParam - The measuring parameter.
        Returns:
        Measurement result object.
      • measureArea

        public MeasureResult measureArea(java.lang.String mapName,
                                Point2D[] points,
                                MeasureParameter measureParam)
        
        Description copied from interface: MapProvider

        Measures areas on a specified map based on 2D geographic coordinates and a measuring parameter.

        Specified by:
        measureArea in interface MapProvider
        Parameters:
        mapName - The map name.
        points - The array of 2D geographic coordinates.
        measureParam - The measuring parameter.
        Returns:
        Measurement result object.
      • queryByDistance

        public QueryResult queryByDistance(java.lang.String mapName,
                                  Geometry geometry,
                                  double distance,
                                  QueryParameterSet queryParameterSet)
        
        Description copied from interface: MapProvider

        Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value.

        Which means to query all the geometries within a circle whose center is the specified geometry.

        Specified by:
        queryByDistance in interface MapProvider
        Parameters:
        mapName - The map name.
        geometry - The geometric object.
        distance - The querying distance.
        queryParameterSet - Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i] .
        Returns:
        Query result object.
      • queryByGeometry

        public QueryResult queryByGeometry(java.lang.String mapName,
                                  Geometry geometry,
                                  SpatialQueryMode spatialQueryMode,
                                  QueryParameterSet queryParameterSet)
        
        Description copied from interface: MapProvider

        Queries geometric objects that satisfy a certain spatial relationship with a specified geometric object and meet query conditions on a specified map.

        Specified by:
        queryByGeometry in interface MapProvider
        Parameters:
        mapName - The map name.
        geometry - The geometric object, which has spatial information and shape information, but no attribute information.
        spatialQueryMode - The spatial query mode, which defines several spatial relationships between geometries, and it allows users to construct filter conditions to perform querying. For example, searching spatial objects which are contained in specified region object, or which have a disjoint or adjacent relationship with the specified region object.
        queryParameterSet - Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i] .
        Returns:
        Query result object.
      • queryByBounds

        public QueryResult queryByBounds(java.lang.String mapName,
                                Rectangle2D bounds,
                                QueryParameterSet queryParameterSet)
        
        Description copied from interface: MapProvider

        Queries the geometries in the specified range on the map.

        Specified by:
        queryByBounds in interface MapProvider
        Parameters:
        mapName - The map name.
        bounds - The specified query bounds.
        Returns:
        Query result object.
      • queryBySQL

        public QueryResult queryBySQL(java.lang.String mapName,
                             QueryParameterSet queryParameterSet)
        
        Description copied from interface: MapProvider

        Performs SQL query on specified map.

        Specified by:
        queryBySQL in interface MapProvider
        Parameters:
        mapName - The map name.
        queryParameterSet - Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i] .
        Returns:
        Query result object.
      • getDefaultMapParameter

        public MapParameter getDefaultMapParameter(java.lang.String mapName)
        
        Description copied from interface: MapProvider

        Gets the default map parameters of the specified map.

        Retrieval of the initial default map parameter depends on the type of the service accessed. For example, if the GIS functions provided by SuperMap Objects Java are accessed, the initial default map parameter is obtained from a workspace file; if the GIS functions of a WMS service are accessed, the default map parameter is determined in the WMS service.

        Specified by:
        getDefaultMapParameter in interface MapProvider
        Parameters:
        mapName - The map name.
        Returns:
        The map parameter object.
      • viewEntire

        public MapImage viewEntire(java.lang.String layerName,
                          MapParameter mapParameter,
                          ImageOutputOption outputOption)
        

        Displays a map in the Full Extent mode according to map layer name, map parameters and image output settings.

        The full geographic map extent to display is the minimum circumscribed rectangle of the specified layer.

        Specified by:
        viewEntire in interface MapProvider
        Parameters:
        layerName - Layer name, used to determine the full map extent.
        mapParameter - Map parameters.
        outputOption - Image output settings.
        Returns:
        The Map object.
      • getOverview

        public Overview getOverview(MapParameter mapParameter,
                           ImageOutputOption outputOption)
        
        Description copied from interface: MapProvider

        Gets eagle-eye map according to map parameters and image output settings.

        Specified by:
        getOverview in interface MapProvider
        Parameters:
        mapParameter - Map parameters.
        outputOption - Image output settings.
        Returns:
        Eagle-eye object.
      • findNearest

        public QueryResult findNearest(java.lang.String mapName,
                              Geometry geometry,
                              double maxDistance,
                              QueryParameterSet queryParameterSet)
        
        Description copied from interface: MapProvider

        Queries the nearest geometric object on a specified map whose distance to a specified geometry is within a certain value. When limit the number of returned geometric objects (specified by QueryParameterSet.expectCount), the query result is the expectCount features nearest to the center in the records. There is no orders of expectCount.

        Specified by:
        findNearest in interface MapProvider
        Parameters:
        mapName - The map name.
        geometry - The geometric object.
        maxDistance - The maximum distance, of which the unit is identical with that of the map specified with mapName parameter.
        queryParameterSet - Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i] .
        Returns:
        Query result object.
      • getLayers

        protected java.util.List<Layer> getLayers(java.lang.String mapName)
        
      • createMapParamKVPPart

        protected java.lang.String createMapParamKVPPart(MapParameter param,
                                             OutputFormat format,
                                             boolean transparent)
        

        Serializes the MapParameter object to generate MapParameter related items for the Get method of the image resource. The redirect parameters are not included. The function does not perform null or validity checks on the parameter, not checking whether MapParameter.name is correct for instance. However, it performs null check on the fields of the parameter.

        Parameters:
        param - The MapParameter object that needs to be serialized.
        format -
        transparent -
        Returns:
        ?center=xxx&viewer=xxx
      • support

        public boolean support(java.lang.String mapname,
                      MapCapability capability)
        
        Description copied from interface: MapProvider
        Determines whether the map supports the specified function.
        Specified by:
        support in interface MapProvider
        Parameters:
        mapname - The map name.
        capability - Function type.
        Returns:
        true means to support; otherwise, false.
      • getResource

        public byte[] getResource(java.lang.String mapName,
                         ResourceParameter resourceParameter,
                         Point2D[] points)
        
        Description copied from interface: MapProvider

        Gets the resource image of a specified map according to a resource image parameter.

        Specified by:
        getResource in interface MapProvider
        Parameters:
        mapName - The map name.
        resourceParameter - The resource image parameter.
        points - The points used to draw resource images.
        Returns:
        Binary stream of the image.
      • getVectorStyle

        public VectorStyle getVectorStyle(java.lang.String mapName,
                                 java.lang.String[] layerNames,
                                 VectorStyleType type)
        
        Description copied from interface: MapProvider
        Gets the specified vector layer style in the specified map.
        Specified by:
        getVectorStyle in interface MapProvider
        Parameters:
        mapName - The map name.
        layerNames - The layer name.
        type - The vector style type.
        Returns:
        Vector layer style.
      • updateMap

        public boolean updateMap(MapParameter mapParameter)
        
        Description copied from interface: MapProvider
        Updates the map status permanently, which will do a persistence in the disk.
        Specified by:
        updateMap in interface MapProvider
        Parameters:
        mapParameter - The map status to update to.
        Returns:
        Whether the update is successful.