districts icon indicating copy to clipboard operation
districts copied to clipboard

Serve combined GeoJSON files?

Open daguar opened this issue 10 years ago • 8 comments

Wondering if it makes sense to also serve, eg, a single GeoJSON file for all state boundaries together.

(This is just a use-case I've bumped up against time and again, and while GitHub seems like a great platform for geo hosting, I can't seem to find a canonical repo for this. Is this it??? :smile: )

daguar avatar Jan 13 '14 01:01 daguar

I'd love it to be that canonical repo! If you put together a US/states.geojson with each state boundary showing, I'll happily accept it.

konklone avatar Jan 13 '14 16:01 konklone

Cool -- I'll try to do this when I find a second (only issue I can see would be making sure they're in sync with any changes to the others, but that could be a YAGNI problem for now.)

Related: if it could be canonical, I for one think it would be super rad if this repo had tons of other shapes that are relevant for US gov't data mapping (counties, MSAs, etc.)

The thought that pops into my head then, though, is whether the best naming convention for those things would be a repo like geography instead of districts

(I'm just imagining how awesome it would be for someone to be able to query unitedstates/geography/msa/new_york-newark-jersey_city_ny-nj-pa.geojson and know it would be there)

daguar avatar Jan 14 '14 16:01 daguar

I'd prefer to grow iteratively, as needs arise. So if people want to submit counties, MSAs, etc., then we can consider and adapt to their inclusion then.

I think it's likely some real basic scripting may be helpful to manage keeping files in sync. That's the downside of using a static file approach like this. However, we could also in theory produce combined files using Jekyll.

I'm not sure how we'd get to the point where you could type in arbitrary combinations of slugs in a URL and get a dynamically generated map, though. And I don't want to generate static files for every possible combination. There are some things you're better off using an API for (which is why I link to a few in the README).

konklone avatar Jan 14 '14 21:01 konklone

I'm not sure how we'd get to the point where you could type in arbitrary combinations of slugs in a URL and get a dynamically generated map, though.

Sorry, I think my example was confusing: New York-Newark-Jersey City NY-NJ-PA is an example of a single MSA (I'm definitely not suggesting dynamic compilation, which is certainly the purview of an API.)

daguar avatar Jan 14 '14 21:01 daguar

Ah, got it.

konklone avatar Jan 14 '14 22:01 konklone

PR #6 includes a topojson file for all states in context of 114th congress. (see: https://github.com/bradoyler/districts/blob/topojson-make/us/114th-congress.json)

bradoyler avatar Oct 03 '16 21:10 bradoyler

Merged files would be great. Especially with party affiliation.

mhkeller avatar May 30 '17 15:05 mhkeller

If there is still interest, please take a look at: https://github.com/Andrew-Chen-Wang/district-autoupdate It'll generate your merged file, but this GitHub actions only applies to the cds folder (the one applicable thing for my use case).

Andrew-Chen-Wang avatar Jun 28 '21 03:06 Andrew-Chen-Wang