OpenWaterFoundation / owf-app-infomapper-ng

Open Water Foundation InfoMapper web application for menu-driven maps and visualizations, using Angular
GNU General Public License v3.0
1 stars 2 forks source link

Add geocoding lookup for a layer #370

Closed smalers closed 3 years ago

smalers commented 3 years ago

There is a need for some layers to use GeoCoding to look up features. For example, for municipal polygons or water provider polygons, it would be nice to allow entering a street address and then selecting or zooming to a polygon of interest. Or, for any feature type, find the list of closest features.

Maybe add a menu item "Find from address" to the layer kebab menu? Or require using the data table display of layer attributes and then use its kebab menu? Then enter an address and use a public geocoding service to look up a lat/long, which can be used to find a containing polygon. I found the following census REST service, which may be useful

smalers commented 3 years ago

What is needed to display the features in the data table is a function that takes a point and a layer, and returns the features that are matched so their attributes/properties can be displayed in the data table.

smalers commented 3 years ago

Now that the basic query is done, I recommend the following to close this out for now:

  1. Confirm that the address search is only currently enabled for point in polygon. Otherwise, we need to add a search with radius, and we can deal with that later. Make sure code comments reflect this.
  2. Update the CSS so that the radio box is not purple.
  3. When one or more features have been selected to match an address, use the kebab menu at the bottom right of the data table dialog to show the following menu choices:
    1. Zoom to address - zoom the map with some reasonable buffer like was done with points. Is it necessary to add a temporary marker to show the address? I'm not sure. We can deal with that later once basic zoom is in place.
    2. Zoom to selected features - like it is now but should the selected features be highlighted similar to how points are done? Maybe? Probably? At a minimum zoom and we can circle around to highlighting later.

One way or another the user probably needs some visual indicator because otherwise they won't know what to look for. Get the zoom working in some form and we can decide.

Nightsphere commented 3 years ago

The new branch has been merged with the following changes:

  1. The search by address radio button should only show up on a polygon layer.
  2. The CSS has been overridden to be the OWF green color instead of purple.
  3. The Zoom to address kebab button in the data table will zoom to a point on the polygon. Any other smaller tweaks such as zoom level can be done later.

This will be added to documentation later, but all that should be done to install after a Git pull is:

Authenticate to GitHub Packages/npm by logging in to the GitHub Packages registry. Do this in the same folder that npm install will be run by using the command

npm login --registry=https://npm.pkg.github.com --scope=OWNER

replacing OWNER with the owner of the repository - OpenWaterFoundation in this case. Three prompts will display:

  1. Username - GitHub username. This must be all lower case or it will ask again.
  2. Password - The GitHub Package access Token (GitHub password would also work).
  3. Email - GitHub email address.

Then run npm install and there should be no authentication issues.

smalers commented 3 years ago

I had no luck following these instructions. See issue #371 comment.

smalers commented 3 years ago

I added a point layer for SNOTEL stations to the Poudre Basin Information. A radio box is shown with only Search layer data. However, the kebab menu also includes Zoom to address . This should be removed since there is no address search.

Nightsphere commented 3 years ago

This small bug has been taken care of, and will be in the upcoming common library version 0.0.1-alpha.11. This bug was too small to warrant a version increase and publication, but is in the code and ready to go. Closing the issue.