zcy89

how to use simplifyGeometry?

Discussion created by zcy89 on Nov 5, 2012
Latest reply on Nov 6, 2012 by njarecha-esristaff
hi,I've used [AGSGeometryEngine simplifyGeometry:] to simplify a ployline like this:
    
    AGSGeometryEngine *engine=[AGSGeometryEngine defaultGeometryEngine];
    AGSMutablePolyline *line=[[AGSMutablePolyline alloc]init];
    // path 1
    [line addPathToPolyline];
    // point 1
    [line addPointToPath:[AGSPoint pointWithX:0 y:0 spatialReference:nil]];
    // point 2
    [line addPointToPath:[AGSPoint pointWithX:100 y:100 spatialReference:nil]];
    
    // path 2
    [line addPathToPolyline];
    // point 3
    [line addPointToPath:[AGSPoint pointWithX:0 y:100 spatialReference:nil]];
    // point 4
    [line addPointToPath:[AGSPoint pointWithX:100 y:0 spatialReference:nil]];

    AGSMutablePolyline *x=(AGSMutablePolyline*)[engine simplifyGeometry:line];

the variable "line" 's two paths is crossed,
but the simplify result variable "x" 's paths is same to "line".
why? thank you.

Outcomes