graphs grouping pie charts and other stuff
Download
Skip this Video
Download Presentation
Graphs, grouping, pie charts and other ‘ stuff ’ .

Loading in 2 Seconds...

play fullscreen
1 / 38

Graphs, grouping, pie charts and other ‘ stuff ’ . - PowerPoint PPT Presentation


  • 105 Views
  • Uploaded on

Graphs, grouping, pie charts and other ‘ stuff ’. Peter Fox GIS for Science ERTH 4750 (98271) Week 10, Tuesday, April 3, 2012. Contents (eek!). Dispersing points Creating points for intersections of lines Extracting latitude and longitude from a geocoded table

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Graphs, grouping, pie charts and other ‘ stuff ’ .' - amandla


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
graphs grouping pie charts and other stuff

Graphs, grouping, pie charts and other ‘stuff’.

Peter Fox

GIS for Science

ERTH 4750 (98271)

Week 10, Tuesday, April 3, 2012

contents eek
Contents (eek!)
  • Dispersing points
  • Creating points for intersections of lines
  • Extracting latitude and longitude from a geocoded table
  • Selecting data that are not geocoded
  • Web links
  • Adding tools
  • Pie charts on thematic map
  • Graphs
  • Editing attributes in tables
  • Manipulating objects within MapInfo
  • Graduated symbol maps
  • Bivariate thematic maps
pie charts sorry but they survive
Pie charts (sorry, but they survive)!
  • Pie chart of the ethnicity of the population for the New England States (table usa).
  • Open USA.TAB, select New England States with marquis select, save as new table (ne_states.tab).
  • Display NE states only, Create Thematic map, select Pie Charts > Next > Table = NE_states, select and Add from fields, pop_cauc, pop_black, pop_native, etc. > Next.
  • Click Styles > turn on Half Pies > OK > OK.
more thematic maps
More thematic maps
  • Bar charts to show the quarterly rainfall for the New England States.
  • Open ne_states and US_rain.
  • Select rain data points from NE states and write to separate table NE_rain.
  • NE_rain has monthly data so we need to put it into quarterly sums.
  • To do this add 4 columns to the table (Table > Maintenance > Table structure) and Update columns to hold quarterly sums.
more thematic maps1
More thematic maps
  • Create Thematic map, select Bar Chart > Next > select columns to plot > Next > OK.
  • But … because some states have multiple measurement sites we have to group them.
  • Query > SQL select > Columns = State,sum(q1),sum(q2),sum(q3),sum(q4) > Tables = NE_rain > Group by = state > into Table = ne_q.
  • Create Thematic map, select Bar Chart > Next > select columns to plot > Next > OK.
adding comparing
Adding/ comparing
  • Using a table of friends zipcodes (earlier exercise), add their ages and add 5 new friends (or class members) to the table.
  • Plot them on a map that distinguishes new friends from old and their ages.
  • Open friends table (NB save copy as new_friends).
  • Open new_friends, Table > Maintenance > Structure > Add field old_new as character (3) and age as Integer.
  • Open the table in Browser window and add new information. You can also edit the data via the Info tool.
slide10
and
  • To add or delete rows, go to Edit > New Row or Edit > Clear.
  • You’ll have to Geocode the data again.
  • To remove rows from the table Table > Maintenance > Pack Table > Save changes > read table in again.
creating attributes
Creating attributes
  • Make CL editable > put objects on map with tools > Map > Save CL objects and name the new table
  • Open new Browser window
  • Table > Maintenance > Table structure > add fields (add "area" column)
  • Table > Update column > Column = "area" > Value > Assist > Function > Area
  • Save table
modify graphic objects
Modify graphic objects
  • Make layer with objects editable (if you can’t do this, try saving table with a different name).
  • Select the object to be changed. Select Reshape icon or Edit > Reshape.
  • Click on the node to be moved.
  • Select multiple nodes in sequence with Shift-click (short-route) or Ctrl-click (long-route) and move them together.
  • Ctrl-click on same node twice will select all nodes.
modify graphic objects1
Modify graphic objects
  • If the object borders another and shares nodes, first go to Options > Preferences > Map window > click on Move duplicate nodes in the same layer.
  • If you don’t do this, you can open up gaps between objects or make them overlap.
  • Use add nodes icon to add nodes.
combining objects
Combining objects
  • Make table editable, Select objects to be combined, Objects > Combine, select how to combine object attributes.
