tag:blogger.com,1999:blog-51258527248241459952023-12-27T11:15:48.925-08:00GeogeekGeography, Development, and DevelopmentGeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-5125852724824145995.post-43432074045920486402013-01-15T14:39:00.000-08:002013-01-15T14:39:39.945-08:00My comments on the OGC Geopackage Spec<br />
<div>
<span class="Apple-style-span" style="font-family: inherit;">PART A</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">1. Evaluator:</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"> Darrell Fuhriman</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2. Submission: </span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"> OGC 12-128r1</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"> OpenGIS® GeoPackage Implementation Specification</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">PART B</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">1. Requirement: Core, #13</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2. Implementation Specification Section number: 8.2</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">3. Criticality: Minor</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">4. Comments/justifications for changes:</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">The geopackage_contents table includes four columns used for the bounding box,</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">but does not specify the units to be used, only the defaults. The spec should</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">be updated to specifically list the units.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">Points for clarification:</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">1) are the values to always be in lat/long?</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"> 1a) If so, what datum? (Yes, I realized these values are not meant to be</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"> exact, but it doesn't hurt be clear)</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2) are the values to be in the SRID specified in the same row?</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">If the values are to be specified always in lat/long, then recommend renaming</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">columns to reflect this:</span></div>
<div style="font-family: Helvetica;">
<span class="Apple-style-span" style="font-family: Courier;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">min_x -> min_long</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">max_x -> max_long</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">min_y -> min_lat</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">max_y -> max_lat</span></div>
<div style="font-family: Helvetica;">
<span class="Apple-style-span" style="font-family: Courier;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">=======================================================================</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">1. Requirement: N/A</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2. Implementation Specification Section number: N/A</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">3. Criticality: Major</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">4. Comments/justifications for changes:</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">I believe there should be an optional extension that allows for the inclusion</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">of user-defined styling information.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">While, I do not believe that the Geopackage format should mandate a specific</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">styling language, such as SLD or CartoCSS, I do think there should be a standard</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">location where an application can look for such data. </span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">The implementation should be highly generic, the intention is to allow</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">standards to evolve and gain experience before codifying anything, but still</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">having a single "go to table" for finding styling suggestions.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">As an intro suggestion, I imagine there being a table, say "geopackage_styles"</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">consisting of four columns:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">table_name text NOT NULL</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">style_name text NOT NULL</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">style_version text</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">style_data text NOT NULL</span></div>
<div style="font-family: Helvetica;">
<span class="Apple-style-span" style="font-family: Courier;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">The primary key would be a composite key consisting of "table_name,</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">style_name", thus allowing for one table to have multiple styles associated</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">with in different styling languages.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">For example, a table might contain:</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">| my_table | cartoCSS | NULL | "some carto css" |</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">| my_table | SLD | 1.1.0 | "<BIG string of XML/>"|</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">Any styling information included must apply to the named table/view, and only</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">that table/view. Including styling suggestions for a table/view is purely</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">optional, and the "geopackage_styles" table need not exist at all.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">=======================================================================</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">1. Requirement: N/A</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2. Implementation Specification Section number:9.6</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">3. Criticality: Major</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">4. Comments/justifications for changes:</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">I am concerned that the reference implementation SpatialLite, essentially</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">mandates the inclusion of the GEOS library. While I have nothing against the</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">GEOS library, quite the opposite, this presents real problems for people who </span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">must statically link the libraries, something that is expressly forbidden by</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">the GEOS Library License (LGPL).</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">For reference, see: http://blog.burhum.com/post/38236943467/your-lgpl-license-is-completely-destroying-ios-adoption</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">I strongly encourage the OGC to create a minimal reference implementation,</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">contains *only* the core requirements, and makes use only of libraries which</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">can be statically linked.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Courier;"><br /></span></div>
GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-76277109754251294792012-11-13T09:19:00.002-08:002012-11-13T09:19:46.607-08:00A few things I've been working on<br />
As an update, because you need one once in a while, here are few things I've been up to and/or working on. These are all available on <a href="http://github.com/darrell">github</a>.<br />
<br />
<br />
<ol>
<li><a href="https://github.com/darrell/postgistable">Two</a> <a href="https://github.com/darrell/sequel-postgis">gems</a> that work together to add support for PostgreSQL/PostGIS tables as task targets. I also spoke about them at the <a href="http://stateofthemap.us/">State of the Map US</a>. There is supposedly video of said presentation online, but I'll be damned if I can find it.</li>
<li>A <a href="https://github.com/darrell/census_data_importer">quick-and-dirty importer script</a> for Census ACS data. </li>
<li>A <a href="https://github.com/darrell/portland_vector_bridges">series of vector renderings</a> of the bridges of Portland, OR. </li>
</ol>
<div>
Let me know if you find any of these useful.</div>
<div>
<br /></div>
GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-77739015469580338872012-04-09T16:59:00.002-07:002013-07-22T10:59:57.226-07:00Faster Voronoi Diagrams in PostGIS<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
A couple years back, <a href="http://geogeek.garnix.org/2010/09/voronoi-diagrams-in-postgis.html">I posted a quick and dirty function</a> for generating voronoi diagrams in PostGIS. As one of the commenters pointed out, this is not the world's most efficient algorithm. So I started looking into implementing a <a href="http://en.wikipedia.org/wiki/Fortune%27s_algorithm">better one</a> myself, but once again, being a <a href="http://en.wikipedia.org/wiki/Larry_Wall#Virtues_of_a_programmer">virtuous programmer</a>, I borrowed <a href="https://svn.osgeo.org/qgis/trunk/qgis/python/plugins/fTools/tools/voronoi.py">someone else's code</a>, and modified it to work with PostGIS.</div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
This one's in Python, not PL/pgSQL, so plan appropriately. It is called similarly to my previous version:</div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select * from voronoi('table_name', 'geom_column') as (id integer, the_geom geometry);</span></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
You no longer need to specify an id column, but the downside is that there's no longer a relationship between the id of the input point, and the id of the output polygon. On the other hand, it's much, much, much more efficient. At least a couple orders of magnitude. In testing, my 40,000 points of input only took 20 seconds to calculate, whereas previously it took... well, I don't know, because I didn't want to wait that long.</div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Code is here: <a href="http://db.tt/xen7XHwC">http://db.tt/xen7XHwC</a> No guarantees it actually does anything correctly, but my limited testing seems to work. Enjoy.<br />
<br />
<b>UPDATE:</b> the code linked above only works with Python 2.x. If you look through the comments, you'll see there's a link to a version of my code for 3.x, but it still has a couple of bugs which I have not had time to investigate.<br />
<br />
<b>UPDATE 2:</b> See the comments below about the QGIS code also producing incorrect output with this function. I'll try to investigate in my copious free time.<br />
<br />
<b>UPDATE 3: </b>Matthias has published a version that corrects the problems in my initial code. His dropbox link is here: http://db.tt/gwEGpu0Y. I've also published it as GIST, here: https://gist.github.com/darrell/6056046<br />
<br />
<br /></div>
</div>
GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com44tag:blogger.com,1999:blog-5125852724824145995.post-87486368174683954862011-08-16T08:07:00.000-07:002011-08-16T08:07:21.633-07:00This is such great news, it deserves a post of its own. The<a href="http://sextantegis.blogspot.com/"> Sextante Blog </a>has<a href="http://sextantegis.blogspot.com/2011/08/first-video-of-sextante-for-arcgis.html"> released a video</a> showing Sextante integration with ArcGIS. While I haven't seen the full list of tools, I've every reason to think it will include all the Sextante tools, which would for many people obviate the need for an <strike>ArcInfo</strike> ArcGIS for Desktop Advanced license, as well as Spatial Analyst, Geostatistical Analyst, and maybe others...<br />
<br />
Tremendous news, indeed.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-89769036243027737472011-07-14T08:45:00.000-07:002011-07-14T08:38:05.800-07:00Ten years is both a long time, and a short time...My friend Brandon, the <a href="http://mercatorial.blogspot.com/">Mercatorial Librarian</a>[1] has <a href="http://mercatorial.blogspot.com/2011/07/time-passes.html">a post</a> up reminding me that it's been ten years since we went to Nigeria to install computer labs and do training for professors in the Library Science department at <a href="http://en.wikipedia.org/wiki/Bayero_University_Kano">Bayero University Kano</a> in Kano, Nigeria.<br />
<br />
It was that event which led me to <a href="http://www.child-aid.org/">Child Aid</a> and doing similar work at <a href="http://www.probigua.org/">Probigua</a> in Antigua, Guatemala in 2005. All of which ultimately led to <a href="http://etda.libraries.psu.edu/theses/approved/WorldWideIndex/ETD-2662/index.html">my Master's Thesis</a> research on the political ecology of donated computers and e-waste in Accra, Ghana[2]. One of these days I'll really get that research published (I keep telling myself).<br />
<br />
Anyway, it just reminds me that when I'm geeking out on this blog, or teaching about spatial databases (this fall at Portland State, GEOG 4/575, come on over), where my true passion lies.<br />
<br />
<br />
[1] I assume this is a reference to Mercator, so how can I not like it?<br />
[2] How many Geographers actually <a href="http://ngm.nationalgeographic.com/2008/01/high-tech-trash/carroll-text">get scooped</a> by National Geographic? Well, this one does. Turns out I was there at the same time as the NG guys, though they published first, obviously.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com1tag:blogger.com,1999:blog-5125852724824145995.post-6151875914012407902011-04-19T13:24:00.000-07:002011-04-19T13:24:03.183-07:00Geekery on displayThe <a href="http://opensourcebridge.org/proposals/640">proposal</a> that Sarah Beecroft and I wrote for the <a href="http://opensourcebridge.org/">Open Source Bridge 2011</a> conference was accepted, as was our proposal for the <a href="http://opensourcebridge.org/proposals/665">Open Source GIS Desktop Smackdown</a>, which we gave at GIS in Action (see previous post). I guess I have to post one of these badges now:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://opensourcebridge.org/?ref=2011speak125"><img border="0" src="http://opensourcebridge.org/badges/2011/speak125.png" /></a></div>GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com1tag:blogger.com,1999:blog-5125852724824145995.post-46001039476768886852011-03-30T09:04:00.000-07:002011-03-30T09:04:43.794-07:00Recent goings onBeen a bit infrequent on updates, but I'm going to work on that.<br />
<br />
Yesterday I presented at the "Open Source GIS Desktop Smackdown" as part of the <a href="http://www.orurisa.org/GIS_In_Action">GIS in Action</a> regional conference. We presented <a href="http://www.gvsig.org/">gvSIG</a>, <a href="http://openjump.org/">OpenJUMP</a>, and <a href="http://www.qgis.org/">Quantum GIS</a>. I presented gvSIG (using the <a href="http://oadigital.net/software/gvsigoade/gvsigdownload">OA edition</a>), and handily trounced the competition, largely, I think based on the modeler, and the fact that gvSIG has a number of advanced features, in particular more advanced topology tools than anything I've seen outside of Arc. Now if only the Mac interface worked better.<br />
<br />
Locally, the <a href="http://wiki.osgeo.org/wiki/PDX-OSGEO">PDX OSGeo</a> group I'm part of has officially become an OSGeo chapter, which comes with, well, very little really, but I think it's important to recognize the good work that OSGeo is doing.<br />
<br />
Oh, and finally, as part of the aforementioned GIS in Action conference, we're running an unconference tomorrow (March 31st) and a hackathon on the following day (April 1). It's not too late to sign up and attend - and it's free! More info and registration here: <a href="http://calagator.org/events/1250459876">http://calagator.org/events/1250459876</a>.<br />
<br />
Hopefully future posts will have more technical content, but for now, that is all.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-66722993232742024822010-09-20T12:00:00.000-07:002012-04-10T08:38:31.962-07:00Voronoi Diagrams in PostGIS(Update: A faster version of this code is here: <a href="http://geogeek.garnix.org/2012/04/faster-voronoi-diagrams-in-postgis.html">Faster Voronoi Diagrams in PostGIS</a>)<br />
<br />
I found myself in a situation where I needed to create a Voronoi diagram from a set of points using PostGIS. This isn't built in, but a little googling turned up <a href="http://postgis.refractions.net/pipermail/postgis-users/2006-April/011722.html">a function</a> written by Mike Leahy. I adapted it and made it a bit more generic, so it shouldn't require any editing to make it work for many (most?) cases.<br />
<br />
Call it as: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select * from voronoi(table_name text,table_primary_key text,geom_col text) as (id id_type, the_geom geometry)</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;">For example:</span><br />
<span class="Apple-style-span" style="font-family: inherit;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;"></span><br />
<span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select * from voronoi('oregon_cities', 'id', 'the_geom_centroids') as (id integer, the_geom geometry);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;">The 'as' clause is required because we don't know and don't want to assume what type your primary key might be. But, because we're returning a record type, the query planner wants to know what type to expect. If you're always using the same type, say an integer for your primary key, then it would be easy to define a type thusly:</span><br />
<span class="Apple-style-span" style="font-family: inherit;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">create type my_type as (id integer, the_geom geometry);</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;">Then change the code at line 24 from '</span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">rec record;</span><span class="Apple-style-span" style="font-family: inherit;">' to '</span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">rec record%my_type;</span><span class="Apple-style-span" style="font-family: inherit;">' and you will no longer need the 'as' clause.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"><br />
</span><br />
Code at this URL: <a href="http://db.tt/aInuiJ2">http://db.tt/aInuiJ2</a>. Enjoy.<br />
<br />
<br />
<span class="Apple-style-span" style="font-family: inherit;"><br />
</span><br />
<span class="Apple-style-span" style="font-family: inherit;"><br />
</span></span>GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com8tag:blogger.com,1999:blog-5125852724824145995.post-18861209261816604192010-04-04T16:24:00.000-07:002010-09-21T19:20:02.836-07:00Pondering vector representations.So one thing I've wondered is why more GIS systems can't/don't use B-splines, opting instead for simple lines. The OGC Simple Features standard defines a Curve, which must specify its method of interpolation between points, but then only defines one method – straight linear interpolation.<br />
<br />
Obviously there are disadvantages to using b-splines, such as the assumption of accuracy which permeates so many people's interactions with GIS data. At least when you using simple linear features, as you move to a large scale map, you can see the clumsy straight lines that make up your data. But it sure would look nicer when outputting the same data to use B-splines.<br />
<br />
Not being hugely math skilled anymore (woe for math atrophy), I'm not even sure how to go about answering the question. But some of the more interesting issues that bounce around in my mind are:<br />
<br />
1) Do B-splines/bezíer curves even work in non-euclidean (in particular spherical) geometry?<br />
1a) If they do, then how would one go about projecting them into a euclidean space – if one can meaningfully do so at all?<br />
2) Assuming a "bezíer polygon" were defined as closed series of curves just like linear polygons, how would one calculate the area of said polygon?<br />
<br />
Any math über-geeks out there in my vast (hah!) readership have any insights?GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-75423460159113327432009-11-25T09:03:00.000-08:002009-11-25T09:03:47.215-08:00Too much of a good thing?Slashgeo <a href="http://technology.slashgeo.org/technology/09/11/25/140208.shtml">reports</a> yet another new Open Source GIS tool, noting "<span class="Apple-style-span" style="font-size: 16px;">Open source GIS software is crowded with options: QGIS, uDig, gvSIG, OpenJUMP, MapWindow, GRASS, OSSIM, etc."</span><br />
<br />
Yes, it is - and the question to me is: "Why so many?" - I understand the arguments for a diverse software ecosystem, and I even agree with them. But with the possible exception of GRASS, most of these packages implement the same basic functionality without implementing the advanced functionality that is necessary to seriously take on ESRI. Plus, the UIs are almost always terrible, which makes the problem even worse.<br />
<br />
So, in that spirit I'm listing a few things that I think are missing from most, if not all, OS GIS software, in no particular order:<br />
<br />
1. Topological data model (the only exception I can think of is GRASS)<br />
2. Editing, especially centralized, version controlled editing.<br />
2a. Which means you need a topology model in your database<br />
3. UIs not designed by software engineers. (Well, at least ESRI has this problem, too.)<br />
4. Quality cartographic tools.<br />
5. COGO tools<br />
6. Metadata editing tools<br />
7. Scriptability (GRASS, being command-line based is fairly scriptable, I know of no others that are.)<br />
8. Runs on my Macs.<br />
9. Comprehensive interface for building extensions<br />
<br />
Well, those are a few that come to mind right away. Make more suggestions - maybe we can turn this into a manifesto.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-38540165385013152012009-11-23T08:36:00.000-08:002009-11-23T08:36:50.986-08:00Open Publishing & Cartography 2.0The new issue of <i><a href="http://nacis.org/index.cfm?x=5">Cartographic Perspectives</a><span class="Apple-style-span" style="font-style: normal;"> is available for free as part of a test of going all digital and open-access. Three Cheers for NACIS on that one, let's hope they keep it up. The lead article is by <a href="https://www.e-education.psu.edu/about/people/dibiase">David DiBiase</a> and makes the case for more open access. David and I organized a session at the AAG Annual Meeting in 2007 on "Envisioning a post-proprietary Geography" – sadly we were somewhat poorly attended, no doubt in part because of the free wine being given away by publishers at the same time. (The more conspiratorially minded among us might think that a bit *too* coincidental...)</span></i><br />
<br />
The issue also features the introduction by some of my former classmates (go <a href="http://www.personal.psu.edu/acr181/">Anthony</a>), of the <a href="http://cartography2.org/">Cartography 2.0</a> website – an online source book for dynamic mapping.<br />
<br />
You guys are embarrassing me with all the awesomeness. Keep it up - time for me to get working, too.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-66257474510205731252009-11-04T18:58:00.000-08:002009-11-04T19:05:31.526-08:00Announcing: PDXBikemap<div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="http://pdxbikemap.org/map"><img border="0" height="42" src="http://pdxbikemap.org/images/pdxbikemap.png" width="320" /></a><br />
</div></div>I'm pleased to announce the first public release of <a href="http://pdxbikemap.org/">pdxbikemap.org </a>-- it's a street routing tool for finding optimal paths while on your bike, where optimal is defined as "balancing speed and safety."<br />
<br />
The application is still very much in beta, but please report any issues you run into, and especially send suggestions. But before you do, check out the <a href="http://pdxbikemap.org:3000/faq">FAQ</a> and the <a href="http://pdxbikemap.org:3000/issues">known issues</a>.<br />
<br />
Enjoy!GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-41117144130122751452009-10-21T11:16:00.000-07:002009-10-21T11:16:33.296-07:00Planet Money blows itThe <a href="http://www.npr.org/blogs/money/2009/10/podcast_the_paradox_of_oil.html">most recent episode</a> of Planet Money talked to an American oil worker in Angola and an Angolan about the differing ways of experiencing their country. This is a noble thing, indeed and I have no complaints about it – in theory. But I think they really dropped the ball this time.<br />
<br />
In particular, there was a discussion about the Chinese government hiring Chinese laborers to build Angolan infrastructure as part of deal to guarantee oil prices to China, but they missed the obvious question: how many Angolans does the oil company hire vs. foreigners? Who's getting the $20,000/mo rent for the American's apartment?<br />
<br />
But the thing that surprised me most was the way in which they seemed surprised at what the Chinese were doing. This sort of thing has been SOP for aid-giving countries for decades (though they don't usually send labor). I once met a woman at dinner party who worked for a company that existed only because of aid tying. (The company made very large pipes for use in water/sewer systems), a friend of grew up in Egypt because his parents sold American farm-equipment around North Africa. Obviously American farm-equipment is of high quality, but nonetheless, the people were "buying" it with American aid money and had no choice but to buy from an American manufacturer.<br />
<br />
Similarly, the oil for infrastructure deal is as old as colonialism – think of the Reuters Concession in Iran in the late 1900s, or any number of "concessions" that were forced upon the decaying Ottoman empire in the 19th century. Similar arrangements were widely made in Africa. Chances are our American oil worker is working for a company with quite similar "arrangements".<br />
<br />
In general, I think Planet Money has been fantastic at exploring economic issues (albeit with something of a tendency to gloss over or ignore serious critiques of the statements given by their various interviewees), but so far their work on the economics of development has really been lacking.<br />
<br />
Come to think of it, I think maybe their thinking is just too narrow - much like economics in general, they try to oversimplify the world to fit into economistic models rather than looking at the societies and politics that economics is operating in. Like many economists they forget that economics is not physics - it's not something that operates independently of human beings. It is a creation of human beings – something we should always be careful to remember. This, of course, was so elegantly <a href="http://books.google.com/books?id=xHy8oKa4RikC&lpg=PP1&pg=PP1#v=onepage&q=&f=false">argued by Karl Polanyi</a> decades ago, but is so easily forgotten.<br />
<br />
Here's hoping that in the future they take a bit more care in how they report and who they choose to discuss development economics. I'd love to see them get someone like <a href="http://books.google.com/books?id=X5N7JMS1wNYC&lpg=PP1&dq=kicking%20away%20the%20ladder&pg=PP1#v=onepage&q=&f=false">Ha-Joon Chang</a> – but that might be hoping for too much.<br />
<br />
Anyhow..GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-15247927070202943432009-10-05T16:40:00.000-07:002010-05-13T17:02:46.753-07:00Buffering only the upslope areas of a DEMOK, here's the solution to the problem proposed in <a href="http://geogeek.garnix.org/2009/10/interesting-challenge.html">my previous post</a>. It's not a perfect solution, as it doesn't account for all possible types of terrain (more on that below), but it's pretty close and in the data I have, works pretty well.<br />
<br />
The first thing to do is take care of the slope and the 10' elevation change in one swoop. By adjusting the size of our pixels, we can make sure that any change in the slope that meets the 40% rule also meets the elevation change. In other words, what is the minimum Δx (i.e. the resolution) that yields a change of Δy>=10' at an angle θ?<br />
<br />
<br />
<ul><li>Because: y=x·sin(θ)</li>
<li>We substitute: 10= x·sin(tan<sup>-1</sup>(.4))</li>
<li>Solving for x yields x=26.9. We round that to 27 for convenience.</li>
</ul><br />
<ul><li>Now calculate your slope raster with an output resolution of 27ft (or equivalent, depending on your projection).</li>
<li>Reclass that raster so that everything < 40% is null.</li>
<li>Using your >=40% layer assign a value to each grouping (in GRASS, this is <tt>r.clump;</tt> in Arc*, this is the Region Group tool from Spatial Analyst).</li>
</ul>This next part is hard because looping pretty much requires a programming language - I used GRASS (wrapped in a shell script), you could use AML or Python if you're an ESRI user.<br />
<br />
<br />
For each group:<br />
<ul><li>Find minimum elevation in that group</li>
<li>Buffer out 300' from the group</li>
<li>Delete all pixels from the buffered region where slope is null and elevation is less than the minimum for that group.</li>
</ul>Ta da! You have a raster buffered out 300' upslope.<br />
<br />
<i><b>But wait....</b></i><br />
<b><i><br />
</i></b><br />
What if a pixel is both downslope from one face and upslope from another? (Imagine a ledge or an old lake shoreline like the bench in northern Utah created by Lake Bonneville.) Well, in this case, we will have eliminated those pixels, which we don't want to do.<br />
<br />
We can solve this by taking an intermediary step - creating an empty raster, then instead of deleting the pixels, do a logical OR against the output of the previous iteration of our loop. This allows us to keep our pixels if they're within 300' of <i>any</i> upslope region.<br />
<br />
Unfortunately, that loop can add some significant processing time, anyone have another way to do it?GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-87243314243996327952009-10-01T14:42:00.000-07:002009-10-05T16:55:37.892-07:00Interesting challengeGiven that lately I've been doing a lot of <a href="http://en.wikipedia.org/wiki/Extract,_transform,_load">ETL</a>, which involves working with a lot of low-level data structures and data transformation, I don't get much chance to think about some interesting analysis problems, particularly raster based ones. But today, I got presented with one.<br />
<br />
<blockquote>Using a DEM, create a 300' buffer around any slope greater than 40%, where the change in elevation from one edge of the slope to another is at least 10', but buffer only on the <i>upslope</i> side.<br />
</blockquote><br />
How would you do it? I'll post my own answer soon.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-11514953354631076482009-09-26T11:50:00.000-07:002009-10-05T16:41:54.455-07:00Tweaking OpenLayers WFS requests to work with featureidOpenLayers (at least as of 2.8) WFS requests always include the bbox, but that doesn't work if you specify a featureid (the two are defined as mutually exclusive). Here's a quick work-around for this problem using apache's mod_rewrite.<br />
<br />
I'm using apache as an AJP proxy in front of geoserver, but there's no reason this wouldn't work with other WFS servers like mapserver, etc. Put this in the appropriate config file:<br />
<tt></tt><br />
<tt>RewriteEngine On<br />
<br />
RewriteCond %{QUERY_STRING} featureid=[^&]+ [NC]<br />
RewriteCond %{QUERY_STRING} (.*)bbox=[^&]+(.*) [NC]<br />
RewriteRule (.*) $1?%1%2 [P,L]<br />
<br />
ProxyPass /geoserver/ ajp://localhost:8009/geoserver/<br />
</tt>GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0tag:blogger.com,1999:blog-5125852724824145995.post-83802839449248296402009-09-08T17:04:00.000-07:002009-10-05T16:42:26.160-07:00Introducing....In what may be a fit of foolishness, I thought I'd create this blog to post things that I find useful in my day-to-day work, coupled with the occasional random thoughts on a topic of interest, usually related to the world as I see it (however skewed that may be).<br />
<br />
Expect to see stuff on Economic Development, Programming, and GIS work -- especially if it's related to open source GIS.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.com0