title: Convert ArcGis Geographic Coordinates Lat Long wkid: 4326 to Projected Coordinates wkid: 102000/3857
body: <p>When using JS ArcGis API, is it possible to create a point in ArcGis from lat and long like this</p>
  
  <pre><code>var testPoint = new Point(-98, 38);
  </code></pre>
  
  <p>or this</p>
  
  <pre><code>var testPoint = new Point(-98, 38, new SpatialReference({ wkid: 4326 }));
  </code></pre>
  
  <p>and convert it to a different SR so that its x and y are changed automatically? E.g. to wkid 102000/3857?</p>
  
  <p><strong>CONTEXT:</strong> (Maybe you can find a workaround)</p>
  
  <p>I'm using heatmap.js to draw heatmapLayers on ArcGis maps. I found some examples and the way this API ingests data is using a variable <code>data</code> on the following format:</p>
  
  <pre><code>var data = [
    {
      attributes: {},
      geometry: {
        spatialReference: { wkid: ****},
        type: "point",
        x: -40,
        y: 50
      }
    },
    {another point....}
  ];
  </code></pre>
  
  <p>The API itself does some parsing over <code>data</code> variable and then uses this method</p>
  
  <pre><code>screenGeometry = esri.geometry.toScreenGeometry(this._map.extent, this._map.width, this._map.height, parsedData.data[xParsed][yParsed].dataPoint);
  </code></pre>
  
  <p>to transform the parsed point (<code>parsedData.data[xParsed][yParsed].dataPoint</code>) before finally drawing heatmap.</p>
  
  <p>The main problem is that no matter what wkid I pass to the point (**** in the code before), it interprets it as wkid: 102000, that's why I wanted to do coordinate conversion myself beforehand.</p>
  
  <p>I guess it should be <code>esri.geometry.toScreenGeometry</code> task to actually do that conversion, but, as I said, it ignores the wkid.</p>
  
  <p>Thanks before hand,</p>