Are ggplot point shapes svg files? Where can I find it? - r

I made some cluster analysis with a cities database, and now I want to use the same symbols for each cluster in a fancy map using QGis. Thanks!

Related

How to turn a spatial plot in R into an ArcGIS layer

So I hope I can clearly communicate my issue. Since I'm fairly new to R and ArcGIS I may miss some obvious things.
Basically, I'm using R to process spatial data to make a canopy height model and detect tree tops. That parts fine. I then make a watershed segment plot using forestTools package, and visually it looks great, but how do I export that as a file I can add into ArcGIS?
I'll copy some of the code that goes into what I'm discussing.
Basically, I just followed this guide's supplemental material to get the tree detection https://www.degruyter.com/document/doi/10.1515/geo-2020-0290/html?lang=en.
With that done, I then used the forestTools package to creat an interesting segmentation polygon grid on the map. https://www.rdocumentation.org/packages/ForestTools/versions/0.2.5/topics/mcws
This is quickly the plotting code to get visualized what I want.
[1]: https://i.stack.imgur.com/7Y0EF.png
This is what the map looks like with those plotted.
[2]: https://i.stack.imgur.com/Kdfl6.png
The layer that I want to bring solo to ArcGIS is that last plot the mcws one. I'll show a pic of that as well here.
[3]: https://i.stack.imgur.com/3PKfk.png
Is there a way that I can export that as a .shp or .tif?
Any help would be wonderful and much appreciated!
Nvmd I figured it out.
What you have to do is use the Raster package to export a shapefile.
raster::shapefile(site2_ttops,"Products/site2plot_ttops.shp")

How to obtain koppen-geiger climate map for ggmap

I would like to use ggmap to plot several data points on top of a koppen-geiger climate map.
The kopper-geiger data and GIS/KMZ maps can be downloaded here:
http://koeppen-geiger.vu-wien.ac.at/present.htm
I've managed to have a code to plot the points on regular maps, obtained through the get_map function but I fail to use other maps such as koppen-geiger.
Any help will be appreaciated!
Your basic problem is that the map you are attmepting to use is an image file that is not georeferenced. So unless you want to go through the unnecessary and probably time consuming process of georeferencing this image yourself, you will be better taking an alternative approach. There are perhaps a few ways to do this. But, unless you have very few data points to overlay on the map which you can place manually using the lat-long grid of the image, then the least painful method will certainly be to redraw the map yourself using the shapefile.
This is not the right place to give you an introductory lesson on GIS, but the basic steps are to
Download shapefile (which is available at the same website as the image you linked)
Project map to desired coordinate system
Plot map, coloring by climate class
Color the ocean layer
Add labels, legend, and graticule, as desired
Overplot with your own climate data, and legend for these.
If you are unsure how to approach any of these steps, then take an introductory course on GIS, and search the Web for instructional materials. You may find this resource useful.
https://cran.r-project.org/doc/contrib/intro-spatial-rl.pdf

Elki plot cluster points directly from java

Is it possible to plot Elki's cluster results to a graph directly using Elki? I don't see any test cases http://elki.dbs.ifi.lmu.de/browser/elki/elki/src/test/java#de/lmu/ifi/dbs/elki which do this. I know it's possible to plot points using java but I wanted to do that using Elki.
Please see the class ExportVisualizations to generate SVG plots.
http://elki.dbs.ifi.lmu.de/browser/elki/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/ExportVisualizations.java
Visualizations are in the "addon/batikvis" module, because of the Apache Batik dependency.
To display the SVG file, use Apache Batik.

Network Graph and US Map in R

I created a network graph from data on flows between US states. For each vertex, I have the lat/long of the state.
I am hoping to recreate a network kind of graph that shows the edges, except that I set the location of each vertex to be their geographic position and have a state boundary map in the background.
I am using to igraph to create my network. There have been some cool mapping examples in ggplot2, so I am wondering if that is an option. I believe I have seen similar options using Pajek, but I am hoping to stay within R.
maps in ggplot2
Any ideas/insight would be appreciated.
Brock
You have multiple packages dealing with maps. The most easy is maps, which gives you the states map. You can plot the vertices over using the coordinates.
map("state")
points(longitute,latitude)
These plots can be manipulated and added to using the base tools, keeping in mind the x axis is the longitude and the y axis is the latitude. edges can be plotted using the segments() function.
In ggplot2 just use the map_data() function, which gives you the shape-data of the map, and the geom_polygon() to add it to the graph in whatever form you want. Again, you can add the vertices and edges using the coordinates with the appropriate ggplot2 function geom_point() and geom_segment(). The code you link at shows you how, or otherwise look at this for an example.
Next to that, you can take a look at the packages maptools, which offers more functionality and, mapproj, which allows for different projections of the same map. You can use these packages as well to calculate geographical distances in a coordinate system.
mapdata contains more databases, and covers basically the whole world. You can work with coordinates pretty nicely.

Combining bordering shapefiles in R

I have five shapefiles of bordering counties in California that I am trying to combine into one large shapefile and maintain the original borders of the counties. I then want to plot points such as this so the map only needs to be a simple map of county boundaries. Is there a way to do this in R or will I have to use something like ArcGIS?
There is extensive documentation about merging within a shapefile such as here where both shapefiles have the same coordinates. But no documentation on shapefiles that only partially share coordinates.
If you only need to put all the borders into one data set then you can do that with sp/rgdal easily enough, but if you need to actually merge borders geometrically (clip/join/dissolve) and so on the support in R is not that simple.
Roughly the simple option is read each shapefile with readOGR, then spRbind them together. If rgdal presents difficulties for building/installing then there are other options for reading shapefiles in various packages.
btw, "something like ArcGIS" but much closer to "free": www.manifold.net
If you are looking for a Free and Open Source solution I highly recommend QGIS or uDIG or OpenJump or MapWindows. You can do all the shapefile manipulation you want in these packages, they are all GIS software.
I am sorry I do not of a way to do this in R and I am not sure I would trust the result - better to use a hammer for a nail than to use a screwdriver.
If you want to programmaticly want to alter the shapefiles let me know and I will recommend some python and java libraries.

Resources