how to use simplifyGeometry?

606
1
11-05-2012 09:28 PM
___11
by
New Contributor
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.
0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
Could you please try initializing geometry with spatial reference?

Please go through Geometry Operations document. It explains each operation. After going through document, let me know if you still have any question.

Regards,
Nimesh
0 Kudos