A colleague of mine recently asked about computing basic summary statistics from grouped data in R. These are a couple examples that I suggested. Additional documentation for the plyr package can be found here.
A colleague of mine recently asked about computing basic summary statistics from grouped data in R. These are a couple examples that I suggested. Additional documentation for the plyr package can be found here.
In February, at the Toronto Code Sprint, the PostGIS team looked each other in the eye (for the first time) and committed to get the 1.4 release out by late April.
There is a common online question about migrating from Apple's Mail app (Using .emlx format mail files) to Thunderbird (or any other non-Mail app). I looked at a few options and have decided, as strange as it may seem, that installing an IMAP service was the best solution.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
My friend Jo asked on GEOS mailing list for approachable explanation of spatial relations and Dale Lutz from Safe Software suggested something I’ve not came across myself before and what (in generalised form) I’d consider as a great idea for…a book really :-)
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
My wife asked me: Buy sausages, if you’ll find eggs, buy 10. What happens next?
Option #1:
if eggs >= 10 then buy(sausages, eggs=10);
Option #2:
if sausages > 0 then buy(sausages);
if eggs >= 10 then buy(eggs, 10);
Option #3
buy(sausages);
if eggs >= 10 then buy(eggs, 10);
The 3rd option is dangerous one because it could end up with never-ending run in the city looking for sausages, never buying eggs and never coming back home.
…and more. Why?
Asking me to make shopping, my wife did not stick to the principles of valid inference and correct reasoning. That’s the reason why not everybody can be a programmer :-)
In times when independence is a deadly sin and in times of Google-like NDA-ization of nearly all professional activities of an individual…
…it’s quite extra-ordinary to have enough courage to shout out:
I don’t speak for my employer. For example, our site is one of those Flashy Internet dead-ends I’d never enter. See? I don’t speak for them.
or may be no courage is needed to criticize bad design ;-) BTW, it must be an old critique by Yossi. Now their website looks good.
I’ve just finished uploading photos taken on the OSGIS UK 2009 in Nottingham, so here is the set.
I’ve re-re-re-learned the lesson that light conditions in a conference venue is bad and I should always bring a proper strobe. Otherwise, pictures are dark or very grained (high ISO) or blured (mostly, unless your name is Arnold The Steel Grip). Ah, one more thing, don’t buy a DSLR with lens included, it simply is a waste of money. The kit lens is a piece of @#$%^&!, so just buy a body and then buy a proper (read: expansive) lens from Pentax (or Sigma). To quote the classics:
you are awesome
you have awesome camera
but it’s useless
without (proper) lens
Anyway, it’s always nice to have some photolog after events, even if the pictures are of bad quality.
I’ve been using Peaksware’s WKO+, a cycling and running training tool to manage data from heart rate monitors, GPS units, power meters, etc. Its a powerful tool with a clunky UI but I’ve gotten used to it.
You pay $100 for a “personal” license. Not a big deal to me since they basically have a monopoly on this software niche. I first installed it on my work computer to test the data from my daily bike commute. Cool it works. Then I went to install it at home since that’s where I’ll be using it. Works ok. I proceed to gather all my fitness data into their proprietary binary format.
Fast forward a few months. I’m reformatting the hard drive on the laptop and want to move all my data and software to my desktop. But installing WKO+ is giving me a headache (”Error: Too many installations”). The registration process takes a hardware fingerprint and your must active it via the web to get a registration code. However, hidden withing their EULA, is a term which dissallows the transfer of license to another computer other than the one to which it was originally installed. The second installation was just an allowance they make to allow for “hard drive crashes” and such.
Since neither of those machines would be available to me, certainly there would be a way to transfer it? After several progressively more desperate communications with Matt Allen at peaksware support, he informed me that there was no way they would transfer the license (the non-transfer clause IS in the EULA after all). I would need to purchase another license simply because I switched computers!
Here is my response:
Basically what you are telling me is that I can no longer use WKO+
without paying again. I get to use the software for a few months and
you revoke my right to use it because I buy a new computer! I am a
paying customer, trying to be totally legit here, willing to support
your business in exchange for a license to use your software and you
insist on screwing me over. Brilliant.This is one of the most unprofessional and idiotic stances I have ever
seen from a software company. Your intention appears to be to screw
over your paying customers and milk as much cash from them as possible
- you might want to rethink that business model unless you want to
loose customers! I will never endorse, recommend or purchase another
product or service from peaksware nor will any of my family, friends,
teammates or readers once the word gets out about your disrespectful
policies.There are numerous typical situations where a new copy of the software
would need to be installed including:* Hard drive failure
* Operating system upgrades
* New computer purchases
* Extended traveling and touring (installing onto a laptop or netbook)Now I fully understand why your policy is one license per computer. It
makes perfect sense. I have seen plenty of other software with a
similar licensing model. But they also allow to uninstall the software
and re-register it on another computer due to these circumstances.
There is simply no technological reason why you could not implement a
licensing structure that allowed the user more freedom to transfer
licenses while still preventing piracy. As it stands, your licensing
model treats paying customers like criminals if they happen to run
across any one of the above situations.So, to sum it up - your foolish license policy has lost you one
customer and many future ones.Good riddance.
So if you want to support a company that treats its paying customers like criminals because they get a new computer, go right ahead and support Peaksware. But anyone who expects to use software that they pay for even if they happen to buy a new computer should steer clear.
The real kicker is that all that work is locked away in their proprietary file format simply because of their draconian licensing. This is the real take home lesson to all software users (not just fitness geeks): If you lock your data away in a proprietary format and are beholden to a single company in order to access it, they can and will screw you. Always insist on open data formats, even if using proprietary software. Oh and always read the EULA carefully before clicking OK!
I had been thinking about developing something like that since I started to use Mac OS X as my development environment, but I left my Apple boxes at home in PL and now I’ve switched back to Linux (you simply can’t forget your roots :-)) . So, the idea has been swapped in the abyss of my mind until I accidentally came across GISLook five minutes ago:
GISLook and GISMeta are plugins for Mac OS X 10.5 that show GIS data in the Finder.
These cool-looking plugins were created by Bernhard Jenny.
I know many GIS users loving products of the forbidden fruit, so I’m spreading the word about these nice looking and, hopefully, well working tools.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Tomorrow early morning I’m leaving to Nottingham to attend the OSGIS UK 2009 conference. It’s been long time since FOSS4G 2007 and I didn’t make it to Cape Town last year, so I’m looking forward to meet FOSS4G and OSGeo folks in UK.
A few minutes ago, Suchith Anand announced there will be live streaming transmission available from OSGIS sessions. This is cool!
By the way, does anyone remember a kind of pioneer transmission from FOSS4G 2006 in Lausanne? The videos are still linked but seem to be unavailable. Pity. It would be cool to archive them somewhere on foss4g.org.
When I was setting up my linux system a few years ago, I did some research into filesystems and determined that the XFS file system, being particularly proficient in dealing with large files, would be ideal for my home directory. And it was. But the one factor I didn’t consider was portability. Turns out that there is basically no support for XFS in windows.
So how do you access your files from Windows if they are on an XFS partition? I had just shy of 1 TB of data to transfer so using my other linux box and transferring across the network would have taken forever. The solution I came up with is a bit convoluted but it has some real advantages:
1) Install Sun’s VirtualBox.
2) Download an iso for your favorite linux distribution (mine being Ubuntu 9.04)
3) Create a virtual machine from the linux iso
4) Install the VBOxGuestAdditions in the linux virtual machine.
5) Create a Share folder on the windows host and register it with the virtual machine. This will allow you to transfer files from the guest (linux) to the host(windows) You may have to manually mount the drive in the linux guest:
mount -t vboxsf share_name /mnt/share_name
6) Using the windows host cmd line, create a vmdk from the physical drive that your XFS partition resides on. In this case, PhysicalDrive1 corresponds to the second SATA connector. This will allow your guest OS to talk directly with the drive:
cd C:\Program Files\Sun\xVM VirtualBox VBoxManage.exe internalcommands createrawvmdk -filename "C:\Documents and Settings\perry\.VirtualBox\HardDisks\Physical1.vmdk" -rawdisk \\.\PhysicalDrive1 -register
Once completed, you should see:
RAW host disk access VMDK file C:\Documents and Settings\perry\.VirtualBox\HardDisks\Physical1.vmdk created successfully.
7) Make sure to add the physical drive to your list of hard drives in the linux guest options. Restart the linux guest virtual machine and your XFS partition should already be mounted. Now you can begin transfering files between your XFS partition and the shared folder on the windows host.
Whew. Lots of hassle for a simple file transfer, right! But the side benefit is that now you have a fully functional linux virtual machine with a shared folder set up to the windows host. Very useful - even when you must run windows, it helps to have a linux VM standing by!
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
The OSGeo Fundation is driven by volunteer manpower and sponsorship. The OSGeo Foundation is a proxy body that transfers contributions from sponsors to activities initiatives and projects that perform under the umbrella of OSGeo, to the OSGeo members. The OSGeo members (right column) are free to raise funds on their own. Some projects do it very well, some don’t do it at all (and it’s not any fault, it just happens). However, all participants are eligible to accept OSGeo support in the same way, scale, etc. For instance, all members use OSGeo brand, OSGeo infrastructure, OSGeo marketing efforts and many more. The OSGeo Foundation membership is a value. Period.
Let’s make it straight. What about reversing the direction of flow of support? Should there be any reason to not to ask projects to support OSGeo Foundation? If a project is well funded by 3rd party organizations, it should be a part of fair play to expect a minimal tribulum paid back to OSGeo. Actually, this mechanism has been included as a part of the Project Sponsorship program:
One quarter of the sponsorship amount will be put into the general OSGeo account for any OSGeo use (such as paying hosting costs, general promotion, etc)
Does it apply in case OSGeo member project gets funds through a back door?
There are bills to be paid, there is always a lot of work to get done around OSGeo activities, meaning there are expectations, there are loads of tasks that need to be accomplished in reasonable amount of time, but a limited resources available.
Disclaimer: I was born in socialistic republic that no longer exists, but it does not mean I believe in socialism or that I’d like to see OSGeo being converted into communist party and Tyler flying to North Korea with official visit to give Kim a hug.
I believe in joint responsibility and fair play.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Not sure why this didn’t occur to me before I wrote that last post but I tried the “pythonic” version of the code under the IronPython 2.6 Beta 1 release and it works!
lyr = Carto.LayerFileClass()
lyr.Open('C:\\test.lyr')
print lyr.Filename
Works perfectly now. So IronPython 2.6 promises to be a viable option for extending ArcGIS. My enthusiasm has been renewed.
Occasionally I find myself in the C#/.NET world in order to write code using ESRI ArcObjects. Today I was toying with the idea of automating the creation of ESRI Layer files (a file which defines the cartographic styling of a dataset). Of course they are in an undocumented binary file format, inaccessible to anything but ESRI software. So I pop open Visual Studio ….
I feel a nagging unease every time I type a set of curly braces. And VB just makes me insane. I prefer, of course, to use python. Luckily there is IronPython which runs on .NET - which means I could theoretically use it to interact with ArcGIS.
I only found a single working example of using ArcObjects through IronPython. But it looked promising enough to close Visual Studio and give it a go.
The first nagging problem is an IronPython-specific one. Relatively minor annoyance but you have to add the reference to a .NET assembly (library) before you can load it.
import clr
clr.AddReference('ESRI.ArcGIS.System')
clr.AddReference('ESRI.ArcGIS.Carto')
from ESRI.ArcGIS import esriSystem
from ESRI.ArcGIS import Carto
Now there is the issue of grabbing an ESRI license. A little verbose IMO but it could easily be encapsulated in a helper function to clean things up.
aoc = esriSystem.AoInitializeClass()
res = esriSystem.IAoInitialize.IsProductCodeAvailable(aoc,
esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcView)
if res == esriSystem.esriLicenseStatus.esriLicenseAvailable:
esriSystem.IAoInitialize.Initialize(aoc,
esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcView)
Now that we’ve satisfied the demands of our proprietary license overlords, we can proceed with the real work .. in this case I just want to open an existing Layer file and see if the resulting object knows it’s own file path. Really simple, right?
lyr = Carto.LayerFileClass()
if "Open" in dir(lyr): print "The Layer object has an Open method but...."
lyr.Open('C:\\test.lyr')
print lyr.Filename
The Layer object has an Open method but.... Traceback (most recent call last): File "“, line 1, in AttributeError: ‘GenericComObject’ object has no attribute ‘Open’
Hrm. Looks like we’ve run across bug 1506 which doesn’t allow access to the properties and methods of a given instance - instead your have to work through the functions provided by the implementation. Grr…
Carto.ILayerFile.Open(lyr, 'C:\\test.lyr') print Carto.ILayerFile.Filename.GetValue(lyr)
That is unwieldy, ugly and unpythonic. What’s the point of object oriented programming if you can’t access the methods and properties of an object directly? Since all ArcObjects applications are based on extending COM interfaces, this would be a major pain in any non-trivial application. Basically, until these .NET-accessible COM objects can be treated in a pythonic way, I don’t see any compelling reason to pursue IronPython and ArcGIS integration. Looks like its back to C# for the moment … (/me take a deep sigh and opens Visual Studio) … unless of course anyone has some brilliant solution to share!!
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
mysql> select count(*) from tiger_roads_texas
where mbrintersects(geom,
GeomFromText('LINESTRING(452284 -1651542, 452484 -1651342'));
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
mysql> select count(*) from tiger_roads_texas
where mbrintersects(geom,
GeomFromText('LINESTRING(452284 -1651542, 452484 -1651342)'));
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.06 sec)
tiger=# select count(*) from tiger_roads_texas
where geom &&
GeomFromText('LINESTRING(452284 -1651542, 452484 -1651342',2163);
ERROR: parse error - invalid geometry
HINT: "...RING(452284 -1651542, 452484 -1651342" <-- parse error at position 43 within geometry
CONTEXT: SQL function "geomfromtext" statement 1
tiger=# select count(*) from tiger_roads_texas
where geom &&
GeomFromText('LINESTRING(452284 -1651542, 452484 -1651342)',2163);
count
-------
1
(1 row)
mysql> select sum(area(t.geom))
from tiger_roads_texas r, tiger_tracts t
where
mbrintersects(r.geom, GeomFromText('LINESTRING(453084 -1650742,452384 -1650442)'))
and
mbrintersects(r.geom,t.geom);
+-------------------+
| sum(area(t.geom)) |
+-------------------+
| 1260394420.00453 |
+-------------------+
1 row in set (9.43 sec)
tiger=# select sum(area(t.geom))
from tiger_roads_texas r, tiger_tracts t
where r.geom && GeomFromText('LINESTRING(453084 -1650742,452384 -1650442)',2163)
and r.geom && t.geom;
sum
------------------
1260394420.00684
(1 row)
Time: 5.574 ms

Another disastrous consequence of inaccurate spatial information… Not only can you accidentally tag your neighbor as a criminal, now it appears that sloppy spatial data has lead to the wrong house getting demolished.
I’ve asked it before but its worth repeating … with all the recent advances in spatial data publishing, where are the advances in metadata and data quality assurance? How do you know where the data comes from, what’s been done to it and by whom? What is the intended use of the data? For the vast majority of the data being shoved out onto the web, these bits of metadata are sorely lacking.
Of course this case is more a matter of one person’s sheer stupidity; I’m not sure any caveats in the metadata would have stopped the wrecking ball!
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.
Read more of this story at Slashgeo.