<div dir="ltr">Hi Brendan,<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 8:45 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">Le mardi 10 mai 2016 16:31:44, DeTracey, Brendan a écrit :<br>
> Hi,<br>
><br>
> Is there any way to access the wrap dateline capabilities of OGR from the<br>
> Python interface? For example how to split the following polygon:<br>
><br>
> from osgeo import ogr, osr<br>
> srs = osr.SpatialReference()<br>
> srs.ImportFromEPSG(4326)<br>
> p = ogr.CreateGeometryFromWkt('POLYGON ((160 1, -160 1, -160 -1, 160 -1,<br>
> 160 1))')<br>
><br>
><br>
> Looking at the OGRGeometryFactory  source I see :<br>
> static void CutGeometryOnDateLineAndAddToMulti(OGRGeometryCollection*<br>
> poMulti, const OGRGeometry* poGeom, double dfDateLineOffset)<br>
><br>
> but I can't see how to access it from Python. Would it be via an option to<br>
> the ogr.CreateGeometryFromWkt?<br>
<br>
</span>No, this is unavailable through Python bindings.<br>
<br>
With GDAL 2.1, you can use gdal.VectorTranslate() (librarified version of<br>
ogr2ogr), although it might not be very practical if you just need to do that<br>
on a single geometry.<br></blockquote><div><br></div><div>I don't know if using the Python interface to OGR named Fiona is an option for you (Windows support is not 100%), but antimeridian cutting is readily available in the Fiona API: <a href="https://github.com/Toblerity/Fiona/blob/master/fiona/transform.py#L62-L64">https://github.com/Toblerity/Fiona/blob/master/fiona/transform.py#L62-L64</a>.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class=""></div></blockquote></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Sean Gillies</div></div>
</div></div>