Author Archives: nathanvda

[postgis] BUG: ST_geomfromgeojson rounds z values

… and then I encountered a bug in Postgis 2.0.4. Fuck. ST_geomfromgeojson rounds my z-values to integers, effectively making them useless. I have a little example demonstrating this, and so I imagined to submit a bug. Unfortunately the bug-tracker requires an OS-Geo account, and to get that I need to write an email to get […]

[wice-grid] adding custom filters for a column

Let me quickly introduce WiceGrid, if you do not know yet: it is a super-gem that will allow you to easily show a list/grid of items, and allow easy filtering/searching/pagination. For rails there is, afaik, no better alternative. There are some javascript/jquery driven dynamic grids, but for me the big advantage is that with WiceGrid […]

[rubygems] handling SSL errors on Windows when installing gems

When you encounter SSL errors when installing gems on Windows, the easiest workaround is to change your sources from https://… to http://…. But … I am an avid user/fan of rails-assets.org and today I suddenly started getting the error on their domain. So at first I feared that rails-assets had stopped as foreseen (in this […]

Handling deprecated :insert_sql and :conditions for habtm

In a system I am helping to develop a person can be linked to a myriad of things, including themselves, so we use a relation table PersonRelation defined as follows class PersonRelation belongs_to :person belongs_to :personifiable, :polymorphic => true belongs_to :person_relation_type end So a person could be linked to different “personifiable” things, and sometimes the […]

[oracle] avoiding SLOW sdo_aggr_union

There is this recurring problem we have in GIS: getting road-segments and wanting to show complete roads. The naive approach would we to do something like the following: insert into street_geoms select ro.rd_ro_ident, ro.rd_ro_name, ro.com_code, ssdo_aggr_union(sdoaggrtype(rd.ro_geometry, 0.005)) as geom from rd_road ro, rd_ro_sec ros where ros.rd_ro_ident = ro.rd_ro_ident group by ro.rd_ro_ident, ro.rd_ro_name, ro.com_code; For good […]

[ORACLE] updating coordinate systems’ definition

We are in the process of migrating an old GIS system. For our new systems we use POSTGIS. But this one still uses oracle. The data is spanning two countries: Belgium and the Netherlands. Our system does something awful: all data is stored in RD (the dutch coordinate system, using Oracle SRID 90112). So how […]

[rails routing] protecting a mounted engine

In a project we built, we are using que for doing our background-jobs, and there is a very simple (but sufficient) and clean web-ui, called que-web, allowing us to monitor the status of the jobs online. And normally, you just include it in your project by adding the gem, and then adding the following to […]

Using render-anywhere gem with partials

Normally in rails, you can only render views inside of the controller. But what if you want to render a view somewhere else? For instance we wanted to generate xml-files using views. Haml can be used to describe xml just as well as plain html. There is a gem called render_anywhere that allows just that. […]

[rails] ignoring specific postgis view and tables in schema.rb

Developing rails websites with a geographic component we rely heavily on Postgis, so we use activerecord-postgis-adapter for the Postgis support, and I always use schema_plus because it allows me to define views. Until recently, I always had to use the structure.sql instead of the schema.rb because the geometric columns did not dump correctly. But for […]

[geoserver] failed to look up primary key in oracle table

I have a very weird problem with my geoserver+oracle, when deployed on a Windows 2012R2 server (see here), and in attempting to solve that, I upgraded the geoserver from 2.6.3 to 2.7.1, hoping that that would fix that. Sometimes fairy tales come true, but in this case it did not help, unfortunately. The 2.7.1 did […]