Closed michael2million closed 5 years ago
Hi @michael2million we are working on repairing the documentation, but currently we are without a developer (just after a major update to the code). Based on your request, I would recommend using the new Node Proxy for the time being... very sorry again for the inconvenience. As you might be able to tell, we are still prototyping...
Ok, I'll try using that. I see there is a Python example - do you have any JavaScript examples you can share for making a request that returns GeoJSON with Census Data? Thanks! (Any idea on the timeline for getting the SDK functional?)
The Node Proxy functions like an API, so you just pass arguments over a GET request. Also, the JavaScript SDK does work. We have just made a major update to the code though. When did you last fork/download?
I'll try using the Node Proxy. I got part of the SDK to work (returning GeoJSON, but not the data for each geography). I'm downloading the libraries with these script tags in my HTML:
// //
Are there more updated ones I should be using?
You might be getting out of date stuff from the .io docs... for the time being it would be best to stick with the instructions found on the repo:
https://github.com/uscensusbureau/citysdk https://github.com/uscensusbureau/citysdk/tree/master/src/sdk/core
I loaded those files in the browser and ran the example script:
CitySdk.request(request).then((response) => doSomethingWithData(response));
But I got the error "CitySdk is not defined."
So I looked in this file: s3.amazonaws.com/citysdk/releases/0.2.0/citysdk.js, to see what was actually defined. I tried something that was: CitySDK.prototype.jsonpRequest()
Then I got the error: XMLHttpRequest cannot load (my callback). Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Can you provide one simple working example for a GEORequest() call?
@tshrestha Can you help us out with this sir?
Just realized my problem was with browser security. Got it working now. But it would be nice to have at least a simple & definitive JS example - which script tags to use for loading the most updated libraries, and a working example of the APIRequest and GEORequest.
FYI, my app is working with the library files you said might be outdated (http://uscensusbureau.github.io/citysdk/static/js/citysdk/citysdk.js http://uscensusbureau.github.io/citysdk/static/js/citysdk/citysdk.census.js), but I couldn't make the examples on the repo work (maybe I'm doing them wrong, not sure).
Thanks!
It looks like the AWS S3 link has stopped working. I think that bucket might be out of commission. You can still download the latest release and follow the guide in the README.md.
You'll need to replace the S3 link in the <script>
.
Are you guys aware that the basic User Guides don't work (examples are broken, libraries are incorrect)? https://uscensusbureau.github.io/citysdk/guides.html
Can you please update your instructions? Based on another post here, I replaced the libraries listed on your Getting Started page with these:
That got the GEORequest working, but now getting this error:
jquery.min.js:4 XMLHttpRequest cannot load file://api.census.gov/data/2014/acs5/geography.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
Is this project being maintained? If not, can you suggest a better way to get US Census Data with an API?
Thank you!