[R-sig-Geo] How to objectively subset cities by population
Dr. Benedikt Gräler
b.graeler at 52north.org
Thu Jul 27 10:00:19 CEST 2017
Dear Thiago,
if you want them spatially evenly distributed, you could overlay a grid
and select the largest per grid box - or maybe more intuitive, select
the largest per predefined administrative areas (counties/postal
codes/...). This could also change based on zoom-level. An alternative
is to group sensors and expand and zoom in by clicking on the group (see
e.g. [1]).
HTH,
Ben
[1] http://sensorweb.demo.52north.org/client/#/map
On 27/07/2017 06:09, Thiago V. dos Santos via R-sig-Geo wrote:
> Dear all,
>
> I have temperature records of nearly 1200 locations in southern Brazil.
>
> I am writing a shiny app that will show an interactive map with the locations plotted as circles, where the user can click a location to see its temperature time series.
>
> However, if I show all the locations in the map, it will look really bad, too cramped.
>
> Therefore, in an attempt to make the map look a bit cleaner, I am trying to think of an objective way to subset the locations. My initial approach would be to show only the "largest" locations, i.e. the ones with a population above a certain threshold.
>
> The problem is: the distribution of the population is so positively skewed that I am having a hard time determining the optimal cutoff point.
>
> Does anybody here know any tool or method, possibly spatial, that can assist me with this analysis?
>
> These are the locations I am working with:
>
> #-------------------------------
> # Download and summarize
> locs <- read.csv("https://www.dropbox.com/s/ykdd8x1mlc76klt/locations.csv?raw=1")
> hist(locs$Population)
> summary(locs$Population)
>
> # Convert to spatial points and plot
> require(sp)
> coordinates(locs) <- cbind(locs$Lon , locs$Lat)
> plot(locs)
> bubble(locs,"Population")
> #-------------------------------
>
> Thanks in advance,
> -- Thiago V. dos Santos
>
> PhD student
> Land and Atmospheric Science
> University of Minnesota
> [[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
>
--
Dr. Benedikt Gräler
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Muenster, Germany
E-Mail: b.graeler at 52north.org
Fon: +49-(0)-251/396371-39
Fax: +49-(0)-251/396371-11
http://52north.org/
Twitter: @FiveTwoN
General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b_graeler.vcf
Type: text/x-vcard
Size: 445 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20170727/afb90b97/attachment.vcf>
More information about the R-sig-Geo
mailing list