splitting objects
Splitting objects
  • Objects must be split with another object which can either exist or be made on the cosmetic layer.
  • First, make splitting object if necessary.
  • Make CL editable, create polygon to be the "splitter", save to cut.tab (Map > Save Cosmetic objects).
  • Make target file editable, select the object to be split then Object > Set target, select the "splitter" object, then Objects > Split > OK.
  • Remove cut.tab from display.
graduated symbol maps
Graduated symbol maps.
  • Graduated symbol maps use symbol sizes to represent different values.
  • To make a graduated map of Japanese earthquakes where the earthquake magnitude is represented by symbol size: read tables ‘world’ and ‘japan_quakes’ > Map > Create TM > Graduated > Next > choose table = japan_quakes and field = mb > Next > Modify settings > OK.
bivariate thematic maps
Bivariate thematic maps
  • Bivariate maps are those that represent two attributes with a single symbol on the map. For example, we can represent earthquake depth with color and earthquake magnitude with symbol size.
  • To do this first create a TM of the earthquake depth using point ranges. Use 6 ranges and select equal count.
  • Then create a second TM using point ranges for the mb field.
bivariate thematic maps1
Bivariate thematic maps
  • Under step 3 of 3 click Styles > Options and under Autospread select Size.
  • Then under Apply choose size again.
  • The symbols should become hollow but of graduated size.
  • Click OK and the graduated size symbols draw over the color ranged symbols.
  • Deep Japan earthquakes.
mapbasic prelude
Mapbasic - prelude
  • MapBasic is a programming language for MapInfo that encompasses many direct calls to mapping and database functions.
  • It is used in one of two ways: either through Options > Show MapBasic window in MapInfo or through the MapBasic interface and compiler.
  • MapBasic Window
mapbasic compiler
Mapbasic compiler
  • MapBasic is a standalone program to develop programs that interface with MapInfo.
  • One can manipulate data and maps from within MapBasic programs.
  • E.g. a MapBasic program that performs the same function as that given above for the MapBasic Window looks like this:

declare sub main

sub main

open table "c:\mapinfo\data\world.tab" Interactive [replace with correct path]

map from world

select * from world where pop_1994> 10000000 into selection

browse * from selection

map from selection

end sub

slide22

The body of the program is identical to the MapBasic Window commands.

  • To run this program, start MapBasic, select File > New, paste the program into the editor window, select Project > Compile current file (or Ctrl-K), then select Project > Run (or Ctrl-U).
  • If MapInfo is not already running it will start and perform the tasks.
  • The result should be a map window showing only countries with > 10 million inhabitants.
mapbasic prelude1
Mapbasic - prelude
  • One can perform many of the MapInfo functions via the MapBasic window by entering command lines.
  • For example to open the world table and make a map of countries with greater than 10 million people, type in the MapBasic window:

open table "c:\mapinfo\data\world.tab" Interactive map from world

select * from world where pop_1994> 10000000 into selection

browse * from selection

map from selection

  • There are several functions available for MapBasic.
  • To view MapBasic functions, open the MapBasic window as you perform tasks with MapInfo\'s interactive screen.
dispersing points
Dispersing points
  • Sometimes when we geocode we get many points falling at the same coordinates.
  • This happens because the data are geocoded to the centroid of the entity, for example when we geocoded with zip codes.
  • For the purposes of the map, we can disperse the points to give the proper representation of the number of points.
  • To do this we can use the MapBasic window. Choose Options> Show MapBasic window to open the MapBasic window.
dispersing points ctd
Dispersing points (ctd)
  • Within the window type:

randomize

update selection set obj = createpoint(centroidx(obj) +.02*rnd(1), centroidy(obj)+.02*rnd(1))

  • This will randomly redistribute the points to the northeast within 0.02 degrees (or whatever the distance units are).
  • To randomly redistribute them about the current point, use:

update selection set obj = createpoint(centroidx(obj) +.02*(rnd(1)-.5), centroidy(obj)+.02*(rnd(1)-.5))

  • The table will be automatically updated and the new points will appear on the map. Make sure you save a copy of your original data.
creating points for intersections of lines
Creating points for intersections of lines
  • In some cases we might be interested only in the intersections of lines, for example street intersections. We can create a new table of points containing only the intersections.
  • Open the street file nyrensd. Make 2 copies of the nyrensd file and give each a unique name (File > Save copy as) such as str1 and str2. Open the 2 new files you have created.
  • Choose Query > SQL select. In the dialog box enter:
    • Select columns = str1.streetname + "&&" + str2.streetname
