To load parcel GeoJSON, I check the file first, then use the import format each tool expects. I keep parcel IDs as text and confirm that coordinates use longitude first, latitude second.
Here’s the path I use for each tool:
- QGIS: Open the file as a vector layer, inspect its attributes, and check polygon validity.
- PostGIS: Import with
ogr2ogr, check row counts and geometry, then add a GiST index for spatial queries. - BigQuery: Load one GeoJSON Feature per line, or stage geometry strings and parse them into
GEOGRAPHY.
Before analysis, I check missing IDs, duplicate records, and failed geometry conversions. My rule: <u>a successful import is not the same as checked data</u>. Parcel outlines are reference shapes, not legal surveys, and I keep calculated areas separate from supplied square-footage fields.
Parcel GeoJSON Import Workflow: QGIS, PostGIS & BigQuery
Load Parcel GeoJSON into QGIS
Add a File or Remote Source
Use QGIS to check parcel boundaries GeoJSON for geometry and attribute issues before analysis or database import.
Open Layer → Add Layer → Add Vector Layer. Add a local GeoJSON file or paste a GeoJSON URL as the vector source. Then check the parcel ID field in the attribute table and inspect the geometry on the map.
Check Geometry and Save Your Work
In Layer Properties, check the geometry type and source CRS. Run Check Validity to find self-intersections and invalid polygons.
Right-click the checked layer and select Export → Save Features As to make a working copy. For a standard GeoJSON export, choose GeoJSON and EPSG:4326.
A valid, saved layer is ready for import into PostGIS or BigQuery.
Fix QGIS Loading Errors
If the layer looks wrong, start with the symptom.
| Symptom | Likely cause | Fix |
|---|---|---|
| Invisible layer | Outside the map extent or hidden under another layer | Right-click the layer and select Zoom to Layer, then move the parcel layer above other layers. |
| Misplaced parcels | Incorrect source CRS or reversed longitude/latitude | Check the source CRS and coordinate order before reassigning the CRS. |
| Invalid geometry | Self-intersections or malformed polygons | Run Fix Geometries, then inspect the repaired layer. |
| Missing or mistyped attributes | Missing attribute table or broken join | Check source fields and join keys. If needed, join a separate assessor table using APN or Parcel ID. |
Assign EPSG:4326 only if the layer is already WGS 84 and its CRS label is wrong or missing. Reassigning the CRS won't fix reversed longitude/latitude.
QGIS Tutorial: Adding and Viewing GeoJSON in QGIS [EN]
Import Parcel GeoJSON into PostGIS
After checking the GeoJSON in QGIS, load it into PostGIS for repeatable storage and spatial indexing. PostGIS lets you index parcel boundaries from GeoJSON for spatial queries and joins.
Enable PostGIS and Import with ogr2ogr
Connect to the database and enable PostGIS. Use a service file or environment variable rather than putting a password in the command.
psql "service=parcel_db" -c "CREATE EXTENSION IF NOT EXISTS postgis;"
ogr2ogr loads GeoJSON directly into PostGIS. GEOMETRY_NAME sets the geometry column name, FID sets the primary key, and PROMOTE_TO_MULTI accepts both Polygon and MultiPolygon inputs.
ogr2ogr -f PostgreSQL "PG:service=parcel_db" \ parcels.geojson parcels \ -nln parcels.boundaries \ -lco GEOMETRY_NAME=geom \ -lco FID=gid \ -nlt PROMOTE_TO_MULTI
Use -t_srs only to transform the CRS. Use -overwrite to replace a test table or -append to add rows.
Validate the Import and Index Geometry
Compare the source and imported row counts. Then check geometry types, SRIDs, nulls, and validity. Create a GiST index and run ANALYZE after the import.
SELECT count(*) AS rows_loaded, count(*) FILTER (WHERE geom IS NULL) AS null_geometries, count(*) FILTER (WHERE NOT ST_IsValid(geom)) AS invalid_geometries FROM parcels.boundaries; SELECT ST_GeometryType(geom), ST_SRID(geom), count(*) FROM parcels.boundaries GROUP BY 1, 2; CREATE INDEX boundaries_geom_gix ON parcels.boundaries USING GIST (geom); ANALYZE parcels.boundaries; -- Find parcels intersecting your area of interest. SELECT gid FROM parcels.boundaries WHERE ST_Intersects(geom, <your_query_geometry>);
Once the table passes validation, use SQL to filter parcels, intersect areas of interest, and join assessor attributes.
ST_Intersects can use the GiST index to narrow the candidates before testing intersections. For distance calculations, use geometry in a suitable projected CRS or cast to geography for geodesic measurements.
Verify the Import in QGIS
Use QGIS for visual checks and ogr2ogr for repeatable loads. In the QGIS Browser panel, connect to the imported PostGIS table - not the source file. Check the geometry after ingestion, and run the same validation SQL in DB Manager.
Load Parcel GeoJSON into BigQuery
Use BigQuery to parse data in your warehouse and validate it with SQL after loading. Choose between two load paths: direct newline-delimited GeoJSON or staged geometry parsing. Both produce a table you can filter, join, and check with SQL.
Load Newline-Delimited GeoJSON Features
Convert the FeatureCollection to one Feature per line. Define top-level columns for each property, keep parcel identifiers as STRING, and include only the attributes you need.
jq -c '.features[]' parcels.geojson > parcels.jsonl bq load \ --source_format=NEWLINE_DELIMITED_JSON \ --json_extension=GEOJSON \ parcels.boundaries \ parcels.jsonl \ parcel_id:STRING,geometry:GEOGRAPHY
For files larger than 1 GB, upload to Cloud Storage first, then load from the gs:// URI. Review the schema instead of relying on autodetection.
Parse Geometry Strings as GEOGRAPHY
Use staging when direct GeoJSON loading rejects malformed rows. Keep failed rows so you can inspect and fix them before loading the clean table.
Extract only the geometry fragment, not the whole Feature, into a string column. Put any parcel attributes you need in separate columns. Then load the file as standard newline-delimited JSON without the GEOJSON extension.
jq -c '.features[] | { parcel_id: .properties.parcel_id, geometry_json: ( if .geometry == null then null else (.geometry | tojson) end ) }' parcels.geojson > parcels_staging.jsonl bq load \ --source_format=NEWLINE_DELIMITED_JSON \ parcels.staging \ parcels_staging.jsonl \ parcel_id:STRING,geometry_json:STRING
CREATE OR REPLACE TABLE parcels.parsed AS SELECT parcel_id, geometry_json, SAFE.ST_GEOGFROMGEOJSON(geometry_json) AS geometry FROM parcels.staging; -- Retain and inspect failed conversions. SELECT parcel_id, geometry_json FROM parcels.parsed WHERE geometry_json IS NOT NULL AND geometry IS NULL;
Check BigQuery Data and Fix Errors
Compare the loaded columns with the source file. Check for null geometries and missing IDs, and keep parsing failures visible. Review any repairs before saving the final table for spatial queries.
SELECT COUNT(*) AS rows_loaded, COUNTIF(geometry IS NULL) AS null_geometries, COUNTIF(parcel_id IS NULL OR parcel_id = '') AS missing_ids, COUNT(DISTINCT parcel_id) AS distinct_ids FROM parcels.boundaries; SELECT ST_GEOMETRYTYPE(geometry) AS geometry_type, COUNT(*) AS rows FROM parcels.boundaries GROUP BY 1; SELECT column_name, data_type FROM parcels.INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'boundaries';
| Issue | Fix |
|---|---|
| Whole-document parsing error | Direct loading needs one Feature per line; ST_GEOGFROMGEOJSON needs only a geometry fragment. |
Geometry remains STRING |
Use the GeoJSON extension with an explicit GEOGRAPHY schema, or parse the staging string. |
| Invalid geometry or null result | Inspect the retained source. Test SAFE.ST_GEOGFROMGEOJSON(geometry_json, make_valid => TRUE) separately and review any changed outlines. |
| Missing or mistyped attributes | Match schema columns to property names. If numeric conversion removed leading zeros, reload identifiers from the source as STRING. |
Conclusion: Check Parcels Before Analysis
After loading, run a small validation pass before starting full analysis. Use QGIS to inspect and repair geometry, PostGIS for indexed spatial queries, and BigQuery for warehouse analysis. Reconcile counts by source jurisdiction, investigate duplicate APNs within each county, and resolve missing attributes or invalid geometry.
Test area calculations, bounding-box filters, point-in-polygon checks, and intersections on a small sample. Make sure repaired geometries remain POLYGON or MULTIPOLYGON. Watch for stacked condominium footprints, which can inflate spatial-join counts.
Once those checks pass, keep calculated area separate from supplied area fields. Preserve original identifiers as strings, along with jurisdiction codes, source attributes, and split/merge IDs, so you can trace joins back to their sources. Use BatchData Parcel Boundaries - parcel outlines, area in square feet, bounding boxes, and center points - as analytical reference data, not legal surveys.
FAQs
How can I update parcel boundaries without creating duplicates?
Use a persistent identifier, such as the Assessor’s Parcel Number (APN) combined with the county FIPS code, as your primary key. This lets you match incoming data to existing records.
Keep historical data rather than overwriting it. Track each boundary’s version number, effective date, and validation timestamp, and archive older records. This preserves an audit trail of boundary changes for compliance or dispute resolution.
How do I handle parcels with multiple owners or tax records?
For properties that span multiple tax lots or have multiple associated records, include return_stacked in your API request to get all related records, including those with overlapping or identical geometries.
If your assessor tables are separate, use the Assessor’s Parcel Number (APN) as the shared key to join parcel polygons to owner or mailing address records.
Why do parcel areas differ across QGIS, PostGIS, and BigQuery?
Parcel areas often differ because platforms calculate area in different ways. BigQuery uses tessellation to convert GeoJSON’s planar edges into spherical edges, accounting for Earth’s curvature. QGIS and PostGIS may use planar or geodetic coordinate systems, which can lead to different area measurements.
Simplified parcel outlines add another source of variation. Areas calculated from these outlines are approximations, so results can differ further across systems.