You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Most GIS file formats do <strong>not</strong> preserve topological information. This means that neighborhood information is lost as soon as geometries are saved to disk. To illustrate this issue, we consider a geotable over a grid:</p>
<spanid="cb3-3"><ahref="#cb3-3" aria-hidden="true" tabindex="-1"></a>geotable <spanclass="op">=</span> GeoIO.<spanclass="fu">load</span>(<spanclass="st">"data/earth.tif"</span>)</span></code><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></pre></div>
@@ -446,7 +446,7 @@ <h2 data-number="3.2" class="anchored" data-anchor-id="file-formats"><span class
446
446
</div>
447
447
</div>
448
448
<p>If we save the geotable to a <code>.geojson</code> file on disk, and then load it back, we observe that the <code>CartesianGrid</code> gets replaced by a <code>GeometrySet</code>:</p>
@@ -519,7 +519,7 @@ <h2 data-number="3.2" class="anchored" data-anchor-id="file-formats"><span class
519
519
</div>
520
520
</div>
521
521
<p>Other file formats such as <code>.ply</code> and <code>.msh</code> are widely used in <ahref="https://en.wikipedia.org/wiki/Computer_graphics">computer graphics</a> to save geospatial data over meshes, and preserve topological information:</p>
<p>Do we gain anything by not adhering to <strong>programming interfaces</strong>?</p>
544
544
</blockquote>
545
545
<p>The answer is an emphatic <strong>YES</strong>! It means that we have total freedom to innovate and improve the representation of various geometries and geospatial domains with Julia’s amazing type system. To give a simple example, let’s take a look at the <code>Triangle</code> geometry:</p>
<p>If we treated this geometry as a generic polygon represented by a vector of vertices in memory, like it is done in <ahref="https://github.com/JuliaGeo/GeoInterface.jl">GeoInterface.jl</a> for example, we wouldn’t be able to dispatch optimized code that is only valid for a triangle:</p>
<p>Notice how the <code>isconvex</code> function is compiled away to the <strong>constant</strong><code>1</code> (i.e. <code>true</code>) when called on the triangle. The code for a generic polygon is much more complicated and requires runtime checks that are too expensive to afford, especially in 3D.</p>
580
-
<p>Another reason to not adhere to a generic interface is that we can store information in the geometry types themselves (e.g., coordinate reference system) that is relevant to to design advanced scientific visualization features illustrated in the previous chapter, and to dispatch specialized algorithms from geodesic geometry.</p>
580
+
<p>Another reason to not adhere to a generic interface is that we can store information in the geometry types themselves (e.g., coordinate reference system) that is relevant to design advanced scientific visualization features illustrated in the previous chapter, and to dispatch specialized algorithms from geodesic geometry.</p>
581
581
<p>Having cleared that up, we will now proceed to the last foundational chapter of the book, which covers the advanced geometric processing features of the framework.</p>
0 commit comments