[R-sig-Geo] how to create maps from topojson files and csv data?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Dec 16 11:31:39 CET 2013


The geoJSON driver in gdal/ogr will read it from version 2 of OGR:

http://www.gdal.org/ogr/drv_geojson.html

but I think that's very leading-edge (I seem to have v 1.10  on my system).

So the solution would seem to be to convert your topojson to something
that your gdal/ogr can handle, and then read it into R using the rgdal
package readOGR function. I'm having trouble finding a utility that
will do the conversion that way, since most people start from
something and convert it _to_ topojson for fast rendering! I think it
might be necessary to cruft something  together from various python or
javascript modules lying around the web,

>From there its straightforward SpatialPolygonsDataFrame stuff.

Barry

On Sun, Dec 15, 2013 at 10:49 PM, Miguel Fiandor Gutiérrez
<mfiandor at gmail.com> wrote:
> Hi,
>
> I do have some maps in topojson format, and I would like to display data on
> them that i have in .CSVs and access database. So far I play with them with
> d3.js,<http://transparenciadecuentaspublicas.es/2012/madrid/gastos-personales>but
> i'd like to learn too with R.
> My question is not about the csv or db to data frame or similar, is how to
> display any data variable with this kind of map files, I have not found
> literature about it. Yes, each region of the map has its own id code.
>
> The output will end on a pdf file or website, but as soon as I can print
> the map or export it it would be enough.
>
> Thanks
>
> Miguel Fiandor
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list