<?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 Use of GridIndexFeatures geoprocessing tool. in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/use-of-gridindexfeatures-geoprocessing-tool/m-p/725870#M2187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am experimenting with data-driven pages in ARCGIS 10.0. To start with, I want to create a grid of polygons that can act as an index into a map book and the obvious way to do this is with the appropriate geoprocessing tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to prove the concept, I generated a shape file consisting of a single rectangular polygon. Then I ran the GridIndexFeatures tool manually from ArcMap, selecting page units, a map scale of 1:250000 and a page size slightly less than A4, I got an array of rectangles as I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step was to replicate this in Java. My rough and ready first attempt was as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
private void generateGrid() throws IOException {
&amp;nbsp;&amp;nbsp;&amp;nbsp; double printableHeightInches = 11.0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; double printableWidthInches = 7.5;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; GeoProcessor gp = new GeoProcessor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; GridIndexFeatures gif = new GridIndexFeatures();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // A shapefile containing a single geometry in the form of a rectangular selection
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setInFeatures("rectangle.shp");
&amp;nbsp;&amp;nbsp;&amp;nbsp; // The output - should contain the grid of index features we want
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setOutFeatureClass("grid.shp");

&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setUsePageUnit("true");
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setScale(250000);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setPolygonWidth(printableWidthInches);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setPolygonHeight(printableHeightInches);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setIntersectFeature("true");
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeoProcessorResult result = gp.execute(gif, null);
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The trouble is, when I run this, the result is a single enormous rectangle. If I set the scale to 1 then the rectangle becomes more manageable, but what seems to be happening is that the width and height I've specified are being interpreted as map units instead of inches. I've tried to specify page units, as you can see, but I'm not sure if I've provided the correct parameter, and the API documentation isn't very forthcoming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2012 14:07:11 GMT</pubDate>
    <dc:creator>QuentinGore</dc:creator>
    <dc:date>2012-11-01T14:07:11Z</dc:date>
    <item>
      <title>Use of GridIndexFeatures geoprocessing tool.</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/use-of-gridindexfeatures-geoprocessing-tool/m-p/725870#M2187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am experimenting with data-driven pages in ARCGIS 10.0. To start with, I want to create a grid of polygons that can act as an index into a map book and the obvious way to do this is with the appropriate geoprocessing tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In order to prove the concept, I generated a shape file consisting of a single rectangular polygon. Then I ran the GridIndexFeatures tool manually from ArcMap, selecting page units, a map scale of 1:250000 and a page size slightly less than A4, I got an array of rectangles as I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next step was to replicate this in Java. My rough and ready first attempt was as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
private void generateGrid() throws IOException {
&amp;nbsp;&amp;nbsp;&amp;nbsp; double printableHeightInches = 11.0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; double printableWidthInches = 7.5;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; GeoProcessor gp = new GeoProcessor();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; GridIndexFeatures gif = new GridIndexFeatures();
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // A shapefile containing a single geometry in the form of a rectangular selection
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setInFeatures("rectangle.shp");
&amp;nbsp;&amp;nbsp;&amp;nbsp; // The output - should contain the grid of index features we want
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setOutFeatureClass("grid.shp");

&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setUsePageUnit("true");
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setScale(250000);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setPolygonWidth(printableWidthInches);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setPolygonHeight(printableHeightInches);
&amp;nbsp;&amp;nbsp;&amp;nbsp; gif.setIntersectFeature("true");
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeoProcessorResult result = gp.execute(gif, null);
&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;The trouble is, when I run this, the result is a single enormous rectangle. If I set the scale to 1 then the rectangle becomes more manageable, but what seems to be happening is that the width and height I've specified are being interpreted as map units instead of inches. I've tried to specify page units, as you can see, but I'm not sure if I've provided the correct parameter, and the API documentation isn't very forthcoming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 14:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/use-of-gridindexfeatures-geoprocessing-tool/m-p/725870#M2187</guid>
      <dc:creator>QuentinGore</dc:creator>
      <dc:date>2012-11-01T14:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use of GridIndexFeatures geoprocessing tool.</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/use-of-gridindexfeatures-geoprocessing-tool/m-p/725871#M2188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Quentin:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This sounds like a good question for the "ArcObjects - All Development Languages" forum:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/forums/20-ArcObjects-All-Development-Languages"&gt;http://forums.arcgis.com/forums/20-ArcObjects-All-Development-Languages&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you also posted there?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 21:34:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/use-of-gridindexfeatures-geoprocessing-tool/m-p/725871#M2188</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2012-11-09T21:34:46Z</dc:date>
    </item>
  </channel>
</rss>

