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

fix: geocoding sj #681

Merged
merged 6 commits into from
Nov 7, 2024
Merged

fix: geocoding sj #681

merged 6 commits into from
Nov 7, 2024

Conversation

ludtkemorgan
Copy link
Collaborator

@ludtkemorgan ludtkemorgan commented Mar 15, 2024

Issue #4467

Description

Adds migrations for all of the new San Jose geocoding layers needed for preferences.

  • Adds the District council maps. All ten of them
  • Adds redline map for city of San Jose

Also noticed the map layers are not sorted so added a UI sort to map layer drop down.

How Can This Be Tested/Reviewed?

With using a fresh stage seeding do the following:

  • Login to the partner site with admin account
  • go to the api http://localhost:3100/api#/scriptRunner/insertSanJoseMapLayers and run the script
    • Note: this only will work if you don't have API_PASS_KEY set in the backend .api file
  • In the partner site go to the "settings" tab and add a new preference.
    • Make sure "San Jose" is the jurisdiction
    • Add options to the preference and select "Yes, check with ArcGIS map" along with one of the new map layers
  • Add the newly created preference to a listing
    • Make sure "San Jose" is the jurisdiction

If you want to see the maps you can enter them in geojson.io and enter the featureCollection into the side bar. You should be able to copy the whole json file from the code base file into that site.

Also the data was retrieved from here: Sl City Council Districts.zip
UCB Displacement Risk Model SJ Tracts.zip
Image from iOS

Describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration.

Checklist:

  • My code follows the style guidelines of this project
  • I have added QA notes to the issue with applicable URLs
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have run yarn generate:client and/or created a migration if I made backend changes that require them
  • My commit message(s) is/are polished, and any breaking changes are indicated in the message and are well-described
  • Commits made across packages purposefully have the same commit message/version change, else are separated into different commits

Reviewer Notes:

Steps to review a PR:

  • Read and understand the issue, and ensure the author has added QA notes
  • Review the code itself from a style point of view
  • Pull the changes down locally and test that the acceptance criteria is met
  • Also review the acceptance criteria on the Netlify deploy preview (noting that these do not yet include any backend changes made in the PR)
  • Either explicitly ask a clarifying question, request changes, or approve the PR if there are small remaining changes but the PR is otherwise good to go

On Merge:

If you have one commit and message, squash. If you need each message to be applied, rebase and merge.

Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for housing-sanjoseca-gov ready!

Name Link
🔨 Latest commit 2538a9e
🔍 Latest deploy log https://app.netlify.com/sites/housing-sanjoseca-gov/deploys/672bbfd3a94beb00086cc1db
😎 Deploy Preview https://deploy-preview-681--housing-sanjoseca-gov.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@mcgarrye mcgarrye left a comment

Choose a reason for hiding this comment

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

backend-swagger changes are missing. Please run generate:client

@mcgarrye
Copy link
Collaborator

How can I test an address that should pass the check? I have tried addresses that are within the zone i selected but I always get No for Passed Address Check

@mcgarrye
Copy link
Collaborator

Screenshot 2024-10-17 at 2 13 12 PM
Don't love the ordering here

@ludtkemorgan
Copy link
Collaborator Author

@mcgarrye Yeah, the sorting is not great. It wasn't an ask but the random sort bugged me so I threw in a quick sort

I'm seeing the export work correctly. One call out, if you are entering the address via the partner UI did you verify the map that popped up corresponded to the address you expected to see?
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because the test failure is around selecting a jurisdiction I'm wondering if this seed data is the cause

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think what happened is the additional jurisdiction tied to the user makes the checkbox move just slightly down on the page so now it is not in the screen. The force tag seems to have resolved it.

@ludtkemorgan ludtkemorgan force-pushed the geocoding-sj branch 2 times, most recently from 97a131e to 0e756aa Compare October 25, 2024 00:54
@emilyjablonski emilyjablonski changed the title Geocoding sj feat: geocoding sj Oct 25, 2024
@ludtkemorgan ludtkemorgan changed the title feat: geocoding sj fix: geocoding sj Oct 28, 2024
@emilyjablonski
Copy link
Collaborator

@ludtkemorgan Is there an associated issue? Could you also fill out the PR template?

@@ -167,4 +168,16 @@ export class ScirptRunnerController {
req,
);
}

@Put('insertSanJoseMapLayers')
Copy link
Collaborator

Choose a reason for hiding this comment

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

These historically have been accompanied by a test in core

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test added

@@ -0,0 +1,5925 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

I might be overthinking this but is there any performance downside to data this large, either in the codebase or in the map layer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is some concern for having this large of a json in the DB. Luckily right now we only have these limited number of them. Long term, I'd like to introduce PostGIS to our database so that the data can be compressed. https://postgis.net/. This will allow the data storage in geometry format and then we can read it out as geojson https://postgis.net/docs/manual-2.4/ST_AsGeoJSON.html.

However, that is a bigger task that will need to be done separately. Potentially next time we get more layers (which might be a while)

@emilyjablonski
Copy link
Collaborator

emilyjablonski commented Oct 30, 2024

Screenshot 2024-10-29 at 6 53 01 PM

Functionally looks good! I dug around Figma for a design and did see this. Currently the UI doesn't link the contact text, not sure if that's expected, but does seem like it would be separate work.

@ludtkemorgan
Copy link
Collaborator Author

@emilyjablonski I don't think there is a ticket for this work as this PR was the last thing I did before my leave. But I can create an empty ticket to track it

Copy link
Collaborator

@mcgarrye mcgarrye left a comment

Choose a reason for hiding this comment

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

lgtm

@ludtkemorgan ludtkemorgan merged commit 913f264 into main Nov 7, 2024
37 checks passed
@ludtkemorgan ludtkemorgan deleted the geocoding-sj branch November 7, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants