<?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 Re: Graphic with spatial Reference? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597196#M4137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to get spatial ref of graphic after adding it to layer. &lt;/P&gt;&lt;P&gt;I think graphic gets its spatial Ref assigned after it is added to layer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Mar 2015 06:22:36 GMT</pubDate>
    <dc:creator>omega_cancer</dc:creator>
    <dc:date>2015-03-22T06:22:36Z</dc:date>
    <item>
      <title>Graphic with spatial Reference?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597195#M4136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot seem to get a graphic with a spatial reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a basemap as a tpk.&amp;nbsp; My mapview and Graphics layer have a spatial reference.&amp;nbsp; I have tried many methods two are listed below that I thought should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public boolean onSingleTap(final MotionEvent e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic graphic = new Graphic(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;geometry&lt;/SPAN&gt;, pointSymbol);
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialReference spatialReference = graphic.getSpatialReference();//=null&lt;/SPAN&gt;
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried to project it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;public boolean onSingleTap(final MotionEvent e) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry RealProj = GeometryEngine.project(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;geometry&lt;/SPAN&gt;, mMapView.getSpatialReference(), mMapView.getSpatialReference());
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic graphic = new Graphic(&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;geometry&lt;/SPAN&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;, pointSymbol);&lt;/SPAN&gt;
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialReference spatialReference = graphic.getSpatialReference();//=null&lt;/SPAN&gt;
&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;}&lt;/SPAN&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing seems to work.&amp;nbsp; Is there something obvious I am not doing?&amp;nbsp; This has not been an issue until I have started trying to use the FeatureSet.toJson method and realized that my spatial reference was empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:38:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597195#M4136</guid>
      <dc:creator>ForrestKaye</dc:creator>
      <dc:date>2021-12-12T01:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic with spatial Reference?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597196#M4137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to get spatial ref of graphic after adding it to layer. &lt;/P&gt;&lt;P&gt;I think graphic gets its spatial Ref assigned after it is added to layer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Mar 2015 06:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597196#M4137</guid>
      <dc:creator>omega_cancer</dc:creator>
      <dc:date>2015-03-22T06:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic with spatial Reference?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597197#M4138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried that.&amp;nbsp; My code supplied above is very simplified.&amp;nbsp; I had a graphic added to a graphics layer then I pass that graphic to another intent by graphicLayer.getGraphic(UID).&amp;nbsp; I have yet to be successful in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have however solved the ultimate issue of setting the spatial Reference of my FeatureSet which can be accomplished by simply using the "setSpatialReference(SR)" method.&amp;nbsp; But the graphic and Spatial Reference issue is still a mystery to me. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 18:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-with-spatial-reference/m-p/597197#M4138</guid>
      <dc:creator>ForrestKaye</dc:creator>
      <dc:date>2015-03-23T18:50:13Z</dc:date>
    </item>
  </channel>
</rss>

