uscensusbureau / citysdk

Convenient JavaScript utilities for working with Census APIs: Statistics, Cartographic GeoJSON, lat/lng -> FIPS, and other niceties (written in ClojureScript)
https://uscensusbureau.github.io/citysdk
MIT License
959 stars 184 forks source link

Merging GeoJSON with Statistics returns an empty array #353

Open dumitruPuggle opened 1 year ago

dumitruPuggle commented 1 year ago

Hello! I've started to search for an way to receive the statistics encoded using GeoJSON for my google maps feature.

I tried to follow the official documentation provided in your Readme file, specifically this code: https://github.com/uscensusbureau/citysdk#all-counties

When I run the request, I receive the following output:

Screenshot 2023-07-03 at 23 02 31

Thanks

loganpowell commented 1 year ago

Can you provide the exact input you provided?

On Mon, Jul 3, 2023, 4:12 PM Dmitry @.***> wrote:

Hello! I've started to search for an way to receive the statistics encoded using GeoJSON for my google maps feature.

I tried to follow the official documentation provided in your Readme file, specifically this code: https://github.com/uscensusbureau/citysdk#all-counties

When I run the request, I receive the following output: [image: Screenshot 2023-07-03 at 23 02 31] https://user-images.githubusercontent.com/46863241/250651582-ecedba49-1eca-429f-b7d7-6e08de760a8b.png

Thanks

— Reply to this email directly, view it on GitHub https://github.com/uscensusbureau/citysdk/issues/353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2ACPZNFAVDXL4LW4IQHFLXOMRTTANCNFSM6AAAAAAZ43PIDU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dumitruPuggle commented 1 year ago
import census from "citysdk";

interface ICensusCartographicData {}

//* Gets the raw census data
export const getCartographicData = async ({}: ICensusCartographicData) => {
  return new Promise((resolve) => {
    census(
      {
        vintage: "2017",
        geoHierarchy: {
          county: "*",
        },
        sourcePath: ["acs", "acs5"],
        values: ["B19083_001E"], // GINI index
        statsKey: "...",
        geoResolution: "500k",
      },
      async (err: any, res: any) => {
        resolve(res);
      },
    );
  });
};
loganpowell commented 1 year ago

Sorry, this got buried under other work. I am really busy this week, but I will get to this by the end of the week. In the meantime, if you have a reproduction repo I can see, that would help.