Saturday, May 2, 2009

Selecting features in a Spatial way using MySQL


There is really no limit to what I can do with HTML, PhP, GIS and MySQL any longer. It was a sharp learning curve, and it remains a very brisk uphill walk against the grade: but it is possible, everything I possible. When I think of a problem now, or something I want to do and give more utility to the operation of the program – I have to spend some time thinking about how I want to approach it, but I CAN approach it.



I don’t know what I thought – but I always thought that programming would be harder than it is. Here I’m referring to PhP, but this could b talking about any kind of programming – I thought it would b monumentally difficult. When I was younger, I wrote program in Visual Basic to help my kid sister learn to multiply numbers together: it was a pretty great program, very simple but it did gie me the chance to learn programming. Somehow along the way I convinced myself that using any other language was going to be an insurmountable task. Well, now that I’m here, and I’m using PhP and the variables are flying and my arrays are being filled and unfilled I have come to the realization that it isn’t any harder than visual basic was: and in a lot of ways it was much, much easier. I don’t just mean that it was easier to learn because I already had that experience with visual basic as a kid either: that is certainly and obviously true as well. What I mean to say is that independent of what I knew before: learning a newer programming language and working with it in a production environment today is easier than it was back with the 8088 and other obsolete equipment I had to use back in the day. On the other hand, without that obsolete equipment, I wouldn’t have been able to do anything at all. I only wish I had tried to learn some other language sooner – I feel like the possibilities of what I can do are so limitless that I’m disappointed I didn’t know about their existence sooner so I could have been pursuing them for longer at this time in my life rather than just getting started with them.

Right now, I’m still adding some features and functionality to the script I wrote for Utility Billing to allow them to pull Imperious Surfaces up. What I am adding for them is the ability to see the parcel boundaries and not just the impervious surfaces in the area they are looking at. In addition, I want to add some functionality so that they can see the impervious surfaces for properties adjacent to the ones they searched for. I plan on having those two changes implemented by the end of this next week. I already have the geometries for all of those features stored in my geodatabase, which is always a fun challenge: now I just have to get them to display appropriately.

The larger challenge, and the more interesting one is that I want the parcel boundaries to display, but not all of them and not all the time. By not all of them, I mean that my users have searched for the imperious surfaces of a particular parcel: and they want to see the parcel boundaries, but they are zoomed in so far that they can’t see many properties: maybe 100 at zoom level 18. So, I need to figure out a functional way to select only those parcel boundaries that are within the present field of view. The reason this is interesting is because I am going to have to find a spatial function of MySQL, and I like figuring out the ways that that RDBMS is equipped to deal with spatial data. I think I should be able to find a way to make it happen, such that when a property shows up, all of the parcel boundaries that are within say ¼ mile are selected and made available to display as well. What I don’t know is how much processor power is going to be eaten up doing that SELECT. Perhaps if it eats up too much processor power, and therefore requires too much time, I’ll have to find another solution. But the cool thing here is that I’m not simply selecting all of the parcels – or even just the one parcel I’m searching for (I’ve done both of those things) but SELECTING a subset of parcels based on their location attributes using MySQL’s spatial engine and all of this Geo-relational magic is happening independent of ArcView or any other ESRI product.

I’ll keep you posted on how it turns out.

Dom

No comments:

Post a Comment