Emergency Hotline: Call 1-844-363-1423 (United We Dream Hotline)
ICE Encounter

Why QGIS?

Raw spatial data from government portals or FOIA releases rarely arrives web-ready. QGIS (Quantum GIS) is a powerful, free, open-source desktop application for:

  • Cleaning and validating data
  • Reprojecting coordinate systems
  • Performing spatial analysis
  • Exporting optimized web formats

Download: https://qgis.org


Data Import Workflows

Supported Formats

Format Extension Source
Shapefile .shp Census, NOAA
GeoJSON .geojson Web APIs
KML/KMZ .kml/.kmz Google Earth
CSV (with coords) .csv Spreadsheets
GeoPackage .gpkg Modern standard
File Geodatabase .gdb ArcGIS exports

Loading a Shapefile

  1. Layer → Add Layer → Add Vector Layer
  2. Browse to .shp file
  3. Select and click Add
  4. Check Layer Properties for CRS

Loading CSV with Coordinates

  1. Layer → Add Layer → Add Delimited Text Layer
  2. Configure:
    • X field: longitude column
    • Y field: latitude column
    • CRS: EPSG:4326 (WGS84)
  3. Click Add

Coordinate System Management

Understanding CRS

Term Meaning
GCS Geographic Coordinate System (degrees)
PCS Projected Coordinate System (meters/feet)
EPSG Standard code for CRS definitions

Common Systems

EPSG Name Use Case
4326 WGS84 Web display, GPS
3857 Web Mercator Web map tiles
5070 Albers Equal Area U.S. area calculations
32610-19 UTM zones Regional precision

Reprojecting Layers

  1. Right-click layer → Export → Save Features As
  2. Set CRS to target projection
  3. Or: Vector → Data Management → Reproject Layer

Critical: Always reproject to equal-area projection (like 5070) before calculating distances or buffers.


Geometry Operations

Buffering

Create zones around features:

  1. Vector → Geoprocessing Tools → Buffer
  2. Input layer: Select source
  3. Distance: Enter in layer units
  4. Segments: 25+ for smooth curves
  5. End cap: Round

Example: 100-mile zone = 160,934 meters

Clipping

Cut one layer to another's boundary:

  1. Vector → Geoprocessing Tools → Clip
  2. Input: Layer to clip
  3. Overlay: Boundary layer
  4. Output: Clipped result

Dissolving

Merge multiple features into one:

  1. Vector → Geoprocessing Tools → Dissolve
  2. Useful for combining county boundaries into state

Spatial Joins

Combine attributes from overlapping features:

  1. Vector → Data Management → Join Attributes by Location
  2. Select join type (intersects, within, etc.)
  3. Choose which attributes to keep

Simplification

Why Simplify?

Raw boundary files have millions of vertices that are unnecessary for web display.

Original Size Simplified Web Ready
50 MB 5 MB 500 KB

Douglas-Peucker Algorithm

  1. Vector → Geometry Tools → Simplify
  2. Set tolerance (in layer units):
    • National view: 1000-5000 meters
    • State view: 100-500 meters
    • County view: 10-50 meters
  3. Check "Preserve topology"

Balance Detail vs. Size

Tolerance Visual Impact
10m Imperceptible
100m Minor smoothing
1000m Visible simplification
5000m Significant generalization

Spatial Analysis

Point in Polygon

Determine which polygon contains each point:

  1. Vector → Data Management → Join Attributes by Location
  2. Input: Points layer
  3. Join: Polygon layer
  4. Predicate: "within"

Population Within Zone

  1. Join census blocks to zone polygon
  2. Sum population fields
  3. Export statistics

Hotspot Analysis

Identify clusters of enforcement activity:

  1. Processing → Toolbox → Heatmap
  2. Input: Incident points
  3. Radius: Search distance
  4. Output: Density raster

Attribute Editing

Field Calculator

Add or modify attributes:

  1. Open Attribute Table
  2. Toggle Editing Mode
  3. Open Field Calculator
  4. Create expressions:
# Concatenate fields
"facility_name" || ' - ' || "state"

# Conditional values
CASE
  WHEN "facility_type" = 'SPC' THEN 'Federal'
  WHEN "facility_type" = 'CDF' THEN 'Private'
  ELSE 'Local'
END

# Calculate area (in projected CRS)
$area / 1000000  -- Square kilometers

Batch Editing

For bulk attribute changes:

  1. Select features (attribute table or map)
  2. Open Field Calculator
  3. Check "Update existing field"
  4. Apply expression

Export for Web

GeoJSON Export

  1. Right-click layer → Export → Save Features As
  2. Format: GeoJSON
  3. CRS: EPSG:4326 (required for web)
  4. Coordinate precision: 5 decimals (sufficient for most uses)
  5. Check "RFC 7946" for strict compliance

TopoJSON Conversion

For additional size reduction:

# Install topojson CLI
npm install -g topojson

# Convert GeoJSON to TopoJSON
geo2topo features=input.geojson > output.topojson

# Simplify further
toposimplify -p 0.01 output.topojson > simplified.topojson

Vector Tiles (MVT)

For MapLibre GL JS with massive datasets:

  1. Processing → Toolbox → Generate XYZ tiles (MBTiles)
  2. Or use tippecanoe CLI:
tippecanoe -o output.mbtiles \
  --minimum-zoom=0 \
  --maximum-zoom=14 \
  input.geojson

Automation with Python

PyQGIS Script

from qgis.core import (
    QgsVectorLayer,
    QgsProject,
    QgsCoordinateReferenceSystem,
    QgsCoordinateTransform
)
import processing

# Load layer
layer = QgsVectorLayer('/data/facilities.shp', 'facilities', 'ogr')

# Reproject
parameters = {
    'INPUT': layer,
    'TARGET_CRS': 'EPSG:5070',
    'OUTPUT': '/data/facilities_5070.shp'
}
processing.run('native:reprojectlayer', parameters)

# Buffer
parameters = {
    'INPUT': '/data/facilities_5070.shp',
    'DISTANCE': 160934,  # 100 miles in meters
    'OUTPUT': '/data/facilities_buffer.shp'
}
processing.run('native:buffer', parameters)

Batch Processing

Process multiple files:

import os
import processing

input_dir = '/data/raw/'
output_dir = '/data/processed/'

for filename in os.listdir(input_dir):
    if filename.endswith('.shp'):
        input_path = os.path.join(input_dir, filename)
        output_path = os.path.join(output_dir, filename.replace('.shp', '.geojson'))

        processing.run('native:reprojectlayer', {
            'INPUT': input_path,
            'TARGET_CRS': 'EPSG:4326',
            'OUTPUT': output_path
        })

Data Validation

Check Geometry Validity

  1. Vector → Geometry Tools → Check Validity
  2. Fix invalid geometries:
    • Vector → Geometry Tools → Fix Geometries

Remove Duplicates

  1. Vector → Data Management → Delete Duplicate Geometries

Attribute Validation

# In Field Calculator - flag missing data
CASE
  WHEN "facility_name" IS NULL THEN 'MISSING NAME'
  WHEN "latitude" IS NULL THEN 'MISSING COORDS'
  ELSE 'OK'
END

Project Organization

Layer Naming Convention

facility_points_original
facility_points_5070
facility_points_simplified
facility_points_web

Save as GeoPackage

For portable, self-contained projects:

  1. Layer → Save As
  2. Format: GeoPackage
  3. Add multiple layers to single file

Related Resources