<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I’m querying an ArcGIS service obtain polygon data, however the service seems to define Island multi-polygons objects as single polygons with multiple exterior rings. This creates invalid OGC geometries and is causing processing problems
 in my workflow.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">He’s the service and a validation test showing the polygon is not valid:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">ogrinfo -dialect sqlite -sql "SELECT TA2013_V1_00_NAME, ST_IsValid(GEOMETRY) FROM OGRGeoJSON"
<a href="http://maps.stats.govt.nz/wss/service/arcgis1/guest/Boundaries/2013_Geographies/MapServer/9/query?f=json&objectIds=36&returnGeometry=true&outSR=4167">
http://maps.stats.govt.nz/wss/service/arcgis1/guest/Boundaries/2013_Geographies/MapServer/9/query?f=json&objectIds=36&returnGeometry=true&outSR=4167</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">GEOS warning: Hole lies outside shell at or near point 174.78189611685229 -41.077770200471164<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">Layer name: SELECT<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">Geometry: None<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">Feature Count: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">Layer SRS WKT:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">(unknown)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">TA2013_V1_00_NAME: String (0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">ST_IsValid(GEOMETRY): Integer (0.0)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">OGRFeature(SELECT):0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">  TA2013_V1_00_NAME (String) = Porirua City<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Courier New"">  ST_IsValid(GEOMETRY) (Integer) = 0<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is this a bug in the data from the service, or just the way the Esri defines geometry objects (and therefor an OGR bug)? I can’t see a definition for multi-polygons in Esri API docs:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000n1000000">http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r3000000n1000000</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">Jeremy Palmer<br>
</span></b><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">LINZ Data Service Manager</span></b><b><span lang="EN-US" style="font-size:9.0pt;color:#37AD47;mso-fareast-language:EN-NZ"><br>
</span></b><b><span lang="EN-US" style="font-size:9.0pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">Landonline & Geospatial Services
</span></b><b><span lang="EN-US" style="font-size:9.0pt;mso-fareast-language:EN-NZ"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">E</span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">  jpalmer@linz.govt.nz
 | </span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">DDI</span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">
 +64 4 498 3537 | </span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">M</span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">
 +64 27 2747 862</span></b><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:EN-NZ"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">Wellington Office, Level 7, Radio New Zealand House, 155 The Terrace<br>
PO Box 5501, Wellington 6145, New Zealand | </span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">T</span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#00ACCD;mso-fareast-language:EN-NZ">
 04 460 0110   </span></b><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ"><br>
</span></b><b><span lang="EN-US" style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ">W  <a href="http://www.linz.govt.nz/" title="http://www.linz.govt.nz/"><span style="color:#00ACCD">www.linz.govt.nz</span></a> |
<a href="http://www.landonline.govt.nz/" title="http://www.landonline.govt.nz/"><span style="color:#00ACCD">www.landonline.govt.nz</span></a> |
<a href="http://www.data.linz.govt.nz/" title="http://www.data.linz.govt.nz/"><span style="color:#00ACCD">data.linz.govt.nz</span></a><br>
</span></b><b><span style="font-size:7.5pt;font-family:"Verdana","sans-serif";color:#37AD47;mso-fareast-language:EN-NZ"><img border="0" width="598" height="67" id="_x0000_i1025" src="cid:image001.png@01CF8EE6.FCAD45B0" alt="http://www.linz.govt.nz/sites/default/files/images/email-signature-v2.png"></span></b><b><span style="color:#37AD47;mso-fareast-language:EN-NZ"><o:p></o:p></span></b></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Verdana" color="Black" size="2">This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If
 you have received this message in error, please notify us immediately (Phone 0800 665 463 or info@linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from
 LINZ. Thank You.<br>
</font>
</body>
</html>