1

I am looking to extract the polygons on this website http://goo.gl/vXhDSG

I am not sure how to do that as I can't see any references to a geo JSON file.

I can see that they are using CartoDB http://www.cartodb.com/

  • Can you clarify your question a little bit? Are you wanting to extract using geoJSON or you want to import the shapefiles using geoJSON? The first link you have referenced appears to be bad, as it times out. – MaryBeth Apr 6 '16 at 12:19
  • @MaryBeth. I'm curious to know why you think my answer is wrong. CartoDB renders vectors as pngs on the server and send them back. You can't scrape the original vector data in any way. If the person allows public access to their CartoDB account, you can download directly, but, this is not the case here. And the first link is slow, but does not time out. – John Powell Apr 6 '16 at 18:23
  • @JohnBarça - unsure where you got the impression that I thought your answer was wrong? I reviewed the question, as it came up in the queue for review, and I thought more information could be helpful--especially since the first link in the question would not (and still won't) open for me because of a timeout error. My comment was strictly on the question itself, I didn't see that there was an answer associated. – MaryBeth Apr 6 '16 at 18:36
  • @MaryBeth, ah, ok, sorry, that is fair enough. – John Powell Apr 6 '16 at 21:01
  • All good. :) was just trying to get more details. Your answer is fine. – MaryBeth Apr 6 '16 at 21:26
1

You can't. If you look at the source, you will see it is built from a CartoDB visualization, namely, https://nbnco.cartodb.com/u/nbncoadmin/api/v2/viz/6978447a-bb2b-11e5-86d3-42010a14800d/viz.json, which contains all the information necessary to built that view. However, if you go to the network tab in your browser's developer tools window, you will see lots of tiles, eg:

https://cartocdn-gucf.global.ssl.fastly.net/nbncoadmin/api/v1/map/nbncoadmin@2f897817@63ffe37c8acf4e9f74736b7ecde71514:1459905121423/0,1,2,3,4,5,6,7,8,9,10,11,12/8/211/154.png

which looks like:

cartodb tile

From this, you can deduce, that the vectors that you see in a CartoDB visualization are generated server side an png tiles, so there is no way you can get the raw vectors, unless they are available publicly from this organizations CartoDB page. If you go to this organization's CartoDB page, you will discover that the data are not public.

This is how CartoDB can handle large amounts of vector data quickly -- it gets sent to the client as a server-side generated raster -- while keeping the raw data secure, if the provider wants to keep it private.

  • Does this not answer your question? – John Powell Apr 8 '16 at 7:55
  • Thank you for an awesome response. The URLs of the PNGs look like they contain the location on a grid and zoom level. I guess they would all need to be scraped and stitched together somehow. – Alex Apr 8 '16 at 23:41
  • @Alex. Yes, the urls are standard slippy map tiles, ie, z/x/y.png, as used by OSM, Google Maps, etc. So, you could in theory go and calculate the coordinates from the url, see slippy map tiles docs and stitch the images back together and then use some image classification to convert to vectors. Please consider accepting the answer, if it has helped you. – John Powell Apr 13 '16 at 10:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.