Skip to content

[PULL REQUEST] add in military employment#245

Open
bryce-sandag wants to merge 2 commits into
mainfrom
add-military-employment
Open

[PULL REQUEST] add in military employment#245
bryce-sandag wants to merge 2 commits into
mainfrom
add-military-employment

Conversation

@bryce-sandag
Copy link
Copy Markdown
Contributor

Please title Pull Request with prefix [PULL REQUEST]

Describe this pull request. What changes are being made?

Add in the military job counts to the employment estimates module as 'MIL' sector in industry_code

What issues does this pull request address?

close #242

Additional context

Work was done to site military active duty employment from 2010-2025 and want to use this effort to add military employment to employment estimates

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds military active duty employment into the Employment estimates workflow so it is output as its own sector (industry_code = 'MIL') at the MGRA level and included in regional control totals.

Changes:

  • Introduces a new SQL extract to allocate military active duty job counts to MGRA polygons.
  • Extends the employment input pipeline to ingest military MGRA jobs, add a military control total, and include military jobs in the controlled MGRA-by-industry output.
  • Updates the expected distinct industry_code count in the integration test constants to account for the new MIL sector.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
sql/employment/get_military_employment.sql New query to spatially join military active duty employment to MGRAs and return MGRA-level job counts under industry_code = 'MIL'.
python/employment.py Loads the new military query output, appends its regional total into control_totals, validates the new input, and includes military jobs in the MGRA jobs dataset.
python/tests.py Updates distinct-count expectations for industry_code to include the new MIL category.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sql/employment/get_military_employment.sql
Comment thread sql/employment/get_military_employment.sql
Comment thread sql/employment/get_military_employment.sql Outdated
Comment thread python/employment.py
@bryce-sandag
Copy link
Copy Markdown
Contributor Author

There is run in production database for run_id = 199

Copy link
Copy Markdown
Contributor

@Eric-Liu-SANDAG Eric-Liu-SANDAG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at any code yet, just at the output data of [run_id] = 199. A few points I hope you can address before I review any further:

  • Does military employment include recruitment? From Google Maps, I see a lot of military recruitment buildings which do not have associated military employment
  • Why does military employment not cover the whole base? For example, in Coronado, only some of the MGRAs have military employment when I would expect for all MGRAs:
Image - Pretty much all military bases are captured. Please double check: - March FFS - Oceanside coast guard office?

@bryce-sandag
Copy link
Copy Markdown
Contributor Author

I haven't looked at any code yet, just at the output data of [run_id] = 199. A few points I hope you can address before I review any further:

  • Does military employment include recruitment? From Google Maps, I see a lot of military recruitment buildings which do not have associated military employment

No, military reports it by major base installations.

  • Why does military employment not cover the whole base? For example, in Coronado, only some of the MGRAs have military employment when I would expect for all MGRAs:

Try to assign them to MGRAs that have the most buildings or group of buildings. Coronado is the only one you could possibly add a couple extra points to incorporate 1 or 2 extra MGRAs (3745 and 5556) but they are more the outskirts of the base on Coronado Island and think it would be fine to add or leave as is. @GregorSchroeder maybe worth your review if it worth to add 1-2 extra points to incorporate those 2 MGRAs

  • Pretty much all military bases are captured. Please double check: - March FFS - Oceanside coast guard office?

This is fine as office looks small and probably actually report within Camp Pendleton. There has been issue with how coast guard count have been historically reported. We currently locate all coast guard jobs to the location close to the airport as this is the main and biggest Coast guard location in San Diego

@Eric-Liu-SANDAG
Copy link
Copy Markdown
Contributor

I haven't looked at any code yet, just at the output data of [run_id] = 199. A few points I hope you can address before I review any further:

  • Does military employment include recruitment? From Google Maps, I see a lot of military recruitment buildings which do not have associated military employment

No, military reports it by major base installations.

Hmm, but should we be including recruitment in military employment? Is the only reason we don't include it because the military report doesn't? Is recruitment already captured by some employment sector?

@bryce-sandag
Copy link
Copy Markdown
Contributor Author

I haven't looked at any code yet, just at the output data of [run_id] = 199. A few points I hope you can address before I review any further:

  • Does military employment include recruitment? From Google Maps, I see a lot of military recruitment buildings which do not have associated military employment

No, military reports it by major base installations.

Hmm, but should we be including recruitment in military employment? Is the only reason we don't include it because the military report doesn't? Is recruitment already captured by some employment sector?

We are just capturing active duty military which is publicly reported. These reports are done by base installations and locations. We sited only locations within those know base locations. This is the most defensible to SANDAG and don't think we should be siting active duty military outside of those locations to possibly capture recruitment, which would probably involve very minimal counts anyways. If these recruiting jobs are done by non active duty or civilians then they would possibly be captured in other data sets like the LEHD LODES data which is used to capture all other employment, excluding self employment and military

@Eric-Liu-SANDAG
Copy link
Copy Markdown
Contributor

Can you do a little more investigation on this topic? Either confirm that:

  1. Recruitment is done by active duty military, and the military report we use intentionally sites this employment on base instead of at the recruitment facility
  2. Or recruitment is not done by active duty military, which means the employment is captured by LEHD LODES and it represented in our employment data in some other sector

@bryce-sandag
Copy link
Copy Markdown
Contributor Author

Can you do a little more investigation on this topic? Either confirm that:

  1. Recruitment is done by active duty military, and the military report we use intentionally sites this employment on base instead of at the recruitment facility
  2. Or recruitment is not done by active duty military, which means the employment is captured by LEHD LODES and it represented in our employment data in some other sector

From some research it looks recruiting is mainly done by active duty members and the military reports we use intentionally sites this employment on base instead of at a recruitment facility. Here are two separate sources source 1 source 2

@gracechung
Copy link
Copy Markdown

  • Why does military employment not cover the whole base? For example, in Coronado, only some of the MGRAs have military employment when I would expect for all MGRAs:

Try to assign them to MGRAs that have the most buildings or group of buildings. Coronado is the only one you could possibly add a couple extra points to incorporate 1 or 2 extra MGRAs (3745 and 5556) but they are more the outskirts of the base on Coronado Island and think it would be fine to add or leave as is. @GregorSchroeder maybe worth your review if it worth to add 1-2 extra points to incorporate those 2 MGRAs

I agree with Bryce’s point that we are trying to assign them to the MGRAs that contain the most buildings or clusters of buildings. Think of these as the travel‑destination MGRAs. The outer areas of the North Island MGRAs house testing sites and bomb storage facilities, not offices. Imagine a pilot arriving at North Island in the morning, he or she drives in, parks near one of the offices, reports for duty, and then walks or takes another vehicle to the jet. We count the office as the employment location, not the location of the jet.

I think what we are missing is MGRA 9161. Based on the imagery, there appear to be office buildings there. I am adding a point and splitting the share from MGRA 7514. @bryce-sandag please review the gdb and update.

Overall, the goal of these MGRA assignments is to understand where the offices and active‑duty employment locations are, despite the lack of building‑level employment counts. For large military installations with multiple MGRAs, we do not want to distribute employment evenly across all of them, we used to do that, prior to SR 13, and the results didn’t look right. Instead, in the absence of detailed building‑level information, we estimate the employment share for the MGRAs that contain offices or other relevant buildings.

A good way to illustrate this is through mapping. When creating a dot density employment map using mgra, we want the employment clusters to appear in the portions of the base where the offices are, not scattered uniformly across the whole installation. At the same time, it’s important to understand that this is not building level accuracy, just a more reasonable approximation of where employment activity is concentrated.

Please keep in mind that we want to focus our efforts on the MGRAs that clearly contain clusters of activity or meaningful office, or employment uses. If we begin including every MGRA with just a small office or two, we will then need to estimate additional employment shares for all those areas, which introduces more uncertainty. Our goal is to keep the assumptions reasonable and avoid pushing the process into too much guesswork.

@bryce-sandag
Copy link
Copy Markdown
Contributor Author

bryce-sandag commented May 26, 2026

new test run ready to review with run_id = 202 on production server. Code did not change after new military employment point added as that affected work outside and output to table called in sql file sql/employment/get_military_employment.sql

Copy link
Copy Markdown
Contributor

@GregorSchroeder GregorSchroeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved, do not merge until permanent home is found for military employment table and the get_military_employment.sql file is updated

Comment thread python/tests.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added a comment regarding "SE" being added, should probably also add a comment regarding "MIL" being added.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will need to update source once table is moved
may run into double-hop issue if the table is put into [EMPCORE]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Military Employment

5 participants