-
Notifications
You must be signed in to change notification settings - Fork 2
Geographies in Profiles
All data in the Community Profiles (CP) app relates to a place on a map. There are 3 Key components to understand about the geographic data stored in the application.
A "Geo Level" defines a level of geography. For Ex: County Subdivision, Neighborhood. Every Geographic Record in CP is assigned a GeoLevel. For Example "Providence County" would have a GeoLevel of "County". A GeoLevel can represent any group of geographies.
- Name
- Display Name (overrides Name Field when the Level name is displayed)
- Summary Level -- Profiles tries to follow the census convention of assigning a Summary Level a geographic level. While any census defined levels may actually have a summary level (Ex: State - 40), non-standard levels can be assigned a level > 1000 (See https://github.com/ProvidencePlan/Profiles/blob/master/communityprofiles/census/tools/geography.py for a complete list of geography levels) Profiles uses this number to identify relationships between levels.
- Shapefile -- A Shapefile that contains features that can be linked to GeoRecords at this GeoLevel
A "Geo Record" defines a place on a map. All data in profiles relates to a specific GeoRecord.
- Level -- Which level of geography this Geo Record belongs to.
- Name -- The Name of a Geography
- Custom Name -- A Custom Name to be displayed in the application instead of Name
- GeoId -- A linkable identifier for this record. Profiles uses this id to link geographies to various parts of the application. If the Geography comes for the US Census, please use the provided GEOID. Otherwise it an be an arbitrary ID that can be linked to a Shapefile feature or to a CSV datasource.
- GeoId Segments --- ex: {"050": "125", "040": "42"} a valid JSON representation of how this GeoId can be broken down. In the example the Geography id is, 42125, where 42 is the State id and 125 is the County.
Profiles comes with a tool capable of importing Census Geography Files. These files come straight from www2.census.gov and are bundled with each state's data. These files are in ASCII format.
The tool can be found as a management command and requires knowledge of the Django management command system. Please see ./manage.py load_geographies --help for more info. This tool will create a GeoRecord for each geography it finds, based on the SUMMARY_LEVELS setting defined in the local_settings.py file.
GeoRecords can also be entered manually via the admin.
You may notice that a Geography (Geo Record) may appear more than once in the Profiles Admin.
You may see this Ex:
Washington city County Subdivision: 2000```
This is because Geographies may change from year to year. Though it doesn't happen often, GeoIDs may change or a tract may split. For example: In the year 2000, Tract 101 may exist. In 2010 Tract 101 may have split and become Tract 101.01 & Tract 101.02.
Profiles currently requires a GeoRecord for each year in which this Geography may exist.
## Uploading Shapefiles
Shapefiles are used in Profiles in various ways. All maps display Shapefile Features that are linked by the GeoId in a GeoRecord. Geo-spatial Queries are used to determine what geographies contain other geographies. Ex: What neighborhoods are in Allegheny County? Any Neighborhood polygons that lay inside the Allegheny Polygon will be returned as results.
### Format
* Shapefiles must be uploaded in zip format with all necessary components.(.shp, .prj, .dbf, etc...) The components are the files that usually get generated when using a program like ArcMap.
* Shapefiles must be projected as WGS84. If for some reason shapes arent linking or showing up on the map, make sure your projection is correct. Profiles will try to prevent a user from uploading non WGS84 shapefiles but as of now, there is no guarantee that it will catch the mistake.
* After a Shapefile is uploaded, select the Shapefile from the dropdown in the GeoLevel Edit screen and click Save.