Hugo Ledoux
2024-03-20T08:44:57+01:00
https://3d.bk.tudelft.nl
Hugo Ledoux
Compiling the CGAL Ipelets under macOS 14.2
2024-01-08T15:07:00+01:00
https://3d.bk.tudelft.nl/hledoux/blog/ipe-cgal-ipelets_2024
<p><img src="/hledoux/img/dt2.png" alt="" /></p>
<p><a href="http://doc.cgal.org/latest/CGAL_ipelets/index.html">CGAL Ipelets</a> are great, but with each CGAL and Ipe new releases I need to recompile them, and the procedure seems to be changing all the time.
The latest is that <a href="https://brew.sh/">Homebrew</a> doesn’t seem to have the source of Ipe anymore, it just pulls the official Ipe.app…</p>
<p>For CGAL 5.5.2 and Ipe 7.2.28, here are the steps that work (for me):</p>
<ol>
<li>download Ipe.app from <a href="https://ipe.otfried.org/">ipe.otfried.org</a></li>
<li>install in <code class="language-plaintext highlighter-rouge">/Applications/</code></li>
<li>download the source of Ipe, the <a href="https://github.com/otfried/ipe/">code is on GitHub</a>, and you can download directly the latest: <a href="https://github.com/otfried/ipe/archive/refs/tags/v7.2.28.tar.gz">v7.2.28.tar.gz</a></li>
<li><code class="language-plaintext highlighter-rouge">$ brew install cgal</code></li>
<li>download the latest <a href="http://www.cgal.org/download.html">source code of CGAL</a></li>
<li><code class="language-plaintext highlighter-rouge">$ cd CGAL-5.5.2/demo/CGAL_ipelets/</code></li>
<li><code class="language-plaintext highlighter-rouge">$ cmake . -DIPE_INCLUDE_DIR=/Users/hugo/software/ipe-7.2.28/src/include -DIPE_LIBRARIES=/Applications/Ipe.app/Contents/Frameworks/libipe.dylib</code></li>
<li><code class="language-plaintext highlighter-rouge">$ make</code></li>
<li>you must copy the <code class="language-plaintext highlighter-rouge">*.so</code> and <code class="language-plaintext highlighter-rouge">lua/*.lua</code> to your ipelets folder. Go to the menu ‘Help/Show configuration’ to see where you should put your newly created Ipe extensions. Mine was <code class="language-plaintext highlighter-rouge">~/.ipe/ipelets</code> so I created that folder and copied the extensions.</li>
<li><code class="language-plaintext highlighter-rouge">$ cp *.so ~/.ipe/ipelets/</code></li>
<li><code class="language-plaintext highlighter-rouge">$ cp lua/*.lua ~/.ipe/ipelets/</code></li>
<li>voilà 🚀</li>
</ol>
<p><img src="/hledoux/img/dt1.png" alt="" /></p>
Compiling the CGAL Ipelets under macOS
2018-07-19T19:50:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/ipe-cgal-ipelets_part_deux
<p><img src="/hledoux/img/cat.png" alt="" /></p>
<p><a href="http://doc.cgal.org/latest/CGAL_ipelets/index.html">CGAL Ipelets</a> are great, but with each CGAL and Ipe new releases I need to recompile them, and the procedure seems to be changing all the time.
The latest is that <a href="https://brew.sh/">Homebrew</a> doesn’t have the source of Ipe anymore, it just pulls the official Ipe.app…</p>
<p>For CGAL 4.11 and Ipe 7.2, here are the steps:</p>
<ol>
<li>download Ipe.app from <a href="https://ipe.otfried.org/">ipe.otfried.org</a></li>
<li>install in <code class="language-plaintext highlighter-rouge">/Applications/</code></li>
<li><code class="language-plaintext highlighter-rouge">$ brew install cgal</code></li>
<li>download the latest <a href="http://www.cgal.org/download.html">source code of CGAL</a></li>
<li><code class="language-plaintext highlighter-rouge">$ cd CGAL-4.11.2/demo/CGAL_ipelets/</code></li>
<li><code class="language-plaintext highlighter-rouge">$ cmake . -DIPE_INCLUDE_DIR=/Applications/Ipe.app/Contents/Frameworks/Headers -DIPE_LIBRARIES=/Applications/Ipe.app/Contents/Frameworks/libipe.dylib</code></li>
<li>you must copy the <code class="language-plaintext highlighter-rouge">*.so</code> and <code class="language-plaintext highlighter-rouge">lua/*.lua</code> to your ipelets folder. Go to the menu ‘Help/Show configuration’ to see where you should put your newly created Ipe extensions. Mine was <code class="language-plaintext highlighter-rouge">~/.ipe/ipelets</code> so I created that folder and copied the extensions.</li>
<li><code class="language-plaintext highlighter-rouge">$ cp *.so ~/.ipe/ipelets/</code></li>
<li><code class="language-plaintext highlighter-rouge">$ cp lua/*.lua ~/.ipe/ipelets/</code></li>
<li>voilà</li>
</ol>
<p><img src="/hledoux/img/catdt.png" alt="" /></p>
Version 1.0 of val3dity is released!
2016-04-18T16:59:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/val3dity-released
<p><img src="/hledoux/img/val3dity.png" alt="" /></p>
<p>Today I’m happy to officially release the v1.0 of <a href="https://github.com/tudelft3d/val3dity">val3dity</a>: my code to validate 3D geometries (solids, composite- and multi-surfaces) against the <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=26012">ISO 190107</a> rules.
<a href="https://github.com/tudelft3d/val3dity/releases/tag/v1.0">The source code of v1.0 is available here</a>.</p>
<p>I started in 2010 to work on it (thanks to a sponsorship from <a href="http://www.safe.com">Safe Software</a>), and I’ve been working on it part-time since then.
During the OGC CityGML Quality Interoperability Experiment (QIE) in 2015, I’ve tested and improved it a lot.
It’s now mature, robust and complete enough to be used by anyone.</p>
<p>To use it, you can either compile the code yourself (it’s trivial under Mac and Linux) or use the <a href="http://geovalidation.bk.tudelft.nl/val3dity/">web application</a>.
The latter is a simple server that I maintain: upload your GML file, the latest version of val3dity will validate it and you’ll get a detailed report back.
Your uploaded file is deleted right after it’s been validated, I promise.</p>
<p>Oh, and one nice option: you can even validate your CityGML files directly on your phone!
I’m sure this has happened to you too: you go to bed in the evening and then realise you totally forgot to validate the <code class="language-plaintext highlighter-rouge"><gml:Solid></code> in your file…
Now you don’t need to go back to your computer, you can do that from the comfort of your bed.</p>
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>
<div class="embed-container"><iframe src="https://player.vimeo.com/video/163272193" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe></div>
Validation of CityGML files against the schemas
2016-04-16T10:42:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/citygml-schema-validation
<p>While I work a lot on the data quality of 3D city models, I often brush aside the validation of a CityGML file against the schemas (<code class="language-plaintext highlighter-rouge">*.xsd</code>) of CityGML as a simple and solved problem.
However, while it’s indeed a solved problem, I realised that there are, to my knowledge, no free and easy tools to validate a CityGML file.
Which means that in practice we often see files that are not valid.
I usually use <a href="http://www.oxygenxml.com">oXygen XML</a>, but it is not free and rather cumbersome when the <code class="language-plaintext highlighter-rouge">xsi:schemaLocation</code> for the schemas are not properly setup as in the following.
Then one must manually find the appropriate schemas (v0.4, v1.0 or v2.0) by reading the header, and then find the files locally (“where have I put these again?”)</p>
<figure class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="nt"><CityModel</span>
<span class="na">xmlns:xsi=</span><span class="s">"http://www.w3.org/2001/XMLSchema-instance"</span>
<span class="na">xmlns:pfx0=</span><span class="s">"http://www.citygml.org/citygml/profiles/base/1.0"</span> <span class="na">xmlns:xlink=</span><span class="s">"http://www.w3.org/1999/xlink"</span>
<span class="err">...</span>
<span class="na">xsi:schemaLocation=</span><span class="s">"http://www.citygml.org/citygml/profiles/base/1.0 http://schemas.opengis.net/citygml/profiles/base/1.0/CityGML.xsd"</span><span class="nt">></span></code></pre></figure>
<p>So I wrote a small Python script that takes as input a CityGML file, determines which version of CityGML is used, validate the file and give the first error, if any.
I think it can be useful to others.
<a href="https://github.com/tudelft3d/CityGML-schema-validation">Get it there</a></p>
<p>To use:</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./valxsdcitygml.py input.gml</code></pre></figure>
<p>or you can also give a folder and all XML and GML files in that folder (and in all the folders inside that one) are validated</p>
<figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./valxsdcitygml.py /home/elvis/data/</code></pre></figure>
My setup for GIS research
2015-10-12T08:46:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/my-setup
<p>In the spirit of <a href="https://usesthis.com">the Setup</a> and <a href="http://lifehacker.com/tag/how-i-work">How I Work</a>, here’s a list of the software I use for carrying out my research in (3D) GIS.</p>
<h2 id="hardware">Hardware?</h2>
<p>In the last 10 years, I’ve moved from Windows, to Linux, to Mac OS X, which I use since 2010.
I have only one computer, a MacBook Pro 15” Retina with 256GB SSD and 16GB of RAM, and I use an external 24” monitor and an <a href="http://www.apple.com/shop/product/MB110LL/B/apple-keyboard-with-numeric-keypad-english-usa">external keyboard</a> and <a href="https://www.apple.com/magictrackpad/">trackpad</a>, both at home (where I often work) and in the office.</p>
<p>I used to have other computers, eg iMacs, but maintaining my setup and configurations on different computer was taking too much time.
One computer is more efficient and simpler.</p>
<h2 id="backing-up">Backing up</h2>
<p>I have had 2 hard-drive failures in my life, one was rather dramatic: at the end of a semester at the university while I was following 7 courses.
I lost <em>everything</em>, since back then backups meant more or less using floppy disks.
So I’m now rather obsessed with backing up: </p>
<ul>
<li>All the code I write is on <strong><a href="https://github.com/hugoledoux/">GitHub</a></strong>, many of it is private first, when it’s in a serious state it’s release under an open-source licence.</li>
<li>While the GitHub Desktop program is fine, I find <strong><a href="http://www.git-tower.com">Tower</a></strong> to be more powerful (eg searching commits), and branching, reverting and other git commands are easy to grasp. Before Tower, git on the command line was one big scary thing for me.</li>
<li>Other documents are in <strong><a href="https://www.dropbox.com">Dropbox</a></strong>, and I pay an annual subscription. It’s expensive, but Dropbox has <em>never</em> failed me once in 5 years, which is worth a lot of money in my opinion.</li>
<li>I backup everyday my computer to a <strong><a href="https://en.wikipedia.org/wiki/Time_Machine_(Mac_OS_X)">Time Machine</a></strong> at home, so if a disaster happens I should be fine. I have a <strong><a href="https://www.apple.com/airport-time-capsule/">Time Capsule</a></strong>, so all the backups are done automatically.</li>
</ul>
<h2 id="gis-software">GIS software</h2>
<ul>
<li><strong><a href="http://qgis.org">QGIS</a></strong> is my ‘daily GIS’. I started using it in 2007, and back then you really had to be stubborn to use it, because it was incomplete and buggy. But nowadays, it is stable, fast, simple and I don’t feel that those using <a href="http://www.arcgis.com">ArcGIS</a> have an advantage (quite the opposite).</li>
<li><strong><a href="http://www.safe.com/fme/fme-desktop/">FME</a></strong> is my other GIS. QGIS is pretty primitive for 3D and CityGML, and that’s where FME compensates. Just to be able to visualise CityGML file properly in 3D under a Mac, it is worth it.</li>
</ul>
<h2 id="writing">Writing</h2>
<ul>
<li>I use <strong><a href="https://www.tug.org/mactex/">LaTeX</a></strong> for writing, and only Word when I’m forced to by coauthors or the editor of a journal.</li>
<li><strong><a href="https://www.sublimetext.com">Sublime Text</a></strong> with the <strong><a href="https://github.com/SublimeText/LaTeXTools">LaTeXTools</a></strong> is pretty much the perfect LaTeX environment. My only quibble is that there is no option to see the table of content of a paper <em>ordered</em> (a nice option with TextMate).</li>
<li>my bibliography is stored in BibTeX, and I use either <strong><a href="http://bibdesk.sourceforge.net">BibDesk</a></strong> and/or <strong><a href="http://jabref.sourceforge.net">JabRef</a></strong>, both have nice features.</li>
<li><strong><a href="http://ipe.otfried.org">IPE</a></strong> is great for drawing anything where geometries are involved. It creates figures directly in PDF (so no need to maintain 2 files), and one can write directly LaTeX formulas. It’s also extensible, and <a href="/hledoux/blog/ipe-cgal-ipelets/">the CGAL ipelets are easy to install</a>.</li>
<li><strong><a href="http://www.pixelmator.com/mac/">Pixelmator</a></strong> is great for editing photos and raster images.</li>
<li>while I’m still a dummy with <strong><a href="http://www.blender.org">Blender</a></strong>, I’m trying to use it more and more to produce nice figures in 3D.</li>
<li>this blog/website is made with <strong><a href="http://jekyllrb.com">Jekyll</a></strong>, and its <a href="https://github.com/hugoledoux/mywebsite">source code is freely available</a>.</li>
<li>I write blog posts and other small bits in <a href="http://daringfireball.net/projects/markdown/">Markdown</a> and use <strong><a href="http://marked2app.com">Marked 2</a></strong> to preview it (the features to check if the URLs in a document are valid is very useful).</li>
</ul>
<h2 id="presenting">Presenting</h2>
<ul>
<li><strong><a href="https://www.apple.com/mac/keynote/">Keynote</a></strong> is much better than PowerPoint, and I like the fact that I can copy-and-paste tables/algorithms/figures in a PDF (created with LaTeX for instance) and everything stays vectorial and thus sharp on a big screen.</li>
<li><strong><a href="https://bitbucket.org/rivanvx/beamer/wiki/Home">Beamer</a></strong> (presentations made with LaTeX) is also useful for presentations with many mathematical equations and figures.</li>
<li><strong><a href="http://lightheadsw.com/caffeine/">Caffeine</a></strong> prevents your computer from automatically going to sleep, for example when you answer questions at the end of a presentation.</li>
</ul>
<h2 id="programming">Programming</h2>
<ul>
<li>for Python/CSS/HTML, I use <strong><a href="https://www.sublimetext.com">Sublime Text</a></strong>.</li>
<li>for C++, I use both <strong><a href="https://developer.apple.com/xcode/">Xcode</a></strong> (to navigation code, suggestions, auto-complete, etc) and Sublime Text (for the multiple selections feature; I don’t even know how I managed to get things done without these). Both are open at the same time.</li>
<li>the libraries my colleagues and I use for our research are listed <a href="https://3d.bk.tudelft.nl/open-gis-software/">there</a>. We mostly use Python and C++.</li>
</ul>
<h2 id="miscellaneous">Miscellaneous</h2>
<ul>
<li><strong><a href="http://notational.net">Notational Velocity</a></strong> for taking notes (and searching them). I store these in Dropbox (simple text files) and have access to them on my phone. This is slowly replacing my paper notebook during meetings—the capabilities to search notes is very handy.</li>
<li><strong><a href="https://agilebits.com/onepassword">1Password</a></strong> to easily manage different passwords for each website.</li>
<li><strong><a href="http://www.trankynam.com/atext/">atext</a></strong> replaces abbreviations by full texts. Useful for so many things: difference signatures in emails, addresses, coding, phone numbers, etc</li>
<li><strong><a href="https://www.driftt.com/annotate-mac">Annotate</a></strong> is very useful to quickly capture part of the screen, annotating it, uploading the result to Dropbox for instance, and copying the URL to your clipboard.</li>
<li><strong><a href="http://jumpcut.sourceforge.net">Jumpcut</a></strong> is tiny and free application to that provides clipboard buffering. Can’t imagine not having this installed.</li>
<li>Finder lacks the dual-panel power of <a href="https://en.wikipedia.org/wiki/Norton_Commander">Norton Commander</a>, so I use <strong><a href="http://www.binarynights.com/forklift/">ForkLift</a></strong>.</li>
<li><strong><a href="http://fluidapp.com">Fluid</a></strong> simply makes an application (a .app) from one website, eg Gmail. The big advantage is that you can have a separate cache from that of Safari/Chrome, which means that I’m never logged in to Google in my browser, and yet I use Gmail as my email in the web interface.</li>
</ul>
Are your solids the same as my solids?
2015-06-29T00:00:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/your-solids-the-same
<p><img src="/hledoux/img/repair3d.png" alt="" /></p>
<p>While the definitions found in the <a href="https://en.wikipedia.org/wiki/Simple_Features">OGC/ISO Simple Features specifications</a> for 2D primitives are well-accepted and used in practice by virtually everyone in the GIS community, I have noticed that the ones for 3D primitives (especially for the volumetric primitive, called a <em>solid</em> or a <em>polyhedron</em>) are in almost all cases ignored by software vendors, by practitioners, and even by academics<sup id="fnref:academics" role="doc-noteref"><a href="#fn:academics" class="footnote" rel="footnote">1</a></sup>.
Many GIS vendors now offer 3D capabilities, but unfortunately they take great liberties in defining what “3D GIS” means—and no a perspective view on a 2.5D terrain does not qualify as 3D GIS in my opinion.</p>
<p>It seems to me that each vendor is currently implementing its own version of what it <em>thinks</em> a solid should be.
Or, perhaps more accurately, the definition of a solid is driven by what can be technically achieved by the vendor (and since holes and cavities are complex to model in a computer, they are almost in all cases ignored).
To make things worse, the different definitions of solids used are rarely documented.
Exchanging and converting datasets from one format/platform to another is thus at this moment <em>highly problematic</em>, and in my opinion hinders severely the use and the development of 3D functions.</p>
<p>To help practitioners dealing with 3D objects, I explain below what a 3D solid is according to the international standard, and I try to give as many insights as possible to explain what these mean.</p>
<h2 id="to-be-fair-even-mathematicians-dont-agree">To be fair, even mathematicians don’t agree…</h2>
<p>I must admit that representing a solid is far more complex than representing a 2D polygon, and that different disciplines use rather different definitions.
This is best illustrated by Grünbaum (2003)<sup id="fnref:Grunbaum03" role="doc-noteref"><a href="#fn:Grunbaum03" class="footnote" rel="footnote">2</a></sup><sup id="fnref:inspiration" role="doc-noteref"><a href="#fn:inspiration" class="footnote" rel="footnote">3</a></sup>, who states that even in the field of mathematics opinions differ as to what constitutes the term “polyhedron”.
Some use it only for a regular polyhedron, or only for a convex one, and some consider non-planar faces as part of the definition.
The authoritative textbook on computational geometry<sup id="fnref:compgeobook" role="doc-noteref"><a href="#fn:compgeobook" class="footnote" rel="footnote">4</a></sup> characterises the term as “difficult to define”, and give a simple definition that is probably the most common one: a polyhedron is a 3D solid bounded by planar faces.
The bounding faces are thus planar surfaces embedded in the 3D Euclidean space, and the bounding surfaces form a <em>two-dimensional manifold</em> (or 2-manifold for short).
A 2-manifold is a topological space that is topologically equivalent to a 2D space—an obvious example is the surface of the Earth, for which near to every point the surrounding area is topologically equivalent to a plane.</p>
<h2 id="what-is-an-iso19107-solid">What is an ISO19107 solid?</h2>
<p>The international standard <a href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=26012">ISO19107</a> definition of a solid is broader than that of a 2-manifold, and it permit us to represent all the real-world features.
It is basically a generalisation to 3D of a polygon, which can have interior boundaries/rings:</p>
<p><img src="/hledoux/img/gispolygons.png" alt="" /></p>
<p>The ISO19107 geometric primitives are:</p>
<p><img src="/hledoux/img/isoprimitives.png" alt="" /></p>
<p>A primitive is built with lower-dimensional primitives, eg in the figure above the <code class="language-plaintext highlighter-rouge">GM_Surface</code> is composed of 2 (closed) <code class="language-plaintext highlighter-rouge">GM_Curves</code>, which are composed on several <code class="language-plaintext highlighter-rouge">GM_Points</code>.
Observe that primitives do not need to be linear or planar, ie curves defined by mathematical functions are allowed.</p>
<p>In our context, the following three definitions from ISO19107 are relevant:</p>
<blockquote>
<p>A <code class="language-plaintext highlighter-rouge">GM_Solid</code> is the basis for 3-dimensional geometry. The extent of a solid is defined by the boundary surfaces. The boundaries of <code class="language-plaintext highlighter-rouge">GM_Solids</code> shall be represented as <code class="language-plaintext highlighter-rouge">GM_SolidBoundary</code>. […] The <code class="language-plaintext highlighter-rouge">GM_OrientablesSurfaces</code> that bound a solid shall be oriented outward.</p>
</blockquote>
<blockquote>
<p>A <code class="language-plaintext highlighter-rouge">GM_Shell</code> is used to represent a single connected component of a <code class="language-plaintext highlighter-rouge">GM_SolidBoundary</code>. It consists of a number of references to <code class="language-plaintext highlighter-rouge">GM_OrientableSurfaces</code> connected in a topological cycle (an object whose boundary is empty). […] Like <code class="language-plaintext highlighter-rouge">GM_Rings</code>, <code class="language-plaintext highlighter-rouge">GM_Shells</code> are simple.</p>
</blockquote>
<blockquote>
<p>A <code class="language-plaintext highlighter-rouge">GM_Object</code> is <em>simple</em> if it has no interior point of self-intersection or self-tangency. In mathematical formalisms, this means that every point in the interior of the object must have a metric neighbourhood whose intersection with the object is isomorphic to an <em>n</em>-sphere, where <em>n</em> is the dimension of this <code class="language-plaintext highlighter-rouge">GM_Object</code>.</p>
</blockquote>
<p>The bounding surfaces of a shell thus form a <em>closed</em> and <em>orientable</em> 2-manifold.
Closed means that there should not be ‘holes’ in the surface (in other words, it should be watertight).</p>
<p>A solid that respects that definition is as follows:</p>
<p><img src="/hledoux/img/isosolid.png" alt="" /></p>
<p>First observe that the solid is composed of two shells (both forming its boundaries), one being the exterior and one being the interior shell.
This is conceptually the same as a 2D polygon that has an inner ring.
The exterior shell has eleven surfaces, and the interior one six.
An interior shell creates a cavity in the solid—cavities are also referred to as ‘voids’, or holes, in a solid.
A solid does not need to have an interior shell, and can contain an infinity of them.</p>
<p>Observe that a cavity is not the same as a hole in a torus (a donut) such as that in the following figure: it can be represented with one exterior shell having a <a href="http://en.wikipedia.org/wiki/Genus_(mathematics)">genus</a> of 1 (there are no interior shell).</p>
<p><img src="/hledoux/img/torus.png" alt="" width="400px" /></p>
<h2 id="assertions-to-verify-the-validity-of-a-solid">Assertions to verify the validity of a solid</h2>
<p>According to the ISO19107 abstract specifications, the different boundaries of a solid are allowed to interact with each other, but only under certain circumstances.
Since there is no implementation specifications (yet?) for 3D primitives, we have to generalise the following assertions for the validity of a 2D polygon (which you can find on pages 27-28 of the <a href="http://portal.opengeospatial.org/files/?artifact_id=25355">Simple Features document</a>):</p>
<blockquote>
<ol>
<li>Polygons are topologically closed;</li>
<li>The boundary of a Polygon consists of a set of LinearRings that make up its exterior and interior boundaries;</li>
<li>No two Rings in the boundary cross and the Rings in the boundary of a Polygon may intersect at a Point but only as a tangent, eg
\(\forall P \in Polygon, \forall c1, c2 \in P.Boundary(), c1 \neq c2,\)
\(\forall p, q \in Point, p, q \in c1, p \neq q, [p \in c2 \Rightarrow q \notin c2];\)</li>
<li>A Polygon may not have cut lines, spikes or punctures, eg
\(\forall P \in Polygon, P = P.Interior.Closure;\)</li>
<li>The interior of every Polygon is a connected point set;</li>
<li>The exterior of a Polygon with 1 or more holes is not connected. Each hole defines a connected component of the exterior.</li>
</ol>
</blockquote>
<p>Observe that all of them, except the 3rd one, generalise directly to 3D since a point-set topology nomenclature is used.
The only modifications needed are that, in 3D, polygons become solids, rings become shells, and holes become cavities.</p>
<p>To further explain what the assertions are in 3D, the figure below shows 12 solids, some of them valid, some not; all the statements below refer to these solids.</p>
<p><img src="/hledoux/img/validornot.png" alt="" /></p>
<p>The first assertion of the OGC means that a solid must be closed, or ‘watertight’ (even if it contains interior shells).
The solid <em>s</em><sub>1</sub> is thus not valid but <em>s</em><sub>2</sub> is since the hole in the top surface is `filled’ with other surfaces.</p>
<p>The second assertion implies that each shell must be <em>simple</em> (ie a 2-manifold).</p>
<p>The third assertion means that the boundaries of the shells can intersect each others, but the intersection between the shells can only contain primitives of dimensionality 0 (vertices) and 1 (edges).
If a surface or a volume is contained, then the solid is not valid.
The solid <em>s</em><sub>3</sub> is an example of a valid solid: it has two interior shells whose boundaries intersect at one point (at the apexes of the tetrahedra), and the apex of one of the tetrahedra is coplanar with the 4 points forming one surface of the exterior shell.
If the interior of the two interior shells intersects (as in <em>s</em><sub>4</sub>) the solid is not valid; this is also related to the sixth assertion stating that each cavity must define one connected component: if the interior of two cavities are intersecting they define the same connected component.
Notice also that <em>s</em><sub>5</sub> is not valid since one surface of its cavity intersects with one surface of the exterior shell (they “share a surface”); <em>s</em><sub>5</sub> should be represented with one single exterior shell (having a ‘dent’), and no interior shell.</p>
<p>The fourth assertion states that a shell is a 2-manifold and that no dangling pieces can exist (such as that of <em>s</em><sub>6</sub>); it is equivalent to the <em>regularisation</em> of a point-set in 3D.</p>
<p>The fifth assertion states that the interior of a solid must form a connected point-set (in 3D).
Consider the solid <em>s</em><sub>7</sub>, it is valid since its interior is connected and it fulfils the other assertions; notice that it is a 2-manifold but that unlike other solids in the figure (except <em>s</em><sub>8</sub>) its <a href="http://en.wikipedia.org/wiki/Genus_(mathematics)">genus</a> is 1.
If we move the location of the triangular prism so that it touches the boundary of the exterior shell (as in <em>s</em><sub>8</sub>), then the solid becomes invalid since its interior is not connected anymore, and also since its exterior shell is not simple anymore (2 edges have 4 incident planar faces, which is not 2-manifold).
It is also possible that the interior shell of a solid separates the solid into two parts: the interior shell of <em>s</em><sub>9</sub> (exterior shell is not coloured for clarity) is a pyramid having four of its edges intersecting with the exterior shell, but no two surfaces are shared, thus these interactions are allowed.
However, the presence of the pyramid separates the interior of the solid into two unconnected volumes (violating assertion 5); for both <em>s</em><sub>8</sub> and <em>s</em><sub>9</sub>, the only possible valid representation is with two different solids.</p>
<p>Notice also that for a solid to be valid, all its lower-dimensionality primitives must be valid.
That is, each surface of the shells has to be valid according to the Simple Features assertions.
An example of an invalid surface would be one having a hole (an inner ring) overlapping the exterior ring (see <em>s</em><sub>10</sub>).</p>
<p>Furthermore, it should also be noticed that for a solid to be valid both its topology and its geometry should be valid.
A solid such as <em>s</em><sub>11</sub> is valid, but if the location of only one of its vertices is modified (for instance if the apex of the pyramid of <em>s</em><sub>11</sub> is moved downwards to form <em>s</em><sub>12</sub>) then it becomes invalid.
Both <em>s</em><sub>11</sub> and <em>s</em><sub>12</sub> can be represented with a graph having exactly the same topology (which is valid for both), but if we consider the geometry then the latter solid is not valid since its exterior shell is not simple.</p>
<h2 id="ok-theory-is-nice-but-what-do-people-do-in-practice">OK, theory is nice, but what do people do in practice?</h2>
<p>While in theory GML allows one to implement non-planar primitives, in practice, for most practical uses, only linear/planar primitives are used.
CityGML actually uses only a subset of the ISO19107 primitives: (1) <code class="language-plaintext highlighter-rouge">GM_Curves</code> can only be <em>linear</em> (thus only <code class="language-plaintext highlighter-rouge">LineStrings</code> and <code class="language-plaintext highlighter-rouge">LinearRings</code> are used); (2) <code class="language-plaintext highlighter-rouge">GM_Surfaces</code> can only be <em>planar</em> (thus `Polygons are used).</p>
<p><img src="/hledoux/img/citygmlprimitives.png" alt="" /></p>
<p>Since the polygons are embedded in 3D, they have to be planar: all their points (used for both the exterior and interior rings) have to lie on a plane.
Surprisingly, the concept of <em>tolerance</em> is not mentioned in the standards ISO and OGC, thus it is difficult to answer clearly whether a polygon is planar or not.</p>
<p>Lastly, the orientation of the polygons must be considered.
In 2D, the only requirement for a polygon is that its exterior ring must have the opposite orientation of that of its interior ring(s) (eg clockwise versus counterclockwise).
In 3D, if one polygon is used to construct a shell, its exterior ring must be oriented in such as way that, when viewed from the outside of the shell, the points are ordered counterclockwise.
See for instance this solid and the orientation of three of its polygons (different colours).</p>
<p><img src="/hledoux/img/orientation.png" alt="" width="400px" /></p>
<p>In other words, the normal of the surface must point outwards if a right-hand system is used, ie when the ordering of points follows the direction of rotation of the curled fingers of the right hand, then the thumb points towards the outside.
If the polygon has interior rings, then these have to be ordered clockwise.</p>
<h2 id="val3dity-a-validator-for-gml-primitives">val3dity: a validator for GML primitives</h2>
<p>If you have solids stored in GML, you can verify whether they follow the ISO19107 definitions by using the validator (called ‘val3dity’) I have developed.
The code is freely available on <a href="https://github.com/tudelft3d/val3dity">GitHub</a>, and I offer a <a href="http://geovalidation.bk.tudelft.nl/val3dity/">web application</a> where you can upload your GML files and get a report detailing the errors.</p>
<h2 id="futher-reading">Futher reading</h2>
<p>Most of the details of the implementation and the methodology used are available in this scientific article:</p>
<blockquote>
<p>Ledoux, Hugo (2013). On the validation of solids represented with the
international standards for geographic information. <em>Computer-Aided Civil and Infrastructure Engineering</em>, 28(9):693-706. <a href="https://3d.bk.tudelft.nl/hledoux/pdfs/13_cacaie.pdf"> [PDF] </a> <a href="http://dx.doi.org/10.1111/mice.12043"> [DOI] </a></p>
</blockquote>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:academics" role="doc-endnote">
<p>we have the—deserved!?—reputation of over-complicating simple things, so I’m puzzled as to why even academics in GIS tend to reduce solids to much simpler objects. <a href="#fnref:academics" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:Grunbaum03" role="doc-endnote">
<p>B. Grünbaum. Are your polyhedra the same as my polyhedra? In B. Aronov, S. Basu, J. Pach, and M. Sharir, editors, <em>Discrete and Computational Geometry: The Goodman-Pollack Festschrift</em>, pages 461– 488. Springer, 2003. <a href="#fnref:Grunbaum03" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:inspiration" role="doc-endnote">
<p>yes, the title of this blog post is heavily inspired by that of Grünbaum (2003). <a href="#fnref:inspiration" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
<li id="fn:compgeobook" role="doc-endnote">
<p>M. de Berg, M. van Kreveld, M. Overmars, and O. Schwarzkopf. <em>Computational geometry: Algorithms and applications</em>. Springer-Verlag, Berlin, second edition, 2000. <a href="#fnref:compgeobook" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Plagiarism in academia and how a paper of mine was handled
2015-05-21T00:00:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/plagiarism-pprepair
<p>I’ve hesitated a lot before writing this blog post.
Should I or should I not openly discuss what happened to my coauthors and me in recent months? Is it fair to name the authors and point to the paper?
I’ve decided that yes it’s worth writing what happened to us, firstly because there are a lot of positive aspects to it, and second because if we all sweep these cases “under the carpet” then there is little hope that things will improve and people will be tempted to cheat (since there is no punishment).</p>
<p>Here’s what happened. My colleague <a href="http://www.gdmc.nl/martijn">Martijn Meijers</a> and myself developed in 2009 a method to validate planar partitions stored in Simple Features (to detect gaps and overlaps).
The methodology and the prototype were first published in the SDH 2010 proceedings (<a href="http://www.isprs.org/proceedings/XXXVIII/part2/Papers/24_Paper.pdf">the paper</a>), and shortly after <a href="http://3dgeoinfo.bk.tudelft.nl/ken">Ken Arroyo Ohori</a> extended the ideas during his <a href="http://repository.tudelft.nl/view/ir/uuid%3A78807acb-4115-478c-93de-68b9db884c8e/">MSc thesis</a>.
He added automatic repair functions, did a great C++ implementation that scales to large datasets, and <a href="https://github.com/tudelft3d/pprepair">released the code open-source</a>.
The code is rather popular: among others, it’s been integrated in <a href="http://www.safe.com/fme/">FME</a> and the <a href="https://github.com/AmericanRedCross/simplegadm">American Red Cross uses it to build their datasets</a>.
Simply put, the methodology is based on a constrained triangulation of the input polygons; we validate planar partitions by labelling triangles and ensuring that each triangle has one and only one label, and we repair by modifying the labels.
We have published our methodology in a journal paper in 2012:</p>
<blockquote>
<p>Ken Arroyo Ohori, Hugo Ledoux and Martijn Meijers (2012).
Validation and automatic repair of planar partitions using a constrained triangulation.
<em>Photogrammetrie, Fernerkundung, Geoinformation</em> 1(5):613–630. <a href="http://3dgeoinfo.bk.tudelft.nl/hledoux/pdfs/12_pfg.pdf">[PDF]</a> <a href="http://dx.doi.org/10.1127/1432-8364/2012/0143">[link to paper]</a></p>
</blockquote>
<p>We noticed in December 2014 that a new paper in the <a href="http://www.tandfonline.com/toc/tgis20/current">International Journal of Geographical Information Science (IJGIS)</a> was, in our opinion, eerily similar to ours:</p>
<blockquote>
<p>Sunghwan Cho, M. Xavier Punithan, Jonggun Gim and Yong Huh (2014).
Tagging-the-triangle algorithm for partitioning features with inconsistent boundaries.
International Journal of Geographical Information Science 28(12):2533-2550 <a href="http://dx.doi.org/10.1080/13658816.2014.937716">[link to paper]</a></p>
</blockquote>
<p>Also, our work was neither cited nor acknowledged.
I say eerily similar because of the following.</p>
<h3 id="1-exact-same-solution-for-the-exact-same-problem">1. Exact same solution for the exact same problem</h3>
<p>The problem in both papers is the construction of a planar partition from a set of polygons with gaps/overlaps, and both solutions are identical: the use of a constrained triangulation of the polygons as a base, labelling each polygon with the polygons that it belongs to, and reconstruction of the polygons from the triangulation. It is fair to mention that their paper goes one step further (subdivision of the problematic areas), but they use the exact solution we mentioned in our future work and that was implemented in 2011 by Martijn Meijers in his <a href="http://www.gdmc.nl/publications/2011/Variable-scale_Geo-information.pdf">PhD thesis</a>.
The thesis of Martijn is also not cited.</p>
<h3 id="2-both-papers-use-the-same-criticism-of-the-current-standard-solution">2. Both papers use the same criticism of the current standard solution</h3>
<p>That is, snapping within a predefined threshold requires finding an acceptable threshold (which may or may not exist) and might create various topological inconsistencies.</p>
<h3 id="3-several-figures-are-extremely-similar">3. Several figures are extremely similar</h3>
<p>The figures concerning the problems with snapping are almost identical, see for instance these 3 (left our paper; right theirs).</p>
<p><img src="/hledoux/img/plaex1.png" alt="" /></p>
<hr />
<p><img src="/hledoux/img/plaex2.png" alt="" /></p>
<hr />
<p><img src="/hledoux/img/plaex3.png" alt="" /></p>
<h3 id="4-several-sentences-on-key-issues-are-extremely-similar">4. Several sentences on key issues are extremely similar</h3>
<p>We:</p>
<blockquote>
<p>If the set of input polygons forms a planar partition, then each segment will be inserted twice (except those forming the outer boundary of the set of input polygons). This is usually not a problem for triangulation libraries because they ignore points and segments at the same location (as is the case with the solution we use, see Section 4). When segments are found to intersect, they are split with a new point created at the intersection.</p>
</blockquote>
<p>They:</p>
<blockquote>
<p>If two polygons share an edge e, the edge e is drawn twice. Because most triangulation programming libraries discard one point in the case of duplicate points, this step does not require further manipulation. Likewise, when edges intersect, they are split using a new vertex that is created at the intersection point.</p>
</blockquote>
<hr />
<p>We:</p>
<blockquote>
<p>If the set of input polygons forms a planar partition then all the triangles will be labelled with one and only one label. The problems are easily detected: Gaps are detected by finding triangles without any labels. Overlaps are detected by finding triangles with two or more labels.</p>
</blockquote>
<p>They:</p>
<blockquote>
<p>If all polygons in a data set form a planar partition, all triangles will be tagged as 1. Gaps or overlaps are easily recognised by checking whether the tag value is equal to 1 or not.</p>
</blockquote>
<h3 id="what-is-plagiarism">What is plagiarism?</h3>
<p>Individually, all of these could be coincidences.
But taken together it all seems a bit too much.</p>
<p>Is their paper a copy of ours? No, it also differs significantly.
And strictly speaking, no full sentences were copied.
However, the thrust of their paper is the triangle-based algorithm to form a planar partition from a set of polygons.
Without this algorithm, there is no paper in my opinion.</p>
<p>Moreover, it seems utterly impossible that the authors were not aware of our work on this topic, which spans several papers.
Simple Google searches, using their own keywords and terms, lead to several instances of our work in the first page (<a href="https://startpage.com/do/search?q=gaps+overlaps+triangulation+partitioning">one example</a>, <a href="https://startpage.com/do/search?query=inconsistent%20boundaries%20sliver%20polygons">another one</a>).</p>
<h3 id="ijgis-editors-reacted-quickly">IJGIS editors reacted quickly</h3>
<p>We notified the editors of IJGIS and they took the issue very seriously and responded quickly.
Which I appreciated a lot.
They followed the <a href="http://publicationethics.org">COPE (Committee on Publishing Ethics) guidelines</a>, which basically forces the authors to explain the similarities within a given frame of time.</p>
<p>Their answer was that they were not aware of the paper, and that if they had been, they would have cited it.
It has just been published online as a <a href="http://dx.doi.org/10.1080/13658816.2015.1008949">corrigendum</a>.
In the official PDF there is no mention of a correction, only on the <a href="http://dx.doi.org/10.1080/13658816.2014.937716">webpage of the paper</a> can one see a correction, which is not very obvious.</p>
<p><img src="/hledoux/img/tttcorrection.png" alt="" /></p>
<p><em>
Update (2015-05-28): I was just informed by Taylor&Francis (<a href="https://twitter.com/tandfauthorserv/status/603830792859561984">in a tweet</a>, very 2015) that the CrossMark above the title also links to the corrigendum.
I didn’t know that, and I had actually never clicked on any CrossMarks nor noticed them.
Good to know though.
</em></p>
<p><img src="/hledoux/img/crossmark.png" alt="" /></p>
<p>Not surprisingly, I am not very happy with this outcome.
But is it worth pursuing the matter?
We decided not to, because proving that this is plagiarism is complex it seems and we do not gain much from it.
So instead I decided to write this blog post.</p>
<p>Could the editors have done more?
Perhaps, but proving plagiarism is also complex for them.
I think they handled this case rather well.</p>
<p>Thus, case closed.
It’s time to go back to writing more papers 😕</p>
<p><em>
Update (2016-07-25): For the sake of transparency, I should add that one of the authors of the paper has recently contacted me and asked me to remove this blog post.
He argues that it is damaging to his academic career, and that since I accepted the decision of editor I should not have written a text that implies that there was plagiarism.
I asked him to explain the four similarities above, but he provided no answer (only that he submitted them to the editor, but these were never forwarded to us, only the corrigendum was), and stated that I “should have continued [my] battle with [the editor] in all possible ways legally”.
As stated above, my co-authors and I accepted the decision because we thought this was the best we could obtain under the circumstances, and thought that fighting this was simply not worth our time.
I wrote this blog post to describe in a transparent manner what happened to me, to highlight the good and bad points of my experience, and to help others.
Removing it would not be very transparent in my opinion.
<em></em></em></p>
Ipe with the CGAL Ipelets is now ridiculously easy under Mac
2015-04-09T00:00:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/ipe-cgal-ipelets
<p><em>Update 2018-07-19:</em> this doesn’t work anymore, go to the <a href="/hledoux/blog/ipe-cgal-ipelets_part_deux/">new updated page</a>.</p>
<hr />
<p><img src="/hledoux/img/ipe1.png" alt="" /></p>
<p>My favourite drawing program for anything where triangles and geometry are involved is <a href="http://ipe7.sourceforge.net">Ipe</a>.
It’s free, open-source, has built-in LaTeX support and is extensible.
One of the nicest extensions for me is the <a href="http://doc.cgal.org/latest/CGAL_ipelets/index.html">CGAL Ipelets</a>: all the power of CGAL easily accessible.</p>
<p>Until recently the main problem (at least under Mac) was the installation of these with Ipe.
I remember spending a whole morning a few years ago compiling everything—it worked but it was painful.
When Ipe and CGAL were upgraded a few months later, I was too lazy to do this again…</p>
<p>It’s now ridiculously easy, thanks partly to <a href="http://brew.sh">Homebrew</a>.</p>
<p>First install both and their dependencies:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ brew install cgal
$ brew install ipe
</code></pre></div></div>
<p>Second, download the latest <a href="http://www.cgal.org/download.html">source code of CGAL</a> and then:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd CGAL_ipelets/demo/CGAL_ipelets/
$ cmake .
$ make
</code></pre></div></div>
<p><em>Update 2016-01-24:</em> IPE now requires that the shared objects under Mac OS X are <code class="language-plaintext highlighter-rouge">*.dylib</code> and not the <code class="language-plaintext highlighter-rouge">*.so</code> that the makefile creates (CGAL should update their makefile, but they haven’t yet).
Thus, simply rename all the <code class="language-plaintext highlighter-rouge">*.so</code> to <code class="language-plaintext highlighter-rouge">*.dylib</code>, and it works.
<del>I had problems compiling <code class="language-plaintext highlighter-rouge">circle_pencils.cpp</code>, so I simply removed it (I’m lazy and I don’t need it).
All the other extensions compiled without issues.</del></p>
<p>Third, launch ipe (<code class="language-plaintext highlighter-rouge">$ ipe</code>, it’s now in your path) and go the menu ‘Help/Show configuration’ to see where you should put your newly created Ipe extensions.
Mine was <code class="language-plaintext highlighter-rouge">~/.ipe/ipelets</code> so I created that folder and copied the extensions:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cp *.so ~/.ipe/ipelets/
$ cp lua/*.lua ~/.ipe/ipelets/
</code></pre></div></div>
<p>Voilà, if you start Ipe again, the Ipelets should appear in the ‘Ipelets’ menu.</p>
<p><img src="/hledoux/img/ipe2.png" alt="" />
<img src="/hledoux/img/ipe3.png" alt="" /></p>
Fiddling with biblatex
2015-04-07T00:00:00+02:00
https://3d.bk.tudelft.nl/hledoux/blog/fiddling-biblatex
<p><a href="https://www.ctan.org/pkg/biblatex?lang=en">Biblatex</a>, used with <a href="https://www.ctan.org/pkg/biber">Biber</a> as the backend, is in theory a major improvement over bibtex.
One can for instance:</p>
<ul>
<li>easily have different reference sections in one document, and have different styles and sorting options for each section;</li>
<li>easily decide if fields such as DOI, URL should be in the references (without having to create a new style);</li>
<li>control how many authors are listed in the citation and the reference.</li>
<li>have references with UTF-8 characters</li>
</ul>
<p>I used it recently for the first time for a grant proposal where 3 different reference sections were asked:</p>
<ol>
<li>main text with numerical style, sorted by authors;</li>
<li>my own publications in author-year, sorted by descending years;</li>
<li>my top 5 publications, sorted descending by year.</li>
</ol>
<p>Doing this with bibtex would be a nightmare I thought, so I gave biblatex a try.
The results? In theory biblatex is great, but in practice it’s not there yet, at least in my experience.
There are <em>several</em> bugs and things that annoyed me, and I spent way too much time trying to fix these.</p>
<p>Here’s a summary of things I learned.</p>
<h2 id="the-biber-cache-often-gets-corrupted">The biber cache often gets corrupted</h2>
<p>If you run biber and get a weird error pointing to a temporary folder, this usually solves the problem:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ rm -rf `biber --cache`
</code></pre></div></div>
<h2 id="citations-with-square-brackets-are-not-easy">Citations with square brackets are not easy</h2>
<p>I prefer to have a citation such as Smith [2001], instead of Smith (2001).
With natbib, it’s simple:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>\usepackage[square]{natbib}
</code></pre></div></div>
<p>With biblatex, you have to put this in your preambule:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>\makeatletter
\newrobustcmd*{\parentexttrack}[1]{
\begingroup
\blx@blxinit%
\blx@setsfcodes%
\blx@bibopenparen#1\blx@bibcloseparen%
\endgroup}
\AtEveryCite{
\let\parentext=\parentexttrack%
\let\bibopenparen=\bibopenbracket%
\let\bibcloseparen=\bibclosebracket}
\makeatother
</code></pre></div></div>
<h2 id="the-formatting-of-the-references-is-dreadful">The formatting of the references is dreadful</h2>
<p>I’m used to natbib’s styles such as <em>plainnat</em> and <em>abbrvnat</em>, with these you get for example:</p>
<blockquote>
<p>B. N. Delaunay. Sur la sphère vide. <em>Izvestia Akademia Nauk SSSR, Otdelenie Matematicheskii i Estestvennyka Nauk</em>, 7:793–800, 1934.</p>
</blockquote>
<blockquote>
<p>D. H. Douglas and T. K. Peucker. Algorithms for the reduction of the number of points re- quired to represent a digitized line or its caricature. <em>The Canadian Cartographer</em>, 10(2):112– 123, 1973.</p>
</blockquote>
<p>If biblatex is used “out-of-the-box”, with the style <em>authoryear-icomp</em>, this is what is obtained:</p>
<blockquote>
<p>Delaunay, Boris N. (1934). “Sur la sphère vide”. In: <em>Izvestia Akademia Nauk SSSR, Otdelenie Matem- aticheskii i Estestvennyka Nauk</em> 7, pp. 793–800.</p>
</blockquote>
<blockquote>
<p>Douglas, D. H. and T. K. Peucker (1973). “Algorithms for the reduction of the number of points required to represent a digitized line or its caricature”. In: <em>The Canadian Cartographer</em> 10.2, pp. 112–123.</p>
</blockquote>
<p>Several things are annoying and these can be fixed as follows:</p>
<h3 id="the-in-for-the-journal-title">the ‘In:’ for the journal title</h3>
<div class="language-tex highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">\renewbibmacro</span><span class="p">{</span>in:<span class="p">}{}</span>
</code></pre></div></div>
<h3 id="the-quotes-around-the-title-of-the-paper">the quotes around the title of the paper</h3>
<div class="language-tex highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
<span class="k">\DeclareFieldFormat</span><span class="na">[article, inbook, incollection, inproceedings, misc, thesis, unpublished]</span><span class="p">{</span>title<span class="p">}{</span>#1<span class="p">}</span>
</code></pre></div></div>
<h3 id="the-volume-and-the-issue-are-separated-by-a-dot">the volume and the issue are separated by a dot</h3>
<p>To obtain what natbib <em>plainnat</em> has (ie volume(issue):pp–pp) and to shorten ‘pages’ to ‘p.’:</p>
<div class="language-tex highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">%-- no punctuation after volume</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article]</span>
<span class="p">{</span>volume<span class="p">}{</span> <span class="p">{</span>#1<span class="p">}</span> <span class="p">}</span>
<span class="c">%-- puts number/issue between brackets</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article, inbook, incollection, inproceedings, misc, thesis, unpublished]</span>
<span class="p">{</span>number<span class="p">}{</span><span class="k">\mkbibparens</span><span class="p">{</span>#1<span class="p">}}</span>
<span class="c">%-- and then for articles directly the pages w/o any "pages" or "pp." </span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article]</span>
<span class="p">{</span>pages<span class="p">}{</span>#1<span class="p">}</span>
<span class="c">%-- for some types replace "pages" by "p."</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[inproceedings, incollection, inbook]</span>
<span class="p">{</span>pages<span class="p">}{</span>p. #1<span class="p">}</span>
<span class="c">%-- format 16(4):224--225 for articles</span>
<span class="k">\renewbibmacro*</span><span class="p">{</span>volume+number+eid<span class="p">}{</span>
<span class="k">\printfield</span><span class="p">{</span>volume<span class="p">}</span>
<span class="k">\printfield</span><span class="p">{</span>number<span class="p">}</span>
<span class="k">\printunit</span><span class="p">{</span><span class="k">\addcolon</span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>
<h2 id="the-full-preambule-is-thus-as-follows">The full preambule is thus as follows</h2>
<div class="language-tex highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">%-- biblatex</span>
<span class="k">\usepackage</span>[backend=biber,
natbib=true,
dashed=false,
maxcitenames=3,
maxbibnames=10,
firstinits=true,
isbn=false,
doi=false,
url=false,
defernumbers=true,
abbreviate=false,
style=authoryear-icomp]<span class="p">{</span>biblatex<span class="p">}</span>
<span class="c">%-- formatting hell for biblatex</span>
<span class="c">%-- remove "In:"</span>
<span class="k">\renewbibmacro</span><span class="p">{</span>in:<span class="p">}{}</span>
<span class="c">%-- no "quotes" around titles of chapters/article titles</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article, inbook, incollection, inproceedings, misc, thesis, unpublished]</span>
<span class="p">{</span>title<span class="p">}{</span>#1<span class="p">}</span>
<span class="c">%-- no punctuation after volume</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article]</span>
<span class="p">{</span>volume<span class="p">}{</span> <span class="p">{</span>#1<span class="p">}</span> <span class="p">}</span>
<span class="c">%-- puts number/issue between brackets</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article, inbook, incollection, inproceedings, misc, thesis, unpublished]</span>
<span class="p">{</span>number<span class="p">}{</span><span class="k">\mkbibparens</span><span class="p">{</span>#1<span class="p">}}</span>
<span class="c">%-- and then for articles directly the pages w/o any "pages" or "pp." </span>
<span class="k">\DeclareFieldFormat</span><span class="na">[article]</span>
<span class="p">{</span>pages<span class="p">}{</span>#1<span class="p">}</span>
<span class="c">%-- for some types replace "pages" by "p."</span>
<span class="k">\DeclareFieldFormat</span><span class="na">[inproceedings, incollection, inbook]</span>
<span class="p">{</span>pages<span class="p">}{</span>p. #1<span class="p">}</span>
<span class="c">%-- format 16(4):224--225 for articles</span>
<span class="k">\renewbibmacro*</span><span class="p">{</span>volume+number+eid<span class="p">}{</span>
<span class="k">\printfield</span><span class="p">{</span>volume<span class="p">}</span>
<span class="k">\printfield</span><span class="p">{</span>number<span class="p">}</span>
<span class="k">\printunit</span><span class="p">{</span><span class="k">\addcolon</span><span class="p">}</span>
<span class="p">}</span>
<span class="c">%-- citations with square brackets (== \usepackage[square]{natbib})</span>
<span class="k">\makeatletter</span>
<span class="k">\newrobustcmd*</span><span class="p">{</span><span class="k">\parentexttrack</span><span class="p">}</span>[1]<span class="p">{</span>
<span class="k">\begingroup</span>
<span class="k">\blx</span>@blxinit<span class="c">%</span>
<span class="k">\blx</span>@setsfcodes<span class="c">%</span>
<span class="k">\blx</span>@bibopenparen#1<span class="k">\blx</span>@bibcloseparen<span class="c">%</span>
<span class="k">\endgroup</span><span class="p">}</span>
<span class="k">\AtEveryCite</span><span class="p">{</span>
<span class="k">\let\parentext</span>=<span class="k">\parentexttrack</span><span class="c">%</span>
<span class="k">\let\bibopenparen</span>=<span class="k">\bibopenbracket</span><span class="c">%</span>
<span class="k">\let\bibcloseparen</span>=<span class="k">\bibclosebracket</span><span class="p">}</span>
<span class="k">\makeatother</span>
<span class="k">\addbibresource</span><span class="p">{</span>myreferences.bib<span class="p">}</span>
</code></pre></div></div>
<p>which gives:</p>
<blockquote>
<p>Delaunay, B. N. (1934). Sur la sphère vide. <em>Izvestia Akademia Nauk SSSR, Otdelenie Matematicheskii i Estestvennyka Nauk</em> 7:793–800.</p>
</blockquote>
<blockquote>
<p>Douglas, D. H. and T. K. Peucker (1973). Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. <em>The Canadian Cartographer</em> 10 (2):112– 123.</p>
</blockquote>
<p>My advice? Stick to bibtex for the time being, unless you <em>really</em> need the benefits of biblatex.</p>
Tinkering with the first test area of 3DTOP10NL
2015-03-05T00:00:00+01:00
https://3d.bk.tudelft.nl/hledoux/blog/tinkering-3dtop10nl
<p>The Netherlands has recently launched a <a href="http://www.kadaster.nl/web/Nieuws/Nieuwsberichten/Bericht/Ontwikkeling-3Dkaart-van-Nederland-in-volle-gang.htm">“3D map”</a> covering the whole country in which all buildings, roads, trees, canals are 3D geometries.
It was constructed by adding the third dimension, obtained from airborne laser-scanners (<a href="http://www.ahn.nl">AHN</a> was used), to the objects in the 1:10k topographic map (some details <a href="http://3dgeoinfo.bk.tudelft.nl/hledoux/pdfs/13_pers.pdf">here</a>).
This leads to a massive amount of information: 15M+ objects, billions of elevation points, and billions of triangles.</p>
<p>At this moment, the full dataset can be requested but only the test area is <a href="https://www.pdok.nl/nl/producten/pdok-downloads/basis-registratie-topografie/top10nl-3d">directly downloadable</a>.
The test area is Valkenburg (in the South of the country), so yes the hills you see are real, and they are the only ones in the country (we cherish them).</p>
<iframe src="https://player.vimeo.com/video/118325504" width="500" height="408" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
<p><a href="https://vimeo.com/118325504">3D TOP10NL -- Valkenburg</a> from <a href="https://vimeo.com/user24693433">hgldx</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
<p>While the dataset is publicly available and open (under this <a href="http://creativecommons.org/licenses/by/3.0/nl/">creative commons licence</a>), the format currently offered is only <a href="http://www.esri.com/news/arcnews/winter0809articles/the-geodatabase.html">ESRI geodatabases (GDB)</a>.
Rather ironic, but I was promised that other formats would soon be available.
CityGML would in theory be a good candidate, but storing all these triangles in GML would create <em>gigantic</em> files, so other formats are currently being investigated.</p>
<p>If, like me, you don’t have ArcGIS, do not despair.
It’s possible to read the GDB file (or should I say folder?): GDAL/OGR has an implementation of the <a href="http://www.gdal.org/drv_openfilegdb.html">OpenFileGDB driver</a>.
And it works with 3D objects out-of-the-box, eg to know which layers are in the GDB:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ogrinfo Valkenburg.gdb/
Had to open data source read-only.
INFO: Open of `Valkenburg.gdb/'
using driver `OpenFileGDB' successful.
1: terreinVlak (Multi Polygon)
2: waterdeelVlak (Multi Polygon)
3: wegdeelVlak (Multi Polygon)
4: gebouwVlak (Multi Polygon)
5: gebouwVlak_stat (Multi Polygon)
6: terreinpunten (3D Point)
7: wegdeelVlak_3D_LOD0 (3D Multi Polygon)
8: terreinVlak_3D_LOD0 (3D Multi Polygon)
9: gebouw_3D_LOD0 (3D Multi Polygon)
10: waterdeelVlak_3D_LOD0 (3D Multi Polygon)
11: gebouw_3D_LOD1 (3D Multi Polygon)
12: brugWater (3D Multi Polygon)
13: brugWeg (3D Multi Polygon)
14: TerreinOnder (3D Multi Polygon)
</code></pre></div></div>
<p>To convert the buildings (layer <code class="language-plaintext highlighter-rouge">gebouw_3D_LOD1</code>) to a shapefile with 3D MultiPatches (to a folder <code class="language-plaintext highlighter-rouge">out</code>), simply do this:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ogr2ogr out Valkenburg.gdb/ gebouw_3D_LOD1
</code></pre></div></div>
<p>and if you do this for the terrain (<code class="language-plaintext highlighter-rouge">terreinVlak_3D_LOD0</code>) and the roads (<code class="language-plaintext highlighter-rouge">wegdeelVlak_3D_LOD0</code>), you get this:</p>
<p><img src="/hledoux/img/valkenburg3d.png" alt="" /></p>
<p>Voilà.</p>
<hr />
<p>A word of caution though.
I have noticed that the conversion done with the OpenFileGDB has errors: several triangles are corrupted!
Triangles that have—as they should—3 vertices in the GDB file (I checked with ArcGIS) are after conversion to the shapefile having 4+ vertices and inner rings (triangles are simply polygons, thus it’s possible and “correct”).
An example is this one (the red geometries are 1 geometry that is corrupted, and it is not a triangle):</p>
<p><img src="/hledoux/img/openfilegdbproblems.png" alt="" /></p>
<p><del>Why does this happen? I have no idea.
It happens for me with GDAL v1.11.0, under Mac OS X (Yosemite).
</del></p>
<p><em>UPDATE: The reason why this happened is explained <a href="http://trac.osgeo.org/gdal/ticket/5888">here</a> (cheers to <a href="https://twitter.com/evenrouault">Even Rouault</a>).
Basically, if you convert to GML or Spatialite instead of Shapefile then the problem is avoided (<code class="language-plaintext highlighter-rouge">ogr2ogr -f GML out.gml Valkenburg.gdb/ terreinVlak_3D_LOD0</code>). The GDB file contains vertical triangles (the terrain of 3DTOP10NL is not a 2.5D terrain) and the Shapefile driver tries to construct polygons (triangles) that are 2.5D by assigning a Z value to the points (which doesn’t work).
</em></p>
<p>Since it was driving mad, I wrote a small script to know if the triangles in a shapefile are valid: <a href="https://gist.github.com/hugoledoux/0798ee79fe76a1b0ed8f">aretrianglesvalid.py</a>.</p>
<p><del>If you solve this problem, please let me know.</del></p>
The Rules for happily collaborating on a LaTeX document
2015-01-05T00:00:00+01:00
https://3d.bk.tudelft.nl/hledoux/blog/rules-happy-latex
<p>When it comes to writing my <a href="/hledoux/pubs/">papers</a>, I must admit that I prefer <a href="http://latex-project.org/intro.html">LaTeX</a> over <a href="http://www.wordperfect.com/rw/">that-other-ubiquitous-software-that-I’d-rather-not-mention</a>.
<em>Prefer</em> is an understatement here: I would probably do <em>anything</em> to avoid writing a paper with the other software, eg spending hours harrasing the editor of the journal/conference so that she accepts LaTeX, spending one full day fighting with one of the many <a href="http://peterwittek.com/2013/11/comparing-latex-conversion-tools/">converters</a> even if I know they don’t really work<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>, or asking one of my <a href="/hledoux/proteges/">students</a> to do it for me.</p>
<p>So when I can choose, I always impose LaTeX on my co-authors.
Since some of them are users of the other software, that often creates friction and someone ends up fixing manually all the “mistakes” and inconsistencies in the file.</p>
<p>So I propose here <em>The Rules for happily collaborating on a LaTeX document</em>©, a set of 10 rules that: (1) novices can easily apply; (2) will make your co-authors happy.</p>
<p>Please add new Rules in the comments below.</p>
<h3 id="1-you-shall-use-only-one-sentence-per-line">1. You shall use only one sentence per line</h3>
<p>And use one empty line to start a new paragraph.
It’ll then be easier to track changes in a versioning system such as SVN or Git since these are line-based.</p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex">I like to create buffers in ArcGIS.
But it is not always possible as it often crashes.
Also, ...</code></pre></figure>
<h3 id="2-you-shall-use-natbib-for-citations">2. You shall use natbib for citations</h3>
<p>and the commands <code class="language-plaintext highlighter-rouge">\citet{}</code> (cite in the text as a noun) <code class="language-plaintext highlighter-rouge">\citep{}</code> (cite between parentheses).</p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex"><span class="k">\usepackage</span><span class="na">[round]</span><span class="p">{</span>natbib<span class="p">}</span>
...
<span class="k">\citet</span><span class="p">{</span>Smith00<span class="p">}</span> succeeded in creating a buffer.
However, it has been shown that it is not an easy task~<span class="k">\citep</span><span class="p">{</span>Brown90<span class="p">}</span>.</code></pre></figure>
<h3 id="3-you-shall-prevent-breaking-lines-with--when-referencing-and-citing">3. You shall prevent breaking lines with “~” when referencing and citing</h3>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex">In Section~<span class="k">\ref</span><span class="p">{</span>sec:intro<span class="p">}</span>, we can observe that the buffer was a success~<span class="k">\citep</span><span class="p">{</span>Smith99<span class="p">}</span>.</code></pre></figure>
<h3 id="4-you-shall-use-one---for-an-hyphen-two----for-a-range-between-numbers-and-three-----for-a-punctuation-in-a-sentence">4. You shall use one <code class="language-plaintext highlighter-rouge">-</code> for an hyphen, two <code class="language-plaintext highlighter-rouge">--</code> for a range between numbers, and three <code class="language-plaintext highlighter-rouge">---</code> for a punctuation in a sentence</h3>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex">I like---unlike my father---to build multi-dimensional models,
especially those made in 1990--1995.</code></pre></figure>
<h3 id="5-you-shall-give-meaningful-labels">5. You shall give meaningful labels</h3>
<p>A figure’s label should start with <code class="language-plaintext highlighter-rouge">fig:</code> and a section’s label with <code class="language-plaintext highlighter-rouge">sec:</code></p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex"><span class="k">\section</span><span class="p">{</span>Introduction<span class="p">}</span>
<span class="k">\label</span><span class="p">{</span>sec:intro<span class="p">}</span>
In recent years, buffers have been rather complex to implement because ...</code></pre></figure>
<h3 id="6-you-shall-put-a-short-space-after-eg-and-ie-with-the-use-of-a-backslash">6. You shall put a short space after e.g. and i.e. with the use of a backslash</h3>
<p>The following two commands shall thus be used:</p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex"><span class="k">\newcommand</span><span class="p">{</span><span class="k">\ie</span><span class="p">}{</span>i.e.<span class="p">}</span>
<span class="k">\newcommand</span><span class="p">{</span><span class="k">\eg</span><span class="p">}{</span>e.g.<span class="p">}</span>
...
Buffers can be generated on different geometries, <span class="k">\eg\ </span>points, polylines and polygons.</code></pre></figure>
<h3 id="7-you-shall-put-all-figuresgraphs-in-a-single-subfolder-figs">7. You shall put all figures/graphs in a single subfolder (<code class="language-plaintext highlighter-rouge">figs/</code>)</h3>
<p>And you shall put the source file (eg <a href="http://ipe7.sourceforge.net">IPE</a>, OmniGraffle, Illustrator, etc.) there as well for future use.</p>
<h3 id="8-in-your-bibtex-file-you-shall-use-curly-brackets-for-wordsletters-you-want-to-have-capitalised-in-the-title">8. In your BibTeX file, you shall use curly brackets for words/letters you want to have capitalised in the title</h3>
<p>The other fields are not affected by this. LaTeX does this to uniformise the capitalisation in all citations.</p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex">@article<span class="p">{</span>Smith00,
Author = <span class="p">{</span>Smith, John<span class="p">}</span>,
Journal = <span class="p">{</span>The GIS Journal<span class="p">}</span>,
Title = <span class="p">{</span>The <span class="p">{</span>3D<span class="p">}</span> <span class="p">{</span>CityGML<span class="p">}</span> building was constructed with the <span class="p">{</span>Delaunay<span class="p">}</span> triangulation<span class="p">}</span>,
Year = <span class="p">{</span>2001<span class="p">}</span>,
...
<span class="p">}</span></code></pre></figure>
<h3 id="9-you-shall-not-add-any-commands-to-change-the-format-until-the-the-paper-is-finished">9. You shall not add any commands to change the format until the the paper is finished</h3>
<p><code class="language-plaintext highlighter-rouge">\vspace</code> and <code class="language-plaintext highlighter-rouge">\newpage</code> are thus forbidden.</p>
<h3 id="10-you-shall-declare-all-sizes-relative-to-linewidth">10. You shall declare all sizes relative to <code class="language-plaintext highlighter-rouge">\linewidth</code>.</h3>
<p>So that the paper can be switched to a 2-column one without (too much) pain.</p>
<figure class="highlight"><pre><code class="language-tex" data-lang="tex"><span class="k">\includegraphics</span><span class="na">[width=0.95\linewidth]</span><span class="p">{</span>figs/potato.pdf<span class="p">}</span></code></pre></figure>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>in all fairness, they work great if your paper has no figures and no mathematical equations <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>
Are your polygons the same as my polygons?
2014-12-29T00:00:00+01:00
https://3d.bk.tudelft.nl/hledoux/blog/your-polygons-the-same
<p>When someone outside the field of GIS thinks of a ‘polygon’, she usually pictures something like one of these:</p>
<p><img src="/hledoux/img/simplepolygons.png" alt="" /></p>
<p>And I can’t blame her, that’s what we learned in school. Squares, triangles, pentagons, hexagons.
However, when I speak about a polygon with my <a href="http://3dgeoinfo.bk.tudelft.nl/about/">colleagues</a>, we usually think of something more complex:</p>
<p><img src="/hledoux/img/gispolygons.png" alt="" /></p>
<h2 id="simple-features-polygons">Simple Features polygons</h2>
<p>We use the definition as found in the <a href="http://www.opengeospatial.org/standards/sfa"><em>Simple Feature Access</em> document</a> of the <a href="http://www.opengeospatial.org">OGC</a>:</p>
<blockquote>
<p>A Polygon is defined as a planar Surface defined by 1 exterior boundary and 0 or more interior boundaries. Each interior boundary defines a hole in the Polygon.</p>
</blockquote>
<p>There are different rules for the interactions between the different rings (boundaries) of a polygon, and it is easy to imagine that things can quickly get complex and messy.
The following figure shows 12 examples of rather simple polygons that are invalid, and these highlight the most important validity rules.</p>
<p><img src="/hledoux/img/unitpolygons.png" alt="" /></p>
<ul>
<li>each ring defining the exterior and interior boundaries should be <em>simple</em>, ie non-self-intersecting (<em>p</em><sub>1</sub> and <em>p</em><sub>10</sub>). Notice that this prevents the existence of rings with zero-area (<em>p</em><sub>6</sub>), and of rings having two consecutive points at the same location. It should be observed that the polygon <em>p</em><sub>1</sub> is not allowed either (in a valid representation of the polygon, the triangle should be represented as an interior boundary touching the exterior boundary), but some implementations do allow it (eg ESRI’s Shapefile).</li>
<li>each ring should be closed (<em>p</em><sub>11</sub>): its first and its last points should be the same.</li>
<li>the rings of a polygon should not cross (<em>p</em><sub>3</sub>, <em>p</em><sub>7</sub>, <em>p</em><sub>8</sub> and <em>p</em><sub>12</sub>) but may intersect at one tangent point (the interior ring of <em>p</em><sub>2</sub> is a valid case, although <em>p</em><sub>2</sub> as a whole is not since the other interior ring is located <em>outside</em> the interior one).</li>
<li>a polygon may not have cut lines, spikes or punctures (<em>p</em><sub>5</sub> or <em>p</em><sub>6</sub>); removing these is known as the <em>regularisation</em> of a polygon (a standard point-set topology operation).</li>
<li>the interior of every polygon is a connected point set, ie one can ‘walk’ everywhere within its interior without having to go outside (<em>p</em><sub>4</sub>).</li>
<li>each interior ring creates a new area that is disconnected from the exterior. Thus, an interior ring cannot be located outside the exterior ring (<em>p</em><sub>2</sub>) or inside other interior rings (<em>p</em><sub>9</sub>).</li>
</ul>
<h2 id="big-polygons">BIG polygons</h2>
<p>Many real-world polygons are very large, both in terms of number of vertices and of rings.
An example is this polygon, taken from the <a href="http://www.geobase.ca/geobase/en/data/landcover/index.html">Canada Land Cover</a>.
It has 148,612 vertices in total, and 5,132 interior rings.
“How was such a large polygon created in the first place?” I hear you ask.
Automatically from reclassified raster imagery.
It is—like several polygons that are that big—invalid since it contains self-intersections.</p>
<script src="https://gist.github.com/hugoledoux/ee23076b6b35cdcc4ac1.js"></script>
<h2 id="my-all-time-favourite-polygons">My all-time favourite polygons</h2>
<p>Of all the polygons I’ve seen in my life, these 2 are my favourite.</p>
<h3 id="1-the-swedish-polygon">1. the Swedish polygon</h3>
<p><a href="https://github.com/hugoledoux/BIGpolygons/blob/master/EU-199948.geojson"><img src="/hledoux/img/bigpolygon_sweden.png" /></a></p>
<p>The polygon with ID ‘EU-199948’ in the <a href="http://www.eea.europa.eu/data-and-maps/data/clc-2006-vector-data-version-3">Corine land cover dataset</a> has 1,189,903 vertices, and 7,672 inner rings.
You can get it and zoomin on it <a href="https://github.com/hugoledoux/BIGpolygons/blob/master/EU-199948.geojson">there</a>.</p>
<h3 id="2-the-cleveland-polygon">2. the Cleveland polygon</h3>
<p><a href="https://github.com/hugoledoux/BIGpolygons/blob/master/cleveland.geojson"><img src="/hledoux/img/bigpolygon_cleveland.png" /></a></p>
<p>I obtained it from someone working at the <a href="http://clevelandmetroparks.com">Cleveland Metroparks</a>, and you can get it <a href="https://github.com/hugoledoux/BIGpolygons/blob/master/cleveland.geojson">there</a>.
Although it covers a much smaller area than the Swedish one, it is <strong>monstrous</strong>: 1,689,703 vertices, 66,908 inner rings, and its biggest ring has 500,373 vertices. Wow.</p>
<p>I can’t decide which one I like most, perhaps because the Swedish polygon should probably be bigger than the Cleveland one: observe that it was truncated at the bottom and on the left, probably because of a different <a href="https://en.wikipedia.org/wiki/Spatial_reference_system">CRS zone</a>, or perhaps because the GIS couldn’t handle the full one?</p>
<h2 id="a-repository-of-big-polygons">A repository of BIG polygons</h2>
<p>I’ve setup a repository in which I keep these big polygons and other interesting ones:</p>
<p><a href="https://github.com/hugoledoux/BIGpolygons"><i class="fa fa-github fa-lg"></i> github.com/hugoledoux/BIGpolygons</a></p>
<p>I usually use them to test the capabilities of code I write to process GIS datasets, eg <a href="https://github.com/tudelft3d/prepair">prepair</a>.</p>
<p>I’d be grateful if you submitted other interesting ones and/or your favourite ones.</p>
Hello world
2014-12-21T00:00:00+01:00
https://3d.bk.tudelft.nl/hledoux/blog/hello-world
<p>I read blogs every day.
About everything and nothing (eg <a href="http://www.kottke.org">Kottke</a>), about technology (<a href="http://daringfireball.net">Daring Fireball</a>, <a href="http://www.theguardian.com/technology/blog">Guardian tech</a>), about GIS (<a href="https://www.mapbox.com/blog/">Mapbox</a>, <a href="http://sgillies.net/blog/">Sean Gillies</a>, <a href="http://lin-ear-th-inking.blogspot.nl">Lin.ear th.inking</a>, <a href="http://justobjects.nl/writings/blog/">Just Objects</a>), about the wonderful world that is academia (<a href="http://www.theguardian.com/higher-education-network/series/academics-anonymous">Guardian’s Academics Anonymous</a>).</p>
<p>Blogs are one of my main sources of information, and I’ve learned a lot of interesting things over the years.
Also, when I search for the solution to a particular technical problem, I often find the solution in a blog.
Someone somewhere had the same problem and wrote her solution.
Which solves <em>my</em> problem. Great.</p>
<p>So today I’m starting mine.
I plan to write about and reflect on different sides of my job.
I’ll write about the tools I use daily (PostGIS, Python, QGIS, LaTeX, etc.), about being an academic, about how I used/crunched/analysed a particular datasets, about getting published, etc.
Oh, and I also plan to use this tribune to explain to everyone what is so wrong with CityGML<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>.</p>
<p>Welcome to my blog, hope you’ll enjoy it.</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:1" role="doc-endnote">
<p>just joking, CityGML is great! <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
</li>
</ol>
</div>