Wednesday, May 28, 2008

Programming Tutorials

I am creating a series of lessons to teach GIS Programming in an ArcGIS Environment.

Please visit the site here.

Please post your comments about the lessons at this post.

Hope you enjoy.

Read the Fine Print

Still doing KML Google Earth stuff. I'm working on a tool that generates kml/kmz files from an Excel file, and you can set it up to do some classifications including color, etc...I kept coming across that the legend I was creating in .NET (using GDI+) was not the same colors as the symbols. These were simple icons, testing using the paddle icon. Could not figure out why I was getting different colors, until I revisited the KML reference and actually read the whole paragraph regarding color. I had only read the alpha part to set transparency. Unlike the rest of the world (including Google Maps, and Google Charts APIs), KML color is Blue Green Red, not the typical Red Green Blue. I guess the fault, or annoyance, really lies with Keyhole. Not difficult, just needed to rearrange the values.

Thursday, May 15, 2008

Quick Tip #1

Here's a quick tip that I learned today. In ArcMap 9.2, instead of using copy and paste. While moving a label at the same time press the ctrl button. Release the mouse button, then the control button and the label is copied to the new location.

Wednesday, May 7, 2008

The Anarchist's Cookbook to MapInfo

There have been a number of posts about working with MapInfo. You may also be interested in them.
*End Edit*

Let's get one thing straight - I hate working with MapInfo. I know a lot of people love it. At least one person has said, "I used to work with ArcView, and then I tried MapInfo and never switched back." I can understand this if maybe you worked with ArcView 3.2 (which I hate working with too), but the newer version of ArcGIS is a different program. At some point, as a software company, you have to wake up and stop building on top of your legacy programs. AutoCAD has done this(at least twice), ESRI did this, Microsoft does this annoyingly (office 2007). Yes this creates bugs and in some cases a slightly less stable program, but the capabilities and improvements, in my opinion, outway the negatives. Now, there are good ways and bad ways to handle this. Autodesk handled it well, simultaneously releasing versions of their old land desktop and new civil 3d. Increasing the stability of civil 3D with each release, and eventually phasing out the old product. The temptation is not to learn the new product because it is easier to work in the old product. Microsoft handles this badly, because they just give you something new and different. I've heard it estimated it takes at least a full month of using the new version of office regularly in order to get back to your level. If you are in a workplace, when do you have time? I'm sure ESRI didn't phase well, but this was before my time. My main question is why would anyone pay 3000$ for MapInfo when you get essentially the same product for 300$ with Manifold GIS (complete with its own annoyances)?

I will add this caveat though - I come from an AutoCAD ArcGIS background. Obviously I am biased, and I'm probably trying to force Arc methods on MapInfo tools. So if my tips point to something I'm doing wrong, hopefully I will be corrected. I appreciate any additions, corrections, complaints. I've spent enough time ranting, time to move onto some tips. My focus is on Layouts, Maps, and Labels.

1. Use workspaces. You are forced to use workspaces, so might as well use what you are given. Save often, too. This is a no brainer, but it was a struggle for me to get over how crappy workspaces are. Be sure to close all tables before opening another workspace, or you'll merge two workspaces together. Workspaces are not like a drawing in AutoCAD, or a Map in Manifold, or an Mxd in Arc; these are static saves of your "project". A workspace is the closest thing to a project MapInfo offers. If you happen to close a layout, or a Map Browser without saving a workspace, then you have lost this information. That doesn't happen in other "normal" software. If you couldn't tell, I've made this mistake several times.

2. Add the named views tool to your program (Tools --> Tool Manager --> Named Views), and use it. Let me explain what I mean by views: a view on a layout is a frame that looks out onto your world. In most cases the view looks out onto a Map Browser. If you don't use named views, then it is difficult to maintain the same view in a frame on a layout. As soon as you zoom or pan in a map browser, this changes the associated views in your layout. To get back to where you were there is previous zoom, but that is lost if you move 2X. A named view is really your only way (as far as I can tell) to retrieve a view. Named Views would be similar to a bookmark in ArcGIS, or a view in Manifold. There is no need for views in AutoCAD because it is intelligent enough to remember your view regardless of what you do in modelspace (data view, map browser). I wish GIS systems would do this as well, but they don't.
The main problem with named views is a view is saved at the program level. This means it is not saved in the workspace. Also, it is only saved at the program level if you shutdown properly. If your MapInfo crashes, all the named views are lost since your last shutdown, even if you've saved your workspace. If you have two versions of MapInfo open, named views from the first program you shut down are lost. If someone opens up a workspace, they will need to create their own views. Please Please someone tell me I'm an idiot, and there actually is something better than this! (or just tell me I'm an idiot if you prefer, but I'd prefer something more constructive).

3. Layouts and views. This isn't a tip, but a warning. You can't double click on a view and access the map browser. This is just an irritation if you've used Arc or CAD. You just need to switch back to the map browser. It's a slight loss of productivity, but doesn't matter to much.

4. Labeling is pretty good in MapInfo. It's sort of a combination of automatic labeling and manual labeling. That really makes labeling fairly easy, because you can turn the labels on, and then move them around. The nice thing is they don't loose their associativity with the layer, so you can turn them off. You can also change the style en masse too, which is handy. When moving labels, it behoves you to first set up your layout and views(frames) with a chosen scale. This, of course, changes your map browser scale. Create a named view in this map browser view, so you can get back to it later. Then change the map browser scale to the same as the layout view scale. Now move the labels. Go back to the named view when done, and check out the results in the layout. If you don't do this, and edit the labels with the named view scale, they will suffer from "5 year old needing to pee" syndrome and will bounce all over the place. This syndrome also happens in Arc on occasion (in particular with the dynamic scale bar in layout view). Here is an example. Add a frame to a layout and select a map browser. This is your view of the map browser. When you double-click on the frame/view, you can set the scale (1 cm = 20 km). When you go to your map browser, the scale will be set as 1cm = 11km (or something like that). Save the named view, then change the scale to 1cm = 20km. Move the labels. Go back to the saved view (this changes the scale back to 1cm = 11km). The labels should look correct on the layout view.

If you're not confused, then I haven't done my job.