For the first time ever I have gone through the comments on GISDoctor.com and responded to a number of them. Keep the comments coming!
Moving forward I promise I’ll be more responsive when readers post comments and questions! Maybe:)
Data, Analysis, Spatial, Code, Running, Boston
For the first time ever I have gone through the comments on GISDoctor.com and responded to a number of them. Keep the comments coming!
Moving forward I promise I’ll be more responsive when readers post comments and questions! Maybe:)
After receiving benjaminspaulding.com as a gift over three years ago I have finally done something with it!
It’s nothing much, but it’s simple and to the point.
From Boston.com – Satellite imagery brings Somerville planners to new heights
I live in Somerville (and I love it), and I really hope that the city planners only use this for demonstration or decoration purposes. This is a very technology forward city that is fairly active in collecting and analyzing data to improve functions and services within the city.
The mayor should open a mapping challenge (similar to what the MBTA has done), releasing the non-sensitive data collected by the city and along with data collected from other organizations. They should then encourage residents and organizations to develop a series of community driven map mash-ups and applications that can be used for anything from neighborhood development, planning purposes, analyzing city ordinances, or finding access to any number of city services.
With the number of mapping and technology gurus in this city I think you would see some awesome results. I know I have a few ideas!
Side note: This would be a great topic/workshop for an Ignite event or a Wherecamp…
Dear AAG,
It’s not you, it’s me…
For the first time in eight years I will not be renewing my membership to the AAG. It’s not that I’m moving away from my roots as a geographer, it’s that I really have no use for being a member of the AAG. I’m no longer an academic geographer and I can’t justify paying for the general services they provide. I haven’t attended an annual conference in a couple years, I barely skim the PG and Annals when I get my copy, and their jobs section leans heavily towards academic searches. At this point I don’t have an active membership with GITA or URISA, my membership to AAG will expire soon, and I haven’t paid my dues to GTU in 7ish years…
Now, this brings up a larger question. What is the point of being a member of these professional geo-societies?
Traditionally these organizations have provided a variety of “perks” to their members such as job listings, publications, the latest industry news, and hosting regional and annual conferences. They also lobby on a number of topics (remember MAPPS), for their members and the greater industry. However, I never find myself going to these organizations for the latest news and industry trends, the best job listings, or attending their conferences.
So, what can a geo-professional do to stay “in the loop”, while saving a few hundred bucks?
The question still remains. What is the the point of being a member of these organizations, or any geo-spatial industry group? At this point I don’t believe any of them carry any weight. Does being a member of these groups mean anything anymore? Is there an organization worth being a member of that will actually help me professionally?
If you have the answer let me know (post a comment or retweet!). I want to know! These organizations may be great for many, but unless I’m convinced otherwise, I’ll be a geospatial free agent this year.
I am a big supporter of GIS professionals becoming more technically proficient, keeping their skills relevant to avoid becoming a GIS dinosaurs. One of the easiest ways for GIS pros to stay ahead of the curve is to keep learning and improving their technical skill set.
A new(ish) tool that is making the rounds throughout the interwebs this week is Codeacademy. They provide free lessons on how to write and understand code, all through their website. I’ve signed up and will be trying it out this weekend.
The current set of courses is for JavaScripting, a language that is very relevant to the GIS profession. Some of my friends and coworkers have signed up and they have had positive reviews so far.
So, GIS professional, who is looking to improve their skill set to impress their boss, here is your chance. Signing up and getting started is easy. Before you know it you’ll get the hang of coding and will be writing your own applications! And the best part…it is FREE!
I should start blog, like Lamebook, but for GIS software crash report pages and the witty things users enter in the feedback section.
I hope this would be the first submission.
If you haven’t already read the first three parts of this guide check out:
The first three parts of the guide give some background information on SQL Server, covers some basic spatial and database topics, and provides links to download some software and data. Once the user has completed the first three part of this guide they will be able to understand this tutorial, which will provide some additional basic spatial SQL scripts.
In the last tutorial several scripts were introduced and examples were given. In the last tutorial I covered the process to validate shapes, calculating centroids, and generate buffers. In this tutorial several additional scripts will be covered, including generating the bounding box/extent of a feature, intersection and union operations, and difference operators.
Calculate Extent
Calculating the extent of a feature is something I use from time to time. To find these values, such as the northern bounding latitude or eastern bounding longitude, can be calculated through Spatial SQL. Spatial SQL has a built in method that will calculate the bounding box of a record, STEnvelope(). In its simplest context the user can generate the bounding box for any feature in a spatial table:
use Spatial_Database go select geom.STEnvelope() as boundingbox from dbo.States_Provinces where NAME_1 = 'Massachusetts'
This example will return a field called “boundingbox” for the record where NAME_1 equals ‘Massachusetts’ that contains the minimum area rectangle that encompasses the shape. The data in the “boundingbox” field is relatively useless the user adds some additional code to the query. Building on the example provided by Microsoft the user can add the ToString() method to the query:
use Spatial_Database go select geom.STEnvelope() as BoundingBox, geom.STEnvelope().ToString() as BoundingBoxString from dbo.States_Provinces where NAME_1 = 'Massachusetts'
Here the user will see a new column, “BoundingBoxString” that returns a polygon with the five points that represent it. You may ask yourself, why are there five points when you only need four to create the bounding box? Well, for SQL Server to create a polygon the first point needs to be represented twice, so that the polygon closes itself properly.
Intersect
The intersect table operator is one of the most popular tools in the GIS work belt. Intersect is an overlay operation, where the area of the input feature is used as the basis to select features from the second feature, the intersect feature. The following illustration will explain what an intersect is better than I can with words…
In spatial SQL the STIntersects() tool is straight forward and easy to use. However, it does not return a shape as other overlay methods do. When run, STIntersects() will return a value of one if the two records spatially intersect and a zero if they do not. Also, this method only tests the relationship between a single record in one table against a single record in another table. The following provides an example of intersecting a single line object against a polygon object:
use Spatial_Database go DECLARE @poly_geom geometry select @poly_geom = geom.STAsText() From dbo.States_Provinces where dbo.States_Provinces.name_1 like '%Massachusetts%' DECLARE @line_geom geometry select @line_geom = geom.STAsText() from dbo.Roads where ID = 2974 SELECT @poly_geom.STIntersects(@line_geom) as IntersectValue, @poly_geom as input1, @line_geom as input2
The Massachusetts record form the State and Provinces table is set as the polygon of interest and a single line object from the roads table is also selected. Now, I know that the line object is in Massachusetts so the value returned in IntersectValue field should be a value of one.
Contains
Another spatial overlay method available in spatial SQL is STContains(). This is a yes/no operation. If a geometry instance is completely within another geometry a value of one is returned. If the geometry instance is not wholly inside the other, a value of zero is returned. The following provides a simple example of STContains():
use Spatial_Database go DECLARE @poly_geom geometry select @poly_geom = geom.STAsText() From dbo.States_Provinces where dbo.States_Provinces.name_1 = 'Massachusetts' DECLARE @pointgeom geometry select @pointgeom = geom.STAsText() from Spatial_Database.dbo.Populated_Places where NAMEASCII = 'Boston' SELECT @poly_geom.STContains(@pointgeom) as ContainValue, @pointgeom as input1, @poly_geom as input2
In this query I am simply testing if the point that represents the city of Boston is within the polygon that represents the state of Massachusetts. After all the variables are declared the select statement tests the point against the polygon. The results, in the ContainValue field returns a one, meaning that the selected point is within the selected polygon.
Union
The union operator is an overlay analysis, like the intersect, however the results of a union are the combination of the two features, with overlapping areas obtaining the attributes of both. Again, let’s turn to Esri for a nice graphic:
Like the intersect operation, the STUnion() operation analyzes the spatial relationship between two different records. The basic union query will return the area represented in the union. In the following example the query will select two countries from the world countries table to union. The results of the query return the unioned geomerty of the two selected polygons.
use Spatial_Database go DECLARE @poly_geom geometry select @poly_geom = geom.STAsText() from dbo.world_countries where dbo.world_countries.ADMIN = 'Germany' DECLARE @poly_geom2 geometry select @poly_geom2 = geom.STAsText() from dbo.world_countries where dbo.world_countries.ADMIN = 'Switzerland' SELECT @poly_geom2.STUnion(@poly_geom) as UnionGeo
The initial input are two distinct polygon records, one representing Germany and the other, Switzerland. If the user were to query these two records from the table they would see the following spatial result:
However, during the union the geometry of these two records are morphed into a single feature, as seen below:
Using the example script the user could then add additional fields to the select query or perform any number of additional operations on the unioned record.
Difference
The final spatial operator that will be covered will be STDifference(). The difference overlay operation uses two layers with the area of one being removed from the overlapping area of the other.
In spatial SQL the difference method, STDifference(), returns the geometry of the difference. In the following example the user will find the shape that is left behind between the difference of the United States and Massachusetts:
use Spatial_Database go DECLARE @poly_geom geometry select @poly_geom = geom.STAsText() From dbo.States_Provinces where dbo.States_Provinces.name_1 = 'Massachusetts' DECLARE @USA geometry select @USA = geom.STAsText() from dbo.world_countries where dbo.world_countries.ID = 236 SELECT @USA.STDifference(@poly_geom) as Part1andPart2
The results, as seen below, displays the area that Massachusetts represents in the world_countries table.
Conclusion
Well, that is it for this tutorial. If I have some time over the next month I’d like to explore spatial indexes within spatial SQL and perhaps cover some more in-depth spatial queries. All these queries will work within 2008 R2 and the user can, if desired, use tables from ArcSDE within the queries.
The tutorial and the examples are very simple and I do not profess to be an expert in spatial SQL, so, if there is a way to represent any of these queries more efficiently let me know.
It is with a heavy heart with which I write today’s post. My mentor, as well as mentor and friend to many other geographers and educators, Dr. Kristi Alvarez, passed away on January 26th, 2012. Dr. A, as she was affectionately known, had more influence on my education than any other teacher I ever had. Not only was she was an expert in geography, geography education, GIS education, and spatial literacy, she was a great friend and mentor to countless people.
Her enthusiasm for geography, GIS, and education was contagious. She literally opened up the world to her students. During her time at Keene State she was well respected by her students as well as by faculty and staff. No, scratch that, her students loved her. Her classes were always popular with both geography and non-geography majors and, as an award winning advisor to the Keene State geography club, she helped develop a tight-knit community of students who shared her passion for geography. She was proud of her students and all of their accomplishments. I think it is safe to say that we were all proud of her too.
I was fortunate to have several classes with Dr. A at Keene State, where she was also my teacher education advisor. Late in the fall semester of my senior year I told her I didn’t want to student teach so that I could focus on becoming a geographer. She sat me down in her office and we talked about this major decision well into the night. I remember that she didn’t try to sway my opinion one way or the other. She wanted me to do what was best and she was going to support my decision either way. Once it was clear that I wasn’t going to student teach, she made sure my grad school applications got in the mail. Six years later I completed my Ph.D. in geography and I credit her for helping me find out who I wanted to become. To this day I have a picture of her and I from my graduation on a bookshelf in my office. Without her guidance and wisdom I don’t know if I’d be where I am today.
We stayed in touch after I graduated, often going out to lunch or dinner at conferences. I last saw Dr. A at the 2011 Esri User Conference. We went out to dinner and we talked about life and geography. She was excited about her work at the University of Redlands and all of the projects she was working on. We talked about project ideas and future plans. As always she asked about my wife and invited us to come out and stay with her and her husband if we were to make it out to the west coast. It was a good visit and now that I look back I’m glad it happened.
I was fortunate to have been her student and her friend. Thank you, Dr. A. We will all miss you.
I’ve been a big fan of the Esri basemaps for a while now. I use them in web applications all the time. Within web-apps they are fast, and when used correctly, they are an effective reference layer.
Lately I’ve been running into problems using these basemaps within ArcMap. As you know, you can add these basemaps to an ArcMap view through an ArcGIS Server connection. However, whenever I add any of the basemaps to my map, ArcMap starts to chug, and chug badly.
I know there are a couple issues that will cause any basemap provided through an ArcGIS Server connection to bring ArcGIS to a crawl. The Esri basemaps are all provided in a web Mercator projection and if you are trying to reproject the layer on-the-fly it will slow down the draw rate within the map. Even when I have all my data sets projected as web Mercator I still have drawing and performance issues. In my experiences the initial load of the basemap usually draws quickly, but whenever a pan or zoom event or I start to toggle layers ArcMap will crawl.
What really worries me about this problem is that my fully patched and up-to-date copy of ArcGIS will often lock up or crash when these basemaps are being used in the application. I only have this problem with the basemaps from ArcGIS. I’ve never have this problem with a WMS layer. Perhaps these data sets shouldn’t be used with ArcGIS itself and maybe I’m using these basemaps incorrectly?
Have you experienced this problem? Do you have any remedies to fix this issue (besides not using the layers)?
The next problem I have had with these layers is something I can’t figure out. On a pretty consistent basis I see the inconsistent extent error (see image below). I will get this error when I add one of these basemap layers into the map, whether it is the first layer into a new project or the last layer added. The projection of the view does not matter and sometimes the layer will draw with a blur.
Let me know what your experiences have been and any potential fixes you may know. If I can come to a solution or someone sends me a good one I’ll post it here.
How did I not know about this blog? Guess what I’ll be reading at work tomorrow! You have to give the NYT credit, they respect the importance of geography in journalism.
I’ll be updating the spatial blogs page soon.