Bug
Bug ID Number | NIM006339 |
---|---|
Submitted | January 25, 2007 |
Last Modified | April 2, 2025 |
Applies to | No Product Found |
Version found | 9.2 |
Version Fixed | 9.3 |
Status | Fixed |
Note:
The issue of the Identify tool or tasks returning the message 'Curves are not supported' has been resolved at version 9.3.
Code:
// Get the geometry (shape) in results returned from a call to a map service's Identify method.
// The _result variable implements IMapServerIdentifyResult.
ESRI.ArcGIS.Geometry.IGeometry igeometry = _result.Shape;
// Convert the ArcObjects geometry to Web ADF geometry and store in this variable
ESRI.ArcGIS.ADF.Web.Geometry.Geometry adf_geometry = null;
// If a type of polycurve (polyline, polygon, etc.) check to see if linear. If not a polycurve,
// simply convert to Web ADF geometry.
if (igeometry is ESRI.ArcGIS.Geometry.IPolycurve)
{
ESRI.ArcGIS.Geometry.IPolycurve ipolycurve = (ESRI.ArcGIS.Geometry.IPolycurve)igeometry;
ESRI.ArcGIS.Geometry.ISegmentCollection isegmentcollection =
(ESRI.ArcGIS.Geometry.ISegmentCollection)igeometry;
// Check first segment in polycurve.
ESRI.ArcGIS.Geometry.esriGeometryType ags_geometrytype = isegmentcollection.get_Segment(0).GeometryType;
// If non-linear, densify geometry using a resolution defined by the current map scale factor
// If linear, simply proceed without densifying
if (ags_geometrytype == ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryBezier3Curve ||
ags_geometrytype == ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryCircularArc ||
ags_geometrytype == ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryEllipticArc)
{
double mapscale = m_map.Extent.Width / m_map.TilingScheme.ViewWidth;
ipolycurve.Densify(mapscale, 0);
}
if (igeometry is ESRI.ArcGIS.Geometry.IPolyline)
{
ESRI.ArcGIS.Geometry.IPolyline ipolyline = (ESRI.ArcGIS.Geometry.IPolyline)ipolycurve;
ESRI.ArcGIS.ADF.ArcGISServer.PolylineN polylinen = (ESRI.ArcGIS.ADF.ArcGISServer.PolylineN)
ESRI.ArcGIS.ADF.ArcGISServer.Converter.ComObjectToValueObject(ipolyline, sc,
typeof(ESRI.ArcGIS.ADF.ArcGISServer.PolylineN));
adf_geometry = ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfPolyline(polylinen);
}
else if (igeometry is ESRI.ArcGIS.Geometry.IPolygon)
{
ESRI.ArcGIS.Geometry.IPolygon ipolygon = (ESRI.ArcGIS.Geometry.IPolygon)ipolycurve;
ESRI.ArcGIS.ADF.ArcGISServer.PolygonN polygonn = (ESRI.ArcGIS.ADF.ArcGISServer.PolygonN)
ESRI.ArcGIS.ADF.ArcGISServer.Converter.ComObjectToValueObject(ipolygon, sc,
typeof(ESRI.ArcGIS.ADF.ArcGISServer.PolygonN));
adf_geometry = ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfPolygon(polygonn);
}
}
Issues to consider:
The code only checks the first segment in a curve to determine if it is linear or non-linear. A polygon or polyline can have a mix of linear and non-linear segments. An option is to check every segment in a curve, but this option increases processing time. The amount of time depends on the number of segments in each curve that is to be evaluated.
When densifying non-linear segments, the current map scale factor (map units per pixel) is used. The densified curves may appear unchanged, but may appear too coarse when zooming in. Use a map scale factor that can densify curves without losing resolution.
To modify the Identify tool, included with the Web Mapping Application template, perform the following steps.
Bug ID: NIM006339
Software:
Get help from ArcGIS experts
Download the Esri Support App