Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase performance by reducing GeoJSON dataset size #179

Merged
merged 4 commits into from
Jan 21, 2024

Conversation

perfectly-preserved-pie
Copy link
Owner

This PR introduces optimizations to the GeoJSON data processing in the geojson_processing_utils.py file. The changes include:

  • Filtering GeoJSON features: The optimize_geojson function has been updated to only keep features that are in Los Angeles County. This is done by checking the CountyName property of each feature.
  • Optimizing GeoJSON properties: The optimize_geojson function has also been updated to only keep specified fields in the properties of each feature. This is done by creating a new dictionary for the properties of each feature that only includes the specified fields as defined by the popup JavaScript.

Together I've reduced the file size from about 22MB to ~6MB, a roughly 73% decrease. Siiiiick

- Modified `load_geojson_data` to be a class method in `BaseClass`.
- Adjusted calls to `load_geojson_data` in `LeaseComponents` and `BuyComponents` to ensure proper usage.
- Resolved TypeError in `BuyComponents` related to incorrect method call.
- Implemented lazy loading for oil well GeoJSON data to enhance performance.
@perfectly-preserved-pie perfectly-preserved-pie added the fix Fixing an issue or problem label Jan 21, 2024
@perfectly-preserved-pie perfectly-preserved-pie linked an issue Jan 21, 2024 that may be closed by this pull request
@perfectly-preserved-pie perfectly-preserved-pie merged commit 5736b08 into master Jan 21, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixing an issue or problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow loading after implementing oil well locations
1 participant