Interview with Gary Sherman (part 1)
04.10.2011 15:06 · Notes · qgis
Tim Sutton interviewed Gary Sherman, creator of the Quantum GIS Project. The first part is already available, the second part will be published later.
Here I post my thoughts, QGIS tips and tricks, updates on my QGIS-related work, etc.
04.10.2011 15:06 · Notes · qgis
Tim Sutton interviewed Gary Sherman, creator of the Quantum GIS Project. The first part is already available, the second part will be published later.
GDAL is gradually moving towards full Unicode support: RFC 23 has already been implemented, and there are ongoing efforts to implement RFC 5.
Another step was the implementation of recoding of Shapefile attributes to UTF-8 when reading and from UTF-8 when writing. Except for that… the encoding is determined by reading the LDID (Language Driver ID) from the DBF header. In general, this is the right approach, but I can’t remember the last time I saw shapfiles with the encoding specified correctly. Mostly, there are files with LDID set to 87, which corresponds to the default
value.
This is where the most interesting part begins. It is clear that this default
is different for everyone. And in the current implementation, the LDID/87 value is interpreted as ISO8859_1 (Latin-1). The problem with this approach, I think, is clear to everyone. The proposed solution is either to edit the existing files and set the required DBF encoding or to override the interpretation of the LDID value by setting an environment variable. The first method requires more work (it is necessary to find out the encoding of each Shape file and write it in the DBF header), but it is also the most correct. The second one is actually an ugly workaround because, with this approach, only files in one, overridden, encoding will be read correctly. All others will still be displayed as unreadable garbage, which is unacceptable when using data in different encodings.
23.09.2011 08:21 · Notes · qgis, gource
Nathan Woodrow made another nice video showing the activity of the QGIS developers between versions 1.6 and 1.7 (1265 commits were made during this time). The spike in activity in November is a hackfest.
22.09.2011 14:36 · Notes · android, howto
Most Android devices can determine their position with some accuracy. This is achieved by using the Global Positioning System (GPS), triangulation from mobile network base stations, or by using open (public) hotspots. To use these features, we need the android.location
package.
There are several classes in this package. The most important ones are:
LocationManager
— provides access to the system location services, i.e., GPS and others. It also allows you to select the service that best meets your criteria (power consumption, positioning accuracy, etc.)LocationProvider
is an abstract class from which all providers of geographic location information are derived. The provider periodically provides information about changes in geographic coordinates of the deviceLocationListener
— used to receive notifications from the LocationProvider
when coordinates changeOther classes that are worth mentioning are Location
(geographical location of the device at a given point in time) and Criteria
(criteria for selecting a provider).
In this post, I will focus on getting coordinates from the GPS_PROVIDER
provider.
A few months ago, the question of integrating OSSIM into QGIS was raised. The discussion was interesting and active, the OSSIM developers even published some experimental code, but it all fizzled out.
One of the reasons, in my opinion, is that the developers of the OSSIM data provider published the code not as a normal patch but as a set of modified files. Moreover, all this was done not on the latest master but based on outdated SVN sources. Another reason is that, at the same time, we had an active discussion about a new Processing Framework, and its development started. And the possibility of integrating OSSIM through this framework was also considered.
I didn’t feel like writing a report for my contest work today, and I didn’t feel like working on an Android app either. So I decided to see what the guys from OSSIM had written. In general, it doesn’t look too bad, although there are a few questionable solutions. For example, for some reason, they invented their own class for saving settings, even though there is QgsOptions
and a settings dialogue. I have tried to integrate their code into master. The results are in my fork on GitHub, branch ossim_provider
. I haven’t tested it myself yet, as I haven’t found a pre-built OSSIM package, and it will take quite some time to build it on my laptop.
Giuseppe Sucameli has successfully completed his GSoC 2011 project — the DB Manager plugin for QGIS.
DB Manager combines the functionality of the PGManager, SLManager and RT_Sql_Layer plugins and supports SQLite/SpatiaLite and PostgreSQL/PostGIS databases (including raster support). With this plugin, you can:
In addition, while working on the module, Giuseppe implemented the ability to import layers from one data source to another (commit 1a70dddca1). This allows you to easily import data from a shapefile into a PostGIS or SpatiaLite database, and vice versa. This functionality is available in both C++ and Python.
Besides Pascal bindings for GDAL, I also have Pascal bindings for Proj.4 — a library for working with coordinate reference systems.
But while in the case of GDAL there were no Pascal bindings at all, the situation with Proj.4 is much more complicated. There are Pascal modules for old Proj versions 4.4.3, 4.4.6 and 4.4.7 (by Alexander Weidauer), which I used as a starting point for my work. The FPC also has a built-in package (based on the newer Proj 4.6.1). Unfortunately, I found out about this package after I had written my module.
So now I’m asking myself, should I make my code public or not?
31.08.2011 08:28 · Notes · android
Android… So, it got to me. No, I did not become the happy owner of a shovel-shaped device mistakenly called a “phone” (my old SE K320i is great). It’s much worse than that :-). I had to find out how to develop applications for Android.
After successfully downloading and installing the SDK, I started looking for an IDE. On Android Developers there are two options: Eclipse with the ADT plugin and command line + any editor. I tried this Eclipse… IMHO, it’s an abomination. Firstly, it is terribly slow. So slow that M$ Visual Studio under VirtualBox beats it in terms of responsiveness and convenience. Secondдн, the interface organisation is awful. I have often heard that GIT is for aliens, in this case, Eclipse is not clear who wrote it and for whom :-). You won’t believe me, I spent about 15 minutes trying to find a way to open an existing project. It turns out that you have to import them not open. And the rest, like annoying hints on a quarter of the screen, the inability to change anything in the project properties if there are errors, etc. In short, Eclipse didn’t work for me.
I decided to write the code in Geany and build it manually in the terminal. However, there is also IntelliJ IDEA, which is rumoured to support the Android SDK, but I didn’t bother to try it (maybe for nothing).
P.S. By the way, for me the emulator wouldn’t work on the main X server, failing with
XDM authorization key matches an existing client! SDL init failure, reason is: Couldn't open X11 display
I wasn’t in the mood to look into it, so I just ran it on a separate X server.
A long time ago, in a galaxy far, far away… Almost a year ago, I was involved in a project that is now almost dead. It was notable not only for its ideas, but also for the fact that its main development tool was Delphi. In my opinion, this was not the best choice: if you need ObjectPascal so much, you should use FreePascal, which supports 64-bit and is cross-platform, open, and free. But that’s not the point.
The GDAL library was supposed to be used to work with vector and raster data, but… As it turned out, there are no bindings for Pascal. There are bindings for Python, R, Perl, PHP and a few others, but not for Pascal. Well, there is a ticket in trac from 4 years ago, but the solution proposed there is basically a hack, because it requires changes in the GDAL code and a custom GDAL build. We had to do something… So I remembered my youth, remembered how I used to code in Pascal and tried to make a wrapper for the library.
I tried to keep the code compatible with both FreePascal and Delphi. Unfortunately, for various reasons, I did not manage to create a complete wrapper. Maybe when I have the time and resources, I will slowly add the missing bits. In the meantime, I have decided to publish the current implementation on GitHub. I hope someone will find it useful.
17.08.2011 08:56 · GIS · qgis, android
Following the news of the successful cross-compilation of QGIS on Android, QGIS was launched on the ASUS Transformer tablet (Android 3.2) and the Samsung Galaxy phone (CyanogenMod 7RC1).
At the moment, QGIS runs without some features (e.g., no Python support, not all providers are available, etc.), but the GUI is fully functional, although there are some problems using it on mobile phones due to the small screen size.
If you want to give it a try, there is a pre-built APK (note that you need to install Ministro and Qt first; the total download size is ~130 MB). There is also a compilation guide on the wiki.
Video of installing and running QGIS on ASUS tablet