Geometric Modeling, Spring 2001
Homework 2 (Due: Feb 22, 2001)

How to hand in your solution: please email me a "jar file" containing the following files:

  • (1) README file with instructions,
  • (2) Makefile for automatic compilation and testing, I should be able to type "make test" to run your program!
  • (3) The .java files, and
  • (4) Some input data files for automatic testing


    ADDITIONAL INFORMATION SINCE THE ORIGINAL POSTING OF THIS HOMEWORK:

  • Tiger State and County Code: courtesy of Zilin Du.


    In this homework, we address the following issues: understanding a real GIS data format (TIGER), data conversion, and planar subdivisions. As usual, do not go to the next step until you finish the previous step.

    STEP 1:

    There is nothing to do for this part: we just want you to understand the important TIGER format for encoding plane subdivisions. TIGER stands to Topologically Integrated Geographic Encoding and Referencing System, and is from the U.S. Bureau of the Census and for more information, we recommend going to the TIGER homepage. Here is a useful summary by Ken Been. See also our lectures for a supplement to these notes. For your convenience, we have downloaded the TIGER files for the 5 boroughs of New York City.
    NOTE: Our visualization project has a map server demo based on the TIGER data set.
    Here are the Tiger files and the corresponding fields that are useful for this homework:
    Record Type Field Name Field Position Description
    RT 1
    (Basic info
    for Lines)
    TLID 6-15 TIGER/Line ID
    SIDE1 16 Single side? (blank = both sides, 1 = single side)
    FRLONG 191-200 Start (from) longtitude
    FRLAT 201-209 Start (from) latitude
    TOLONG 210-219 End (to) longtitude
    TOLAT 220-228 End (to) latitude
    RT 2
    (Detail points
    for Lines)
    TLID 16-25 TIGER/Line ID (not all lines have an entry here
    RTSQ 16-18 Record Sequence Number (1, 2, etc)
    LONG1 19-28 Start (from) longtitude of point 1
    LAT1 29-37 Start (from) latitude of point 1
    LONG2 28-37 Start (from) longtitude of point 2
    LAT2 etc etc
    RT A
    (Basic info
    for Polygons)
    POLYID 16-25 Polygon ID
    RT I
    (Line-Polygon
    info)
    TLID 6-15 TIGER/Line ID
    POLYIDL 27-36 Polygon ID on the left side
    POLYIDR 42-51 Polygon ID on the right side
    RT P
    (More info
    on Polygons)
    POLYID 16-25 Polygon ID
    POLYLONG 26-35 Internal Point Longtitude
    POLYLAT 36-44 Internal Point Latitude

    STEP 2:

    Write a Java program which, given a directory containing the Tiger Files for a county, and also a rectangle range (in terms of longtitute/latitude), extracts all the Tiger Lines and Tiger Polygons that intersects this rectangle from the county. Then displays it.
    You just draw the Tiger lines, but the polygons must be colored blue for water, green for parks, and yellow for everything else. You can get more fancy if you wish. To know the type of each polygon, the following additional records and fields are useful:
    Record Type Field Name Field Position Description
    RT 7
    (Landmark
    features)
    LAND 11-20 Landmark ID
    CFCC 22-24 Census Feature Class Code
    (H??=water, D??=park, E??=marsh)
    LANAME 25-54 Landmark name
    RT 8
    (Area Landmarks--
    Polygon Link)
    POLYID 16-25 Polygon ID
    LAND 26-35 Landmark ID
    RT S
    (More Polygon
    Geographic
    Entity Codes)
    POLYID 16-25 Polygon ID
    WATER 26 Water Flag
    EXTRA CREDIT. Write a Java program which, given a county directory (as above), will extracts its minimum bounding rectangle (in terms of longtitute/latitude), and the county name.

    STEP 3:

    Write a Java program which given the same input as STEP 2, extracts all the Tiger Lines and Polygons, and constructs a half-edge data structure. Then it writes this data structure out in a file in some file format. Also provide a reading function that can read this file format (i.e., reconstruct the half-edge structure) back to the main memory very quickly (in linear line).
    PLEASE design a human readable format, and describe it clearly in English before implementation (you should hand in this description). In particular, human readable means it must allow comment lines (JUST as in homework 1). Your programs should freely generate comments in the files. If you want to discuss your design with me, please feel free.