You can get the data (for example) from http://www.diva-gis.org/gdata
(specifically I found http://gadm.org/data/shp/BRA_adm.zip) as
shapefiles and convert that to GeoJSON. Shapefiles are a standard
geodata format and there's a lot of tools that are able to work with
them/convert them.
I'd recommend that you add the data you want to display in the choropleth map
to the shapefile before converting it to GeoJSON. If you're unsure how to do
that, feel free to contact me off list, I'd be happy to help.
Lars
I've found that this works better in practice. As I've said, there're many tools
to work with shapefiles and it's easier to debug if something goes wrong -- most
GIS applications will let you make something like a choropleth map easily so
that you can check that everything looks like it should without spending a lot
of time getting the D3 part to work.
It's certainly feasible to add data to the GeoJSON as well though.
Lars
That way, it's trivial to change the dataset you are showing without generating (or downloading) another massive GeoJSON file. The only properties I would include in the GeoJSON would be a unique identifier and possibly human-readable names.
Separate data also means that you can load datasets on-demand, again without reloading the GeoJSON. And it's easier to derive a new example with different data.
Mike
I see your point. I usually put everything in one file for efficiency reasons
however (same reason my JS and CSS is usually inline). I find that loading lots
of small files is usually slower than one large file. Updating data in the JSON
(or whatever) files is not an issue for me.
For on-demand loading of data I totally agree with you.
Lars