<?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 Dataframe.scale problem when map created through ConvertWebMapToMapDocument in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/dataframe-scale-problem-when-map-created-through/m-p/326699#M25396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using a modified version of the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0057000000mq000000/" rel="nofollow" target="_blank"&gt;Advanced High Quality Printing script&lt;/A&gt;&lt;SPAN&gt; to create a custom print job for a client. They want to create PDF maps at 1:1200 or 1:4800 scale, and they have mxds formatted for that. However, the client-side flex application uses tiled map services that display at scales of 1:500, 1:1000, 1:2000, 1:4000, and so on. So, when I passed my WebMapAsJson into the script, the map scale was not what the client wanted (1" to 333.3' instead of 1" to 400'). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I tried to pass a scale value to the dataframe, to override the webmap scale. That's when I received an error in the script that said "DataFrameObject: Error in setting scale value". According to the documentation, the dataframe's scale property is supposed to be read/write, but it wasn't the case here. I've looked through the mxd, and the dataframe's extent was set to automatic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to set the mxd's extent to a fixed scale (1:4800), and commented out the dataframe.scale setting. However, the ConvertWebMapToMapDocument overrode the fixed scale with the map scale from the web service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't change the tiling scales from the client web map service. Can anybody recommend a good workaround?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 16:21:19 GMT</pubDate>
    <dc:creator>KenDoman</dc:creator>
    <dc:date>2013-06-18T16:21:19Z</dc:date>
    <item>
      <title>Dataframe.scale problem when map created through ConvertWebMapToMapDocument</title>
      <link>https://community.esri.com/t5/python-questions/dataframe-scale-problem-when-map-created-through/m-p/326699#M25396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using a modified version of the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0057000000mq000000/" rel="nofollow" target="_blank"&gt;Advanced High Quality Printing script&lt;/A&gt;&lt;SPAN&gt; to create a custom print job for a client. They want to create PDF maps at 1:1200 or 1:4800 scale, and they have mxds formatted for that. However, the client-side flex application uses tiled map services that display at scales of 1:500, 1:1000, 1:2000, 1:4000, and so on. So, when I passed my WebMapAsJson into the script, the map scale was not what the client wanted (1" to 333.3' instead of 1" to 400'). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I tried to pass a scale value to the dataframe, to override the webmap scale. That's when I received an error in the script that said "DataFrameObject: Error in setting scale value". According to the documentation, the dataframe's scale property is supposed to be read/write, but it wasn't the case here. I've looked through the mxd, and the dataframe's extent was set to automatic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to set the mxd's extent to a fixed scale (1:4800), and commented out the dataframe.scale setting. However, the ConvertWebMapToMapDocument overrode the fixed scale with the map scale from the web service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't change the tiling scales from the client web map service. Can anybody recommend a good workaround?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 16:21:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dataframe-scale-problem-when-map-created-through/m-p/326699#M25396</guid>
      <dc:creator>KenDoman</dc:creator>
      <dc:date>2013-06-18T16:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dataframe.scale problem when map created through ConvertWebMapToMapDocument</title>
      <link>https://community.esri.com/t5/python-questions/dataframe-scale-problem-when-map-created-through/m-p/326700#M25397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After mucking around, I found a way to replace the scale value passed from the web application before it is used to update the .mxd file. Here's the relevant snippets of the script, based on the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0057000000mq000000/" rel="nofollow" target="_blank"&gt;High Quality Map Printing Tutorial using arcpy.mapping&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Imports import arcpy import sys import os import uuid import ast # used to work with user defined extent import json # used to work with the web map json string&amp;nbsp; # Snip...&amp;nbsp; # Input WebMap json Web_Map_as_JSON = arcpy.GetParameterAsText(0)&amp;nbsp; #Snip (insert other parameters)&amp;nbsp; #Extra parameter - Extent Extent = ast.literal_eval(arcpy.GetParameterAsText(5)) _Extent = arcpy.Extent(Extent.get("xmin"), Extent.get("ymin"), Extent.get("xmax"), Extent.get("ymax"))&amp;nbsp; #Extra parameter - Scale Scale = float(arcpy.GetParameterAsText(6))&amp;nbsp; # modify Web_Map_as_JSON so that the web map scale matches the scale provided. Web_Map_Dict = json.loads(Web_Map_as_JSON) Web_Map_Dict["mapOptions"]["scale"] = Scale Web_Map_as_JSON = json.dumps(Web_Map_Dict)&amp;nbsp; # Snip (getting file location of templateMxd)&amp;nbsp; # Convert the WebMap to a map document result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd) mxd = result.mapDocument&amp;nbsp; # Snip (do other things to the map as needed)&amp;nbsp; # Reference the data frame that contains the webmap # Note: ConvertWebMapToMapDocument renames the active dataframe in the template_mxd to "Webmap" df = arcpy.mapping.ListDataFrames(mxd, 'Webmap')[0]&amp;nbsp; # Update the extent of the map to match the extent passed through the service. df.panToExtent(_Extent)&amp;nbsp; # Snip (Do whatever else you need to the map, before serving it out.)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:50:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dataframe-scale-problem-when-map-created-through/m-p/326700#M25397</guid>
      <dc:creator>KenDoman</dc:creator>
      <dc:date>2013-06-19T13:50:06Z</dc:date>
    </item>
  </channel>
</rss>

