[R-sig-Geo] shapefiles plotting and colouring

Danlin Yu danlinyu at csd.uwm.edu
Fri Oct 31 19:52:17 CET 2003


Hi, Paolo:
    I don't know if this helps. Indeed, if you have access to ArcGIS or
ArcView, I would surely suggest you to *join* your other database fields
to the shapefile and export the joined shapefile as a new one, then I
suppose either Chris or Hisaji's method will work for your problem.

On Fri, 31 Oct 2003, Paolo Cavallini wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Thanks for this. My problem is, however, to use variables from a database 
> (PostgreSQL in our case) rather than those of the dbf associated with the shp 
> file.
> All the best.
> Paolo
> 
> At 18:03, venerdì 31 ottobre 2003 you presumably wrote:
> > Hi.
> >
> > I've tried to draw choropleth maps by rmap package as follows.
> >
> > library(rmap)
> >
> > mySF <- shapefile("columbus.shp")
> >
> >  crime <- mySF$CRIME
> >
> > # user-defined legend
> >  classes <- c(50,100,500,1000,5000)
> >  breaks <- length(classes) + 1
> >  classNo <- crime < classes[1]
> >  for(i in 1:(breaks - 1))
> >    classNo <- classNo + (crime >= classes[i] & crime < classes[i + 1]) * i
> >
> >  classNo <- classNo + (crime >= max(classes)) * breaks
> >  plot(mySF, f=gray(1 - classNo/breaks)) # draw map
> >  lines(mySF, col="red") # draw outlines
> >
> > ----- Original Message -----
> > From: "Paolo Cavallini" <cavallini at faunalia.it>
> > To: <r-sig-geo at stat.math.ethz.ch>
> > Sent: Friday, October 31, 2003 11:57 PM
> > Subject: [R-sig-Geo] shapefiles plotting and colouring
> >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > Hi all.
> > > it may be a silly question, but: how can I, after reading a shapefile
> > > with
> >
> > the
> >
> > > appropriate library, draw them with different colours (or grey shades)
> > > according to different database fields (read through RODBC)? The idea is
> > > similar to the polygon command, but using shp as polygons and database
> >
> > fields
> >
> > > as qualifiers.
> > > Thanks for any suggestions.
> > > Ciao.
> > > paolo
> 
> - -- 
> Paolo Cavallini
> cavallini at faunalia.it
> www.faunalia.it
> Piazza Garibaldi 5
> 56025 Pontedera (PI)
> Italy
> Tel: (+39)348-3801953
> GPG signature/firma digitale @:
> www.faunalia.it/Public_key_Paolo.asc
> - ------------------------------------------
> Lavoro esclusivamente con software libero.
> I use exclusively free software.
> www.gnu.org / www.linux.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> 
> iD8DBQE/opuc/NedwLUzIr4RApSMAJoCktLlzZVBfzStI09vsNKScgDk4wCdHNz8
> +HhE2grymbl4Z5S84M2Fwgo=
> =4H68
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-geo
> 

    Sincerely,
    Danlin Yu, Ph.D. Candidate
    Department of Geography
    University of Wisconsin, Milwaukee
    Tel: (414)229-5818
    Fax: (414)229-3981
    Email: danlinyu at uwm.edu




More information about the R-sig-Geo mailing list