<?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: PrintingTools  - ExportWebMap - Calculate extends from coordinates (point) in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1093532#M3943</link>
    <description>&lt;P&gt;i am not sure why that would be off center. add x degree right and left should not change the center. I have 2 suggestion;&lt;/P&gt;&lt;P&gt;The issue might lie with the print endpint. can you try both preserver map scale and map extent?&lt;/P&gt;&lt;P&gt;Secondly, can you take the point and create a buffer then use the extend of the buffer to get your coord and try?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VictorTey_0-1630321736882.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21992iEAC4B87B3C8B5738/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VictorTey_0-1630321736882.png" alt="VictorTey_0-1630321736882.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Aug 2021 11:10:15 GMT</pubDate>
    <dc:creator>VictorTey</dc:creator>
    <dc:date>2021-08-30T11:10:15Z</dc:date>
    <item>
      <title>PrintingTools  - ExportWebMap - Calculate extends from coordinates (point)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1091747#M3940</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm using the PrintingTools - ExportWebMap REST API to get images of a map. As a parameter I get longitude and latitude (East/North) coordinates, which represent the center of the map, which should be printed.&lt;/P&gt;&lt;P&gt;How can I calculate the mapOtions -&amp;gt; extent: xmin, ymin, xmax, ymax from the given coordinates.&lt;BR /&gt;&lt;SPAN&gt;{&lt;BR /&gt;mapOptions"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"showAttribution"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"extent"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Xmin"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;2599500.000&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Ymin"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1199700.000&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DI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amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[....]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried two different approaches.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The first approach is a a simple linear interpolation, where&amp;nbsp;offsetEastInMeters and&amp;nbsp;offsetNorthInMeters&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var xmin = coordinates.East - (offsetEastInMeters / 2);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;var ymin = coordinates.North - (offsetNorthInMeters / 2);&lt;BR /&gt;var xmax = coordinates.East + (offsetEastInMeters / 2);&lt;BR /&gt;&lt;SPAN&gt;var ymax = coordinates.North + (offsetNorthInMeters / 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;Example I:&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="https://spatialreference.org/ref/epsg/ch1903-lv95/" target="_blank" rel="noopener"&gt;https://spatialreference.org/ref/epsg/ch1903-lv95/&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;East/North: 2600000.000, 1200000.000&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;offsetEastInMeters: 1000 meters&lt;BR /&gt;offsetNorthInMeters: 600 meters&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Results in:&lt;BR /&gt;&lt;SPAN&gt;xmin =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;2599500.000&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;ymin =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1199700.000&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;xmax =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;26005&lt;/SPAN&gt;&lt;SPAN&gt;00&lt;/SPAN&gt;&lt;SPAN&gt;.000&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Ymax =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;1200300.000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;The second &lt;/FONT&gt;approach&lt;FONT face="inherit"&gt;&amp;nbsp;also takes into consideration the output size of the image, dpi and the scale:&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;image_length[mm] = pixel * 25.4mm (1 in) / dpi&lt;BR /&gt;xmin = x_coord - (image_length/1000 * scale)/2&lt;BR /&gt;This result in:&lt;BR /&gt;xmin =&amp;nbsp;2599365&lt;BR /&gt;ymin= 1199700&lt;BR /&gt;xmax = 2600635&lt;BR /&gt;ymax = 1200300&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;The issue with both approaches is, that the center of the returned image is not in the middle of the given&amp;nbsp;longitude and latitude (East/North) coordinates. The given point is &lt;/FONT&gt;always&lt;FONT face="inherit"&gt;&amp;nbsp;on the left side. See the issue illustrated in the following picture:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Left_side_illustration.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21545iEE6D58F6CFC44429/image-size/large?v=v2&amp;amp;px=999" role="button" title="Left_side_illustration.png" alt="Left_side_illustration.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;How ist the calculation from a point to an area done right? What did I forget?&lt;BR /&gt;&lt;BR /&gt;Tank you for any help!&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Aug 2021 15:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1091747#M3940</guid>
      <dc:creator>pmi</dc:creator>
      <dc:date>2021-08-24T15:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: PrintingTools  - ExportWebMap - Calculate extends from coordinates (point)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1093532#M3943</link>
      <description>&lt;P&gt;i am not sure why that would be off center. add x degree right and left should not change the center. I have 2 suggestion;&lt;/P&gt;&lt;P&gt;The issue might lie with the print endpint. can you try both preserver map scale and map extent?&lt;/P&gt;&lt;P&gt;Secondly, can you take the point and create a buffer then use the extend of the buffer to get your coord and try?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VictorTey_0-1630321736882.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21992iEAC4B87B3C8B5738/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VictorTey_0-1630321736882.png" alt="VictorTey_0-1630321736882.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 11:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1093532#M3943</guid>
      <dc:creator>VictorTey</dc:creator>
      <dc:date>2021-08-30T11:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: PrintingTools  - ExportWebMap - Calculate extends from coordinates (point)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1094283#M3947</link>
      <description>&lt;P&gt;Thank you for your response.&lt;BR /&gt;As I figured out the&amp;nbsp;&lt;STRONG&gt;preserve&lt;/STRONG&gt; option for map scale sends the scale&amp;nbsp;&lt;SPAN&gt;in the JSON and map extend does not send the scale.&amp;nbsp;Unfortunately, this did not bring the desired centering.&amp;nbsp;The centering is a little better without the scale, but therefor whit out&amp;nbsp;the scale the zoom too far away:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pmi_0-1630480575872.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22153iFCD2F238CDA8E973/image-size/large?v=v2&amp;amp;px=999" role="button" title="pmi_0-1630480575872.png" alt="pmi_0-1630480575872.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For your second suggestion, can you please make an example?&amp;nbsp;&lt;BR /&gt;I don't understand what you mean by that:&lt;BR /&gt;&lt;SPAN&gt;&lt;FONT face="inherit"&gt;"[...]you take the point and create a buffer then use the extend of the buffer to get your coord[....]"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="inherit"&gt;Btw, do you know how long the returned &lt;/FONT&gt;URL&lt;FONT face="inherit"&gt;&amp;nbsp;is valid? Is this documented somewhere?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 07:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1094283#M3947</guid>
      <dc:creator>pmi</dc:creator>
      <dc:date>2021-09-01T07:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: PrintingTools  - ExportWebMap - Calculate extends from coordinates (point)</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1098186#M3953</link>
      <description>&lt;P&gt;The solution is that the base map uses&amp;nbsp;wgs84-web-mercator-auxiliary-sphere. With the converted coordinates into&amp;nbsp;&lt;A href="https://spatialreference.org/ref/epsg/ch1903-lv95/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://spatialreference.org/ref/epsg/ch1903-lv95/&lt;/A&gt; there is a&amp;nbsp;deviation which&amp;nbsp;leads to this inaccuracy. (&lt;A href="https://spatialreference.org/ref/sr-org/epsg3857-wgs84-web-mercator-auxiliary-sphere/" target="_blank"&gt;https://spatialreference.org/ref/sr-org/epsg3857-wgs84-web-mercator-auxiliary-sphere/&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 19:01:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/printingtools-exportwebmap-calculate-extends-from/m-p/1098186#M3953</guid>
      <dc:creator>pmi</dc:creator>
      <dc:date>2021-09-14T19:01:50Z</dc:date>
    </item>
  </channel>
</rss>

