0

I am trying to use OSM Boundaries to get all US state and territory's boundary polygons in a front end app. It returns a gz archive. I have used axios to get the blob but I can't seem to find a way to extract it. I tried using browserify-zlib.

      const osmBoundURI = `https://osm-boundaries.com/Download/Submit?apiKey=${process.env.REACT_APP_OSM_BOUNDARIES_API_KEY}&osmIds=-148838&recursive&minAdminLevel=4&maxAdminLevel=4`;
      const states = await axios.get(osmBoundURI, {
        responseType: "blob",
        timeout: 30000,
      });
Michael
  • 102
  • 2
  • 10
  • Do you mean that the `states` are not formatted the way you want to? You want it to be an array of objects, but instead it is a blob? Maybe this link is useful? https://developer.mozilla.org/en-US/docs/Web/API/Blob – John Dec 17 '20 at 00:45
  • The get request returns a file that is an archive. I need to extract the geojson file so I can create an array of objects made from the contents. – Michael Dec 17 '20 at 00:55

0 Answers0