<?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: Convert grid lines to polygons in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183843#M56292</link>
    <description>&lt;P&gt;Yeah, that's the source of my query. I mention it in the link in the original post.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 08:13:14 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-06-17T08:13:14Z</dc:date>
    <item>
      <title>Convert grid lines to polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183793#M56283</link>
      <description>&lt;P&gt;I have a SQL script that quickly generates grid line features, for testing purposes, using whatever grid dimensions I need:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/generate-sdo-geometry-grid-using-sql/m-p/1182860" target="_self"&gt;Generate SDO_GEOMETRY grid using SQL&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The result is a spatial view (can be easily exported as a feature class).&lt;/LI&gt;&lt;LI&gt;I'm aware that there are GP tools that can generate grids too. But for my use case, I like this SQL option.&lt;/LI&gt;&lt;LI&gt;The lines are split at the intersections. So this 10x10 grid has 220 lines:&lt;/LI&gt;&lt;/UL&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1655423665298.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43678i43D95D5438D82138/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_1-1655423665298.png" alt="Bud_1-1655423665298.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Is there a way to convert the grid lines to polygons? (i.e. a polygon for each grid &lt;U&gt;cell&lt;/U&gt;)&lt;/P&gt;&lt;P&gt;I tried creating a polygon envelope FC and then I looked for a GP tool that could split the polygon via multiple lines. But I haven't found a GP tool that can do that yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Advanced license: ArcGIS Pro 2.6.8 and ArcMap 10.7.1. Oracle 18c EGDB.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 02:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183793#M56283</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-17T02:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert grid lines to polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183816#M56289</link>
      <description>&lt;P&gt;I suppose one way to do it would be to modify the existing query:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Details:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(1)&lt;/STRONG&gt; Keep only the horizontal lines. Exclude the vertical lines.&lt;/P&gt;&lt;PRE&gt;where&lt;BR /&gt;    startpoint_y = endpoint_y&lt;/PRE&gt;&lt;P&gt;Here's a sample horizontal line:&lt;/P&gt;&lt;PRE&gt;  OBJECTID STARTPOINT_X STARTPOINT_Y ENDPOINT_X ENDPOINT_Y SHAPE         
---------- ------------ ------------ ---------- ---------- --------------
       219            0            0          0          1 [SDO_GEOMETRY]&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;(2)&lt;/STRONG&gt; Add an additional outer query where we generate 5 vertices (a polygon) from the existing 2 vertices (from the original horizontal line):&lt;/P&gt;&lt;PRE&gt;startpoint_x, --vertex 1 (original vertex from the horizontal line)&lt;BR /&gt;startpoint_y,&lt;BR /&gt;&lt;BR /&gt;endpoint_x,   --vertex 2 (original vertex from the horizontal line)&lt;BR /&gt;endpoint_y,&lt;BR /&gt;&lt;BR /&gt;endpoint_x,   --vertex 3&lt;BR /&gt;endpoint_y+1,&lt;BR /&gt;&lt;BR /&gt;startpoint_x, --vertex 4&lt;BR /&gt;startpoint_y+1,&lt;BR /&gt;&lt;BR /&gt;startpoint_x, --vertex 5 (same as vertex 1) https://gis.stackexchange.com/q/433083/62572&lt;BR /&gt;startpoint_y,&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;(3)&lt;/STRONG&gt;&amp;nbsp;Just like with the lines query, construct a polygon geometry by concatenating the coordinates together into WKT.&lt;/P&gt;&lt;PRE&gt;sdo_geometry('polygon(('||startpoint_x||' '||startpoint_y||', '||endpoint_x||' '||endpoint_y||', '||endpoint_x||' '||(endpoint_y+1)||', '||startpoint_x||' '||(startpoint_y+1)||', '||startpoint_x||' '||startpoint_y||'))',26917) as shape&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;(4)&lt;/STRONG&gt;&amp;nbsp;Now, the coordinates look like this (the vertex direction is counterclockwise; vertex 1 and 5 are both 0,0):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1655444825118.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43685iE8D4552817A52485/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1655444825118.png" alt="Bud_0-1655444825118.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(5)&lt;/STRONG&gt;&amp;nbsp;This is what the full query looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1655446947560.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43687iD8B1D4E82F31D3B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_2-1655446947560.png" alt="Bud_2-1655446947560.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;--create or replace view sdo_geom_grid_polygons_vw as (
select
                 objectid,
                 'polygon(('||startpoint_x||' '||startpoint_y||', '||endpoint_x||' '||endpoint_y||', '||endpoint_x||' '||(endpoint_y+1)||', '||startpoint_x||' '||(startpoint_y+1)||', '||startpoint_x||' '||startpoint_y||'))'        as wkt,
    sdo_geometry('polygon(('||startpoint_x||' '||startpoint_y||', '||endpoint_x||' '||endpoint_y||', '||endpoint_x||' '||(endpoint_y+1)||', '||startpoint_x||' '||(startpoint_y+1)||', '||startpoint_x||' '||startpoint_y||'))',26917) as shape
from 
    (

with dimension as (
    select 0 as point from dual
        union all 
    select level
    from dual
    connect by level &amp;lt;= 10
), points as (
    select 
        a.point as startpoint, 
        b.point as endpoint,
        c.point as fixed
    from dimension a
    cross join dimension b
    cross join dimension c
    where b.point - a.point = 1
)
select
    cast(rownum as number(38,0)) as objectid,
    startpoint_x,
    startpoint_y,
    endpoint_x,
    endpoint_y
from
    (
    select
        startpoint as startpoint_x,
        fixed as startpoint_y,
        endpoint as endpoint_x,
        fixed as endpoint_y
    from points
        union all
    select
        fixed as startpoint_x,
        startpoint as startpoint_y,
        fixed as endpoint_x,
        endpoint as endpoint_y
    from points
    )
order by startpoint_x, startpoint_y, endpoint_x, endpoint_y    
)
where
    startpoint_y = endpoint_y --get horizontal lines only
--);&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 17 Jun 2022 23:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183816#M56289</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-17T23:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert grid lines to polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183841#M56291</link>
      <description>&lt;P&gt;related - deja vu&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/72620062/generate-grid-line-coordinates-using-sql" target="_blank"&gt;oracle - Generate grid line coordinates using SQL - Stack Overflow&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 07:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183841#M56291</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-06-17T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert grid lines to polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183843#M56292</link>
      <description>&lt;P&gt;Yeah, that's the source of my query. I mention it in the link in the original post.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:13:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183843#M56292</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-17T08:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert grid lines to polygons</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183846#M56294</link>
      <description>&lt;P&gt;The "feature to polygon" tool can do it no?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 08:39:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183846#M56294</guid>
      <dc:creator>Maps-Berlin</dc:creator>
      <dc:date>2022-06-17T08:39:56Z</dc:date>
    </item>
  </channel>
</rss>

