com.supermap.analyst.spatialanalyst

Class Generalization

  • java.lang.Object
    • com.supermap.analyst.spatialanalyst.Generalization


  • public class Generalization
    extends java.lang.Object
    • Method Detail

      • dissolve

        public static DatasetVector dissolve(DatasetVector sourceDatasetVector,
                                             Datasource targetDatasource,
                                             java.lang.String targetDatasetName,
                                             DissolveParameter dissolveParameter)
        Vector data dissolving
        Parameters:
        sourceDatasetVector - [in] vector dataset to be dissolved
        targetDatasource - [in] output datasource
        targetDatasetName - [in] resulting dataset
        dissolveParameter - [in] Dissolving parameters
        Returns:
        the resulting dataset.
      • eliminate

        public static boolean eliminate(DatasetVector sourceDatasetVector,
                                        double regionTolerance,
                                        double vertexTolerance,
                                        EliminateMode eliminateMode,
                                        boolean isDeleteSingleRegion)
        Merges tiny polygons in a region dataset
        Parameters:
        sourceDatasetVector - [in] vector region dataset to be merged
        regionTolerance - [in] the area of tiny polygon, polygons whose areas are smaller than the value will be merged
        vertexTolerance - [in] node tolerance
        eliminateMode - [in] merging mode setting
        isDeleteSingleRegion - [in] whether to delete isolated tiny polygons
        Returns:
        whether it is successful
      • dualLineToCenterLine

        public static DatasetVector dualLineToCenterLine(Recordset sourceRecordset,
                                                         double maxWidth,
                                                         double minWidth,
                                                         Datasource outputDatasource,
                                                         java.lang.String outputDatasetName)
        Extracts center lines from double lines
        Parameters:
        sourceRecordset - Record set that center lines will extract from
        streetWidth - Width between double line
        outputDatasource - Outputs the datasource where the source dataset is saved
        outputDatasetName - Outputs the name of the center-line dataset
        Returns:
        the result dataset.
      • dualLineToCenterLine

        public static GeoLine[] dualLineToCenterLine(Recordset sourceRecordset,
                                                     double maxWidth,
                                                     double minWidth)
        Extracts center lines from double lines
        Parameters:
        sourceRecordset - Record set that center lines will extract from
        streetWidth - Width between double line
        Returns:
        resulting object array.
      • regionToCenterLine

        public static DatasetVector regionToCenterLine(Recordset regionRecordset,
                                                       Datasource outputDatasource,
                                                       java.lang.String outputDatasetName)
        Extracts center lines from regions
        Parameters:
        regionRecordset - Region record set that center lines will extract from
        outputDatasource - Outputs the datasource where the source dataset is saved
        outputDatasetName - Outputs the name of the center-line dataset
        Returns:
        the result dataset.
      • regionToCenterLine

        public static GeoLine regionToCenterLine(GeoRegion sourceRegion,
                                                 Point2D pointFrom,
                                                 Point2D pointTo)
        Extracts center lines from regions
        Parameters:
        geoRegion - Regional objects that center lines will extract from
        pntStart - Select the starting point of center line to be extracted
        pntEnd - Select the ending point of center line to be extracted
        Returns:
        Returns the center lines of regions
      • regionToCenterLine

        public static GeoLine regionToCenterLine(GeoRegion sourceRegion)
        Extracts center lines from regions
        Parameters:
        geoRegion - Regional objects that center lines will extract from
        pntStart - Select the starting point of center line to be extracted
        pntEnd - Select the ending point of center line to be extracted
        Returns:
        Returns the center lines of regions
      • autoCompletePolygon

        public static GeoRegion[] autoCompletePolygon(DatasetVector regionDataset,
                                                      Rectangle2D bounds,
                                                      GeoLine geoLine)
        Auto complete regions
        Parameters:
        regionDataset - Reference region dataset
        bounds - Calculates bounds. Performs bound query to regionDataset to improve the performance. All reference regions must be in the specified bounds. if you don't specify bounds, the function will use the bounds of reference region dataset.
        geoLine - Auto completes line objects that are required by regions.
        Returns:
        Returns resulting object array. If the operation failed, returns null.
      • aggregatePoints

        public static boolean aggregatePoints(DatasetVector pointDataset,
                                              double distance,
                                              Unit unit,
                                              int minPilePointCount,
                                              Datasource outDatasource,
                                              java.lang.String resultRegionDatasetName,
                                              java.lang.String resultClassFieldName)
        Point aggregation feature. Returns whether it is successful.
        Parameters:
        pointDataset - pointDataset Point set
        distance - distance spatial distance of cluster
        unit - Sets the unit of clustering radius
        minPilePointCount - The minimum number of points in a cluster when clustering points. If the number of a point cluster is less than the value, they won't be clustered.
        outDatasource - Returns datasource where the results are saved
        resultRegionDatasetName - Returns the name of the dataset that saves the resulting region objects
        resultClassFieldName - Returns the field that saves clustering categories. Field is saved in the source dataset. Valid categories starts from 1. 0 means invalid category. The points in the same category belong to the same class
        Returns:
      • aggregatePoints

        public static boolean aggregatePoints(DatasetVector pointDataset,
                                              int aggregateCount,
                                              java.lang.String weightFieldName,
                                              Datasource outDatasource,
                                              java.lang.String resultRegionDatasetName,
                                              java.lang.String resultClassFieldName)
        Point aggregation feature. Returns whether it is successful.
        Parameters:
        pointDataset - pointDataset Point set
        aggregateCount - aggregateCount clustering number
        weightFieldName - weightFieldName weighted field name
        outDatasource - Returns datasource where the results are saved
        resultRegionDatasetName - Returns the name of the dataset that saves the resulting region objects
        resultClassFieldName - Returns the field that saves clustering categories. Fields are saved in the source dataset. The clustering categories start from 0.
        Returns:
      • lineAttachRegion

        public static boolean lineAttachRegion(GeoLine geoLine,
                                               GeoRegion geoRegion,
                                               java.util.List<GeoRegion> listRegionCompare,
                                               double toleranceLineAttachRegion,
                                               double toleranceRegionMerge,
                                               double toleranceChange,
                                               boolean isUsePreProcess)
        Closes lines to regions. The interface is mainly used for national data processing.
        Parameters:
        geoLine - The lines to be processed.
        geoRegion - regions to be processed.
        listRegionCompare - Regions to be compared. The function needs a linked-list object.
        toleranceLineAttachRegion - when closing lines to regions, the tolerance for the snapping of ends of lines to nodes. If the distance from a line end to a node is less than the value, the end will be snapped to the node. Otherwise, the end will be snapped to the line segment of the region.
        toleranceRegionMerge - the tolerance of the inserting of nodes and the tolerance of the finding of repeated lines between regions.
        toleranceChange - Returns FALSE if the distance between the original line and the replaced line is bigger than the given tolerance.
        isUsePreProcess - whether to pre-process data
        Returns:
      • integrate

        public static boolean integrate(DatasetVector sourceDatasetVector,
                                        double tolerance,
                                        Unit unit)
        Integrate
        Parameters:
        sourceDatasetVector - [in] source dataset to be integrated
        tolerance - [in] node tolerance
        unit - [in] tolerance unit
        Returns:
        Whether it is successful
      • featureEnvelope

        public static DatasetVector featureEnvelope(DatasetVector sourceDataset,
                                                    java.lang.String targetDatasetName,
                                                    Datasource targetDatasource,
                                                    boolean isSinglePart)
      • isPrjCoordSysIdentical

        public static boolean isPrjCoordSysIdentical(PrjCoordSys sourcePrjCoordSys,
                                                     PrjCoordSys targetPrjCoordSys)
      • addSteppedListener

        public static void addSteppedListener(SteppedListener l)
      • removeSteppedListener

        public static void removeSteppedListener(SteppedListener l)
      • regularizeBuildingFootprint

        public static DatasetVector regularizeBuildingFootprint(DatasetVector sourceDataset,
                                                                Datasource targetDatasource,
                                                                java.lang.String targetDatasetName,
                                                                RegularizeParameter param,
                                                                boolean isAttributeRetained)
        Regularizes buildings
        Parameters:
        sourceDataset - vector dataset to be calculated. It works on 2D region datasets
        targetDatasource - the output datasource
        targetDatasetName - resulting dataset name
        param - regularized parameters
        isAttributeRetained - whether to save the original fields
        Returns: