Skip to content

Commit

Permalink
Optimize GeoJSON data further by filtering features for Los Angeles C…
Browse files Browse the repository at this point in the history
…ounty only
  • Loading branch information
perfectly-preserved-pie committed Jan 21, 2024
1 parent f24c9ea commit 42ca232
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion functions/geojson_processing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ def optimize_geojson(data: Dict, fields_to_keep: List[str]) -> Dict:
Returns:
Dict: The optimized GeoJSON data.
"""
# Process each feature in the GeoJSON
# Keep only the features in Los Angeles County
data['features'] = [feature for feature in data['features'] if feature['properties'].get('CountyName') == 'Los Angeles']

# Now process each remaining feature in the GeoJSON
for feature in data['features']:
properties: Dict = feature['properties']
# Keep only the required fields
Expand Down

0 comments on commit 42ca232

Please sign in to comment.