com.supermap.services.providers

Class UGCMapProvider

  • java.lang.Object
    • com.supermap.services.providers.UGCMapProvider
    • Constructor Detail

      • UGCMapProvider

        public UGCMapProvider()
        

        The default constructor.

      • UGCMapProvider

        public UGCMapProvider(UGCMapProviderSetting providerSetting)
        

        Constructs a UGCMapProvider object based on the configuration information of a SuperMap map service provider.

        Parameters:
        providerSetting - The configuration information of SuperMap map service provider.
    • Method Detail

      • findNearest

        public QueryResult findNearest(java.lang.String mapName,
                              Geometry geometry,
                              double maxDistance,
                              QueryParameterSet queryParameterSet)
        

        Queries the geometric objects on a specified map whose distances to a specified geometry are 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 - Map name, can not be null.
        geometry - Geometry Object. The projected coordinate system is the same as map coordinates.
        maxDistance - Tolerance range. The projected coordinate system is the same as map coordinates.
        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)
        

        Gets the default map parameters of the specified map.

        The initial default map parameter is determined by the accessed service type. For example, when accessing the GIS capability provided by SuperMap Objects Java, the initial default map parameter is gotten from the workspace file.

        Specified by:
        getDefaultMapParameter in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        Returns:
        The map parameter object.
      • 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.
      • 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.
      • getMapParameter

        public MapParameter getMapParameter(java.lang.String mapName)
        

        Gets the status of a map (the map parameters) after outputting map images last time.

        Specified by:
        getMapParameter in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        Returns:
        Map parameters.
      • getNames

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

        Gets all the map names corresponding to the current SuperMap map service provider.

        Specified by:
        getNames in interface MapProvider
        Returns:
        The list of map names.
      • getOverview

        public Overview getOverview(MapParameter mapParameter,
                           ImageOutputOption outputOption)
        

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

        Specified by:
        getOverview in interface MapProvider
        Parameters:
        mapParameter - Map parameter, can not be null.
        outputOption - Image output settings.
        Returns:
        Eagle-eye 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.
      • 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.
      • measureArea

        public MeasureResult measureArea(java.lang.String mapName,
                                Point2D[] points,
                                MeasureParameter measureParam)
        

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

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

        public MeasureResult measureDistance(java.lang.String mapName,
                                    Point2D[] points,
                                    MeasureParameter measureParam)
        

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

        Specified by:
        measureDistance in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        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)
        

        Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value. When you limit the number of the returned geometries (specified by QueryParameterSet.expectCount), the query result is the expectCount object extracting randomly from the total query records.

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

        Specified by:
        queryByDistance in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        geometry - Geometry Object. The projected coordinate system is the same as map coordinates.
        distance - The specified distance. The projected coordinate system is the same as map coordinates.
        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)
        

        Queries the geometries within a specified range on the map.

        Specified by:
        queryByBounds in interface MapProvider
        Parameters:
        mapName - The map name.
        bounds - The specified query range. The projected coordinate system is the same as the coordinates of the map.
        queryParameterSet - Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameters.queryParams[i] .
        Returns:
        Query result object.
      • queryByGeometry

        public QueryResult queryByGeometry(java.lang.String mapName,
                                  Geometry geometry,
                                  SpatialQueryMode spatialQueryMode,
                                  QueryParameterSet queryParameterSet)
        

        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 - Map name, can not be null.
        geometry - The specified geometry, which only contains spatial information, shape information and so on, doesn't contain attribute information. The projected coordinate system is the same as the coordinate of the map.
        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.
      • queryBySQL

        public QueryResult queryBySQL(java.lang.String mapName,
                             QueryParameterSet queryParameterSet)
        

        Performs SQL query on specified map.

        Specified by:
        queryBySQL in interface MapProvider
        Parameters:
        mapName - Map name, can not be null.
        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.
      • setDefaultMapParameter

        public MapParameter setDefaultMapParameter(MapParameter mapParameter)
        

        Sets the default map parameters.

        Specified by:
        setDefaultMapParameter in interface MapProvider
        Parameters:
        mapParameter - Map parameter, can not be null.
        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 layer name specified with the parameter determines the full geographic map extent, which takes the minimum circumscribed rectangle of the layer as the full map displayed extent.

        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.
      • checkParameterNull

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

        Checks whether the parameter is null.

        The IllegalArgumentException will be thrown if parameterName is null.

        Parameters:
        obj - The type of the parameter to be checked.
        parameterName - The name of the parameter to be checked.
      • getProvider

        protected com.supermap.services.providers.InnerUGCMapProvider getProvider(java.lang.String name)
        
        Gets the inner map provider.
        Parameters:
        name - The map name.
        Returns:
        The inner map provider.
      • dispose

        public void dispose()
        

        Releases the resources used by SuperMap map service provider.

        Specified by:
        dispose in interface Disposable
      • checkExcludedFieldsInMapsSetting

        protected void checkExcludedFieldsInMapsSetting(ExcludedFieldsInMap[] excludedFieldsInMaps)
        
      • pauseForRefreshWorkspace

        public void pauseForRefreshWorkspace()
        

        Pauses the service.

      • refreshWorkspaceFinished

        public void refreshWorkspaceFinished()
        

        Refreshing the workspace has finished.

      • refreshWorkspace

        public void refreshWorkspace()
        

        Refreshes the workspace.

      • clearCache

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

        Clears the cache of the specified region according to the map name and the bounds.

        Specified by:
        clearCache in interface MapProvider
        Parameters:
        mapName - The map name.
        bounds - The bounds of the region.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • 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.
      • 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.