<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, 9 Aug 2018 at 08:39, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 8 Aug 2018 at 18:06, Rudi von Staden <<a href="mailto:rudivs@gmail.com" target="_blank">rudivs@gmail.com</a>> wrote:<br>
<br>
><br>
> I did also calculate a range of zonal stats on the layer (which has only one multipolygon feature), but those results were consistent between output / memory layers.<br>
><br>
> Is the area difference expected because of how shapefiles store geometry vs how they are handled by memory layers, or could there be a bug somewhere? Maybe this isn't the recommended way to calculate area? In case it matters, I'm using a custom CRS:<br>
><br>
> "+proj=aea +lat_1=-24 +lat_2=-32 +lat_0=0 +lon_0=24 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"<br>
<br>
This may be a silly question -- but can you confirm that both layers<br>
are definitely in the same CRS?<br></blockquote><div><br></div><div>Yes, they are both the result of an algorithm operating on the same source layer.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If so, I'd try exporting the two geometries to WKT and inspect for<br>
differences. <br></blockquote><div><br></div><div>There are partial differences between the WKT. It seems that the OGR layer drops some polygons. I also used isGeosValid() to check the validity, and the OGR layer reported invalid geometry, while the Memory layer was valid. I should note that the input layer has some invalid geometries (I'm using buffer by 0 to try to clean up the geometry). I've put together a test project and processing script to demonstrate the issue, including text files with the WKT of the memory and ogr features. As a side-note, the script also crashes QGIS a minute or so after running. I suspect it's because I may have used incorrect output parameters.</div><div><br></div><div><a href="https://www.dropbox.com/s/u1la8y63qlabiu4/area_test.zip?dl=0">https://www.dropbox.com/s/u1la8y63qlabiu4/area_test.zip?dl=0</a><br></div><div><br></div><div>Let me know if I should submit a bug report for this.</div><div><br></div><div>Rudi</div></div></div>