Skip to content

added has pid option and modified SiteLoaderPrep#437

Open
3rdmike wants to merge 1 commit into
mainfrom
LOC-6938
Open

added has pid option and modified SiteLoaderPrep#437
3rdmike wants to merge 1 commit into
mainfrom
LOC-6938

Conversation

@3rdmike

@3rdmike 3rdmike commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Implement hasPid parameter when enabled Geocoder only return matches that have pid. Also has minor update in SiteloaderPrep.

Copilot AI left a comment

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.

Pull request overview

Adds a new hasPid query option so geocoding results can be restricted to matches that have parcel identifiers (PIDs), and tightens PID handling during site-loader preparation to skip blanks and avoid emitting empty PID mappings.

Changes:

  • Add hasPid parameter to GeocodeQuery and apply PID-based filtering in Geocoder.geocode().
  • Add datastore helper to determine whether a match has PIDs.
  • Improve PID ingestion/output in SiteLoaderPrep (skip blank PIDs, avoid writing empty PID strings).

Reviewed changes

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

File Description
ols-geocoder-process/src/main/java/ca/bc/gov/ols/siteloaderprep/SiteLoaderPrep.java Filters out blank PIDs and avoids writing empty PID mappings; adds PID dedupe behavior.
ols-geocoder-core/src/main/java/ca/bc/gov/ols/geocoder/GeocoderDataStore.java Introduces PID-presence check for geocode matches.
ols-geocoder-core/src/main/java/ca/bc/gov/ols/geocoder/Geocoder.java Filters initial matches by PID when requested and suppresses fallback when hasPid=true.
ols-geocoder-core/src/main/java/ca/bc/gov/ols/geocoder/api/GeocodeQuery.java Adds hasPid flag and adjusts preliminary result sizing to compensate for filtering.

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

Comment on lines +1682 to +1683
ISite site = getRawSiteByUuid(UUID.fromString(address.getSiteID()));
return site != null && site.getPids() != null && !site.getPids().trim().isEmpty();
Comment on lines +396 to +400
for(GeocodeMatch match : matches) {
match.resolve(datastore);
if(datastore.hasPids(match)) {
filteredMatches.add(match);
}
Comment on lines +452 to +454
if(hasPid) {
return Math.max(getMaxResults() + 1, 100);
}
matches = handler.getMatches();
}

matches = filterMatchesByPid(matches, query);
Comment on lines +254 to +256
if(!pids.contains(pid)) {
pids.add(pid);
}
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.

2 participants