for more information
Columbus, OH ZIPs
Pocatello, ID Tracts
Peoria, AZ Tracts
-- software for converting shapefiles to polyline XML files
The Google API enables users to develop their own Web-based maps. Most users immediately want to add their own data to the map views. Often the needed, additional geographic data already exist in the form of shapefiles. Examples of the shapefiles are streams, other hydrology, specific sets of roads and streets, and wide ranging geographic boundaries for census tracts, ZIP code areas, school districts, and other territories. If the shapefiles could be converted to polyline XML file, then these geographies could be added to the map view developed using the Google API. This capability is provided by the Proximity Shp2Xml. The Google-based map at the right shows census tract boundaries in red, added to the map using a polyline XML file created with Shp2Xml. In this example, as further described below, the user can click on a marker to access demographic profiles for any tract.
Shp2Xml has been developed primarily to meet the need for a way to convert shapefiles to polyline XML files for use with Google API applications. Use polyline XML files generated to create views like those available in MetroView.
Click here to purchase:
Alexandria, VA Roads Shapefile Converted to Polyline XML. The following view shows a display of the Alexandria, VA streets/roads shapefile in the map view window. The Shp2Xml button is clicked and the XML file, displayed in the panel at right, is created.
Google maps display roads, but a situation might arise where it is desirable to display certain roads in the Google map. In the above view, the Criteria statement has been used to include only road segments having a CFCC (Census Feature Class Code) 'LIKE 'A1%' (Interstate highways and equivalent). It could also be used to select only street segments with certain names, or in certain ZIP codes.
Map Navigation and Control Buttons. As shown in the left panel in the following graphic, map navigation buttons include zoom, select/identify, and pan/drag. The buttons further to the right are Add layer and Delete layer. Add a layer to view two or more map layers together. Delete a layer to remove a layer that have been added.
The select/identify tool is used to click on a line segment and a pop-up profile appears. The profile shows that this line segment is the 100 block of King Street.
Alexandria, VA Census Tracts Shapefile Converted to Polyline XML. The following view shows a display of the Alexandria, VA census tracts shapefile in the map view window. The Shp2Xml button is clicked and the XML file, displayed in the panel at right, is created.
The map window may be closed and the XML view window expanded by clicking Tools>Show Map View. This operation toggles the map window view on/off. In the next view of the XML file, the field named 'TRACTID' was selected for the 'name' field and the field named 'TRT2000' was selected for the 'code' field. As described later in this section, use of the code field enables the Web page showing the Google map to display demographic profiles of any select census tract. The demographic profile display is an operation that is independent of the Google API, but made easier with Google markers.
Using TIGER/Line Files
The census tract shapefile used in the above application was created by an earlier operation. A census tract shapefile can be created by Shp2Xml using TIGER/Line files. If starting with a TIGER/Line file (TLF), download the TIGER/Line file. Next, use File>Open to open the TLF (open the tgrssccc.rt1 file). Next use the File>Export Layer to convert the TLF to a shapefile. The Export Layer panel, shown at the right, appears.
The query statement is an SQL-type statement that restricts the scope of the shapefile to be created. In this example, the Census Feature Class Code (CFCC) is used to only allow segments where the tract code is different on each side of the segment. The scope of the shapefile to be created can also be restricted by using the radiobuttons.
After the settings are made in the panel, click OK and then enter the filename for the shapefile to be saved in a save dialog that follows.
Operations: Adding Alexandria, VA Census Tracts to a Google View
Use File>Open to open m51510t.shp, Alexandria, VA by census tract.
(included with the Shp2Xml setup)
Settings in the left panel.
-- the name of the shapefile or TLF name is shown in 'Input Shapefile' box.
(automatically loaded with File>Open file name)
-- optionally add a Criteria statement if processing of the input file is to be restricted.
-- specify output file name for the new XML file.
-- select a color for the polyline (coded as variable 'color' in XML file).
-- select a 'field' name in the input file (coded as the variable 'name' in the XML file).
-- select a 'code' name in the input file (coded as the variable 'code' in the XML file).
(this would be the geocode used to access demographics for a polygon area)
-- click checkbox if input file is a Census sourced census tract boundary file.
(this is required is the geocode is used to access demographics.)
Click the Shp2Xml button and the file is converted.
Using the XML File. The xml file, m51510t.xml, is referenced in the html file galextracts.htm.
The files are moved to a Web accessible location and a browser is used to open http://proximityone.com/galextracts.htm.
Click an icon to view a census tract profile. Four Web links are shown, providing access to detailed demographics for the census tract.
Click on one of 4 links to access a demographic profile for the tract. In this example, the Social Characteristics profile is selected, shown in part below.
Usage Considerations. Shp2Xml will generate a polyline XML file for any size shapefile. However, polyline XML files that can be directly processed by the Google API must be relatively small. More then 5,000 lines can produce significant performance degradation. There are workarounds available to load larger polyline files.