<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic geometryService.Project with polygons in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/geometryservice-project-with-polygons/m-p/399374#M9313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the ArcGIS API for Flex, version 1.3, does the geometryService.Project() method work with polygons? According to the documentation, it should work for any geometries, but I can only get it to work with points. When I try using it to reproject a polygon, it returns nothing.&amp;nbsp; Even when I try using it to reproject points, it always returns 0, 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create the spatial reference objects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;m_spref_In = new SpatialReference(4326); // GCS_WGS_1984&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;m_spref_Out = new SpatialReference(102113); // WGS_1984_Web_Mercator&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shpPolygon = ac_Polygons[i_ShapeNum]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create the graphic object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myGraphic = new Graphic();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myGraphic.geometry = shpPolygon.toPolygon();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;geometryService.project([ myGraphic ], m_spref_Out);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function projectCompleteHandler(event:GeometryServiceEvent):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* DEBUG */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alert.show("#1001: event.graphics.length = " + event.graphics.length.toString());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The event.graphics.length is ALWAYS zero.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Aug 2011 17:21:34 GMT</pubDate>
    <dc:creator>MikeAdams</dc:creator>
    <dc:date>2011-08-25T17:21:34Z</dc:date>
    <item>
      <title>geometryService.Project with polygons</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/geometryservice-project-with-polygons/m-p/399374#M9313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the ArcGIS API for Flex, version 1.3, does the geometryService.Project() method work with polygons? According to the documentation, it should work for any geometries, but I can only get it to work with points. When I try using it to reproject a polygon, it returns nothing.&amp;nbsp; Even when I try using it to reproject points, it always returns 0, 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create the spatial reference objects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;m_spref_In = new SpatialReference(4326); // GCS_WGS_1984&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;m_spref_Out = new SpatialReference(102113); // WGS_1984_Web_Mercator&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shpPolygon = ac_Polygons[i_ShapeNum]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create the graphic object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myGraphic = new Graphic();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myGraphic.geometry = shpPolygon.toPolygon();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;geometryService.project([ myGraphic ], m_spref_Out);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function projectCompleteHandler(event:GeometryServiceEvent):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;/* DEBUG */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alert.show("#1001: event.graphics.length = " + event.graphics.length.toString());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The event.graphics.length is ALWAYS zero.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2011 17:21:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/geometryservice-project-with-polygons/m-p/399374#M9313</guid>
      <dc:creator>MikeAdams</dc:creator>
      <dc:date>2011-08-25T17:21:34Z</dc:date>
    </item>
  </channel>
</rss>