slide27
Then

From Tables = str1, str2

Where Condition = str1.obj Intersects str2.obj and str1.streetname <> str2.streetname

Into Table Named = Intersection

  • Save the Intersection table (File > save copy as).
lon lat from geocoded table
Lon/lat from geocoded table
  • You may want to see the latitude and longitude in your geocoded table.
  • There are 2 ways to do this depending on whether you want a new table or want to put the lat/lon in your original table.
  • To create a new table use Query > SQL select.
  • Under select columns, enter columns you want in the new table and then also put:
    • CentroidX(obj) "Longitude", CentroidY(obj) "Latitude"
slide29
And
  • To add the lat/lon to an existing table, select Table > Maintenance > Table structure and add 2 new columns to your table.
  • Call the Lat and Lon and make them ‘float’ types.
  • Then choose Table > Update column. Enter your table name under Table to update and Get value from Table.
  • Column to update should be your lat or lon and Value shoud be CentroidY(obj) for latitude and CentroidX(obj) for longitude.
selecting data that are not geocoded
Selecting data that are not geocoded
  • You may want to get a Browser list of points that did not geocode from a particular table.
  • Open the table and choose Query > Select. Under that Satisfy enter not obj.
  • This selects all the data records that are not objects, i.e., not geocoded.
  • Example: Geocode friends.xls with zip_codes and find those that do not geocode.
un geocoding tables or data
Un-geocoding tables or data
  • Un-geocoding means removing the objects from a Table.
  • You may want to do this if you are going to re-geocode using a better method or have better data to geocode with.
  • To un-geocode an entire table: select Table > Maintenance > Table structure.
  • Clear the Table is Mappable check box > OK > OK.
  • This is irreversible.
un geocoding tables or data1
Un-geocoding tables or data
  • To un-geocode selected objects: Plot the data in a map window.
  • Select the points you want to un-geocode.
  • Choose Layer control and set the layer to be editable.
  • Choose Edit > Clear Map objects only.
  • This un-geocodes the data but does not remove them from the table.
  • To undo choose Edit > Undo Deletion.
creating web links for maps
Creating web links for maps
  • WWW links can be incorporated into the maps using the HotLink button (the lightning bolt).
  • To create the links, add a column to your table through the Table > Maintenance > Structure option.
  • Make it a character string long enough to accommodate your longest URL.
  • Open the table in the Browser window and type in the URLs.
  • In Layer Control, click on the HotLink button.
creating web links for maps1
Creating web links for maps
  • Select the column containing the links in the FilenameExpression dropdown box and check the Save options to table metadata box to save URLs with table.
  • Don\'t forget File > Save table.
  • To activate the link on the map, click on the HotLink button (the lightning bolt) and then on the map object.
  • Example: Add http://www.states.AL.us to the states table for Alabama.
adding tools to mapinfo
Adding tools to MapInfo
  • Tools are external routines that can be called from the MapInfo interface.
    • They are accessed via the Tools menu.
  • A tool can be developed as a MapBasic program and its compiled form (.mbx file) is run from MapInfo.
  • To add a tool, select Tools > Tool Manager > Add Tool and fill out the location of the tool (the .mbx file) and a description.
    • The tool will run.
  • To run it later, select Tools, then find the tool and check Loaded.
  • Checking Autoload will cause it to run on Startup of MapInfo.
  • Example: Add the Xcel_2_tab tool.
summary
Summary
  • Topics for GIS (for Science)
    • Extras!
  • For learning purposes remember:
    • Demonstrate proficiency in using geospatial applications and tools (commercial and open-source).
    • Present verbally relational analysis and interpretation of a variety of spatial data on maps.
    • Demonstrate skill in applying database concepts to build and manipulate a spatial database, SQL, spatial queries, and integration of graphic and tabular data.
    • Demonstrate intermediate knowledge of geospatial analysis methods and their applications.
reading for this week
Reading for this week
  • MapInfo (10.8) User Guide
    • Chapter 5 Graphing your data
    • Chapter 7 Graphing and editing objects
    • Chapter 9 Pie charts, graduated symbols, etc.
  • Review the mini-exercises in these slides and work through them in MapInfo – if you have questions, ask on Friday
next classes
Next classes
  • Friday, April 6, Lab: …
  • Tuesday, April 10, Editing attributes, manipulating objects in MapInfo
  • Friday, April 13, Lab: geostatistics and some more maps
  • No class April 17 (Grand Marshall week)
ad