com.supermap.analyst.spatialanalyst
Class Generalization
- java.lang.Object
-
- com.supermap.analyst.spatialanalyst.Generalization
-
public class Generalization extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static void
addSteppedListener(SteppedListener l)
static boolean
aggregatePoints(DatasetVector pointDataset, double distance, Unit unit, int minPilePointCount, Datasource outDatasource, java.lang.String resultRegionDatasetName, java.lang.String resultClassFieldName)
Point aggregation feature.static boolean
aggregatePoints(DatasetVector pointDataset, int aggregateCount, java.lang.String weightFieldName, Datasource outDatasource, java.lang.String resultRegionDatasetName, java.lang.String resultClassFieldName)
Point aggregation feature.static GeoRegion[]
autoCompletePolygon(DatasetVector regionDataset, Rectangle2D bounds, GeoLine geoLine)
Auto complete regionsstatic DatasetVector
dissolve(DatasetVector sourceDatasetVector, Datasource targetDatasource, java.lang.String targetDatasetName, DissolveParameter dissolveParameter)
Vector data dissolvingstatic GeoLine[]
dualLineToCenterLine(Recordset sourceRecordset, double maxWidth, double minWidth)
Extracts center lines from double linesstatic DatasetVector
dualLineToCenterLine(Recordset sourceRecordset, double maxWidth, double minWidth, Datasource outputDatasource, java.lang.String outputDatasetName)
Extracts center lines from double linesstatic boolean
eliminate(DatasetVector sourceDatasetVector, double regionTolerance, double vertexTolerance, EliminateMode eliminateMode, boolean isDeleteSingleRegion)
Merges tiny polygons in a region datasetstatic DatasetVector
featureEnvelope(DatasetVector sourceDataset, java.lang.String targetDatasetName, Datasource targetDatasource)
static DatasetVector
featureEnvelope(DatasetVector sourceDataset, java.lang.String targetDatasetName, Datasource targetDatasource, boolean isSinglePart)
static boolean
integrate(DatasetVector sourceDatasetVector, double tolerance, Unit unit)
Integratestatic boolean
isPrjCoordSysIdentical(PrjCoordSys sourcePrjCoordSys, PrjCoordSys targetPrjCoordSys)
static boolean
lineAttachRegion(GeoLine geoLine, GeoRegion geoRegion, java.util.List<GeoRegion> listRegionCompare, double toleranceLineAttachRegion, double toleranceRegionMerge, double toleranceChange, boolean isUsePreProcess)
Closes lines to regions.static GeoLine
regionToCenterLine(GeoRegion sourceRegion)
Extracts center lines from regionsstatic GeoLine
regionToCenterLine(GeoRegion sourceRegion, Point2D pointFrom, Point2D pointTo)
Extracts center lines from regionsstatic DatasetVector
regionToCenterLine(Recordset regionRecordset, Datasource outputDatasource, java.lang.String outputDatasetName)
Extracts center lines from regionsstatic DatasetVector
regularizeBuildingFootprint(DatasetVector sourceDataset, Datasource targetDatasource, java.lang.String targetDatasetName, RegularizeParameter param, boolean isAttributeRetained)
Regularizes buildingsstatic void
removeSteppedListener(SteppedListener l)
-
-
-
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 dissolvedtargetDatasource
- [in] output datasourcetargetDatasetName
- [in] resulting datasetdissolveParameter
- [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 mergedregionTolerance
- [in] the area of tiny polygon, polygons whose areas are smaller than the value will be mergedvertexTolerance
- [in] node toleranceeliminateMode
- [in] merging mode settingisDeleteSingleRegion
- [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 fromstreetWidth
- Width between double lineoutputDatasource
- Outputs the datasource where the source dataset is savedoutputDatasetName
- 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 fromstreetWidth
- 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 fromoutputDatasource
- Outputs the datasource where the source dataset is savedoutputDatasetName
- 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 frompntStart
- Select the starting point of center line to be extractedpntEnd
- 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 frompntStart
- Select the starting point of center line to be extractedpntEnd
- 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 datasetbounds
- 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 setdistance
- distance spatial distance of clusterunit
- Sets the unit of clustering radiusminPilePointCount
- 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 savedresultRegionDatasetName
- Returns the name of the dataset that saves the resulting region objectsresultClassFieldName
- 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 setaggregateCount
- aggregateCount clustering numberweightFieldName
- weightFieldName weighted field nameoutDatasource
- Returns datasource where the results are savedresultRegionDatasetName
- Returns the name of the dataset that saves the resulting region objectsresultClassFieldName
- 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 integratedtolerance
- [in] node toleranceunit
- [in] tolerance unit- Returns:
- Whether it is successful
-
featureEnvelope
public static DatasetVector featureEnvelope(DatasetVector sourceDataset, java.lang.String targetDatasetName, Datasource targetDatasource, boolean isSinglePart)
-
featureEnvelope
public static DatasetVector featureEnvelope(DatasetVector sourceDataset, java.lang.String targetDatasetName, Datasource targetDatasource)
-
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 datasetstargetDatasource
- the output datasourcetargetDatasetName
- resulting dataset nameparam
- regularized parametersisAttributeRetained
- whether to save the original fields- Returns:
-
-