You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vingkan opened this issue
Jul 20, 2021
· 0 comments
Labels
apiWork for backend APIappWork for frontend appenhancementNew feature or requestpipelineWork for offline pipelinestretchStretch project for Scarlet Data Studio interns.
We have several product features where it would be useful to geocode: convert an address to longitude/latitude coordinates and other geographic information.
For example:
Datasets in offline pipeline that have address or zip code but not other geo fields could be mapped to coordinates and community areas
Pages on the frontend could allow the user to enter their address or zip code and then see results for their community area
Pages on the frontend could show pins on a map for the coordinates of a record
We would like to find a free geocoding service, I think I found two a few months ago that could work:
Chicago geocoding service
Census geocoding service
Below are my messy notes from playing around with those. I can explain how to get these into Python code and add them into our codebase.
We could do geocoding in the offline pipeline or in the backend API or both depending on the use case.
fetch(`https://api.chicago.gov/els/forwardgeocoding/rest/geocode_3`,{method: "POST",headers: {'Accept': 'application/json, text/javascript, */*; q=0.01','Accept-Encoding': 'gzip, deflate, br','Accept-Language': 'en-US,en;q=0.9','Authorization': 'Basic ZWxzX2NsaWVudF93YXJkZ2VvOnR2S0xANFM2N2Fw','Connection': 'keep-alive','Content-Type': 'application/json','Host': 'api.chicago.gov','Origin': 'https://gisapps.chicago.gov','Referer': 'https://gisapps.chicago.gov/','sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"','sec-ch-ua-mobile': '?0','Sec-Fetch-Dest': 'empty','Sec-Fetch-Mode': 'cors','Sec-Fetch-Site': 'same-site','User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36',},body: JSON.stringify({ForwardGeocodeServiceInput3: {"systemId": "WARD_LOOKUP","offsetFt": "20","fullAddress": "2345 S Michigan Ave","getGeos": {"geographyName": "CENSUS_TRACT"}}}),}).then(async(res)=>{constdata=awaitres.text();console.log(data);}).catch((err)=>{console.error("Something went wrong:");console.log(err);});
letaddress="2345 S Michigan Ave, Chicago, IL";fetch(`https://geocoding.geo.census.gov/geocoder/locations/onelineaddress?format=json&benchmark=2020&address=${encodeURIComponent(address)}`).then(async(res)=>{constdata=awaitres.json();console.log(data);}).catch((err)=>{console.error("Something went wrong:");console.log(err);});
The text was updated successfully, but these errors were encountered:
apiWork for backend APIappWork for frontend appenhancementNew feature or requestpipelineWork for offline pipelinestretchStretch project for Scarlet Data Studio interns.
We have several product features where it would be useful to geocode: convert an address to longitude/latitude coordinates and other geographic information.
For example:
We would like to find a free geocoding service, I think I found two a few months ago that could work:
Below are my messy notes from playing around with those. I can explain how to get these into Python code and add them into our codebase.
We could do geocoding in the offline pipeline or in the backend API or both depending on the use case.
The text was updated successfully, but these errors were encountered: