Tag Info

New answers tagged

1

The Java Topology Suite includes a TopologyPreservingSimplifier. The code does not include a reference for the implementation, beyond stating that it operates in a similar manner to Douglas-Peucker, with additional constraints on altering the topology. This functionality has made it into the Java-to-C++ translation of JTS, libgeos, which is further ...


2

The formula for global Moran's I is: where i is an index of analysis units (basically, measurement units of of your map, or in your case pixels in the raster) and j is an index of the neighbors of each map unit. The formula for local Moran's I is extremely similar, except that since local Moran's I is calculated separately for each analysis unit indexed ...


0

my.attribute <- read.csv.... IMPORT TABLE WITH ATTRIBUTE TO ADD #load some key spatial libraries for R library(maptools) library(sp) library(rgdal) library(raster) #load your shapefile ?readOGR my.shapefile <- readOGR(dsn="C:/leads/to/your/shapfiles", layer="yourlayername") plot(my.shapefile) # does it look ok? ?merge joined <- ...


3

The problem was that I had run out of space to write to disk, and the map algebra commands I was using were attempting to generate and write large temporary raster files.


1

I thought I'd answer this myself just in case anyone else with a similar problem ever stumbles on this. Using the above advice on converting my Cartesian coordinates to polar coordinates, I've made a function which calculates a minimum enclosing circle around the x,y coordinates, and divides this circle into a user-defined number of 'grid' cells with equal ...


0

See my example and answer ### Preparing the SpatialPointsDataFrame spdf <- matrix(as.numeric(NA), nlevels(Poly$MatchID), 1) spdf <- as.list(spdf) ### Sample the coordinate, match it with data in spdf. It create a list fore each factor of the MatchID ### sample(spsample()) fix the size of the sample for (i in seq(Poly$MatchID)) spdf[i] <- ...


2

After a lot of attempts I have this solution, probably not so clean. Comments, improvements or other way to answer are much welcome! ### Preparing the SpatialPointsDataFrame spdf <- matrix(as.numeric(NA), nlevels(Poly$MatchID), 1) spdf <- as.list(spdf) ### Sample the coordinate, match it with data in spdf. It creates a list fore each factor of the ...


0

I am using package gdalUtils which uses gdal binary (for example osgeo4w). This combination works with most of GIS formats.


1

I believe what you are experiencing is more or less a copy of this question. The coordinates in the rainfall data are in longitude/latitude, but with values ranging from 0 to 360, instead of -180 to 180 (as your political boundaries are). See the GPCC spatial note here (emphasis mine): Spatial Coverage: 0.5 degree latitude x 0.5 degree ...


0

The hint provided by @mdsummer of using byid=T worked for me. Here is one example reproducible example: library(maptools) library(rgeos) brazil_states <- readShapePoly(fn="C:\\...\\BRA_adm1") #Brazil's state boundaries; download here: http://www.diva-gis.org/datadown plot(brazil_states) bioms <- readShapePoly(fn="C:\\...\\Biomas5000.shp") ...


0

I found this article: Integrating external programs within ModelBuilder, it is older and initially looks like it is off topic, but if you look at this: , you can see that it explicitly sets the path to the R script. When your geoprocessing script runs on the server, it runs in a scratch folder within the jobs directory. Depending on the publishing ...


1

After all I found solution, but not sure if that is right and elegant. I used proj4 string that SeaWifs level 3 have: s_srs="+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs" and overwrite georeferenced bounds by the values from SeaWifs hdf file a_ullr =c(-20037508.343,10018754.171,20037508.343,-10018754.171) after ...


1

Why not just sort the string? identical(sort(unlist(strsplit(sp1@proj4string@projargs, ' '))), sort(unlist(strsplit(sp2@proj4string@projargs, ' '))))


0

I would first make a join of the two tables crime and population. Then I would add another column where I calculate the crime case per population, simply divide the crime case column by the population coloumn. Works if the numbers refer to the exact same areas. Then you can visualize this column in a choropleth map and immediately see where the crime is ...


0

As the question allows for other packages I'd like to propose a solution using RIOS (https://bitbucket.org/chchrsc/rios/). It is build on top of the GDAL Python bindings but provides a simpler interface, taking care of the actual raster I/O. RIOS will provide the pixel values as a NumPy array, so you could use any of the inbuit stats functions or utilise ...


0

Field Mapping begins on page 2-8. Look at the "Data Dictionary Reference", field size, and starting position. Should give you a template for your files.


0

So, the census has a template mdb file that is used for importing their sf1 data into... but if you want an open source route here is a post about using postgres to format the data: http://sproke.blogspot.com/2012/01/importing-2010-sf1-census-in-postgresql.html And if you want to use access, there is that approach: ...


1

To me, the simplest approach is to probably convert your XY datapoints to the polar coordinate system that defines your circular 'arena'. Be sure to convert your XY coordinates such that the center of your circle is the origin of your Cartesian grid before converting to polar coordinates. Almost all math texts would provide these straightforward conversion ...


0

I had the same problem today. Using the built-in Layer to KML tool and XTools didn't produce a nice image. But i brought in my georeferenced image into Global Mapper and it worked much better without any blurriness. Edit: I created the KML/KMZ in Global Mapper. I loaded the JPG, then used File, Export, Export Web Format. I checked on the Super Overlay Setup ...


3

First of all, I agree with @SS_Rebelious. Your "zipcoords" object seems to represent a common data extent so, rather than creating a list object, why not just create a stack object of your rasters and extract everything at once? If common extents are a problem in the rasters, you can use the "quick=TRUE" argument in stack() to override the extent error. ...


3

What you're trying to create is known as a bivariate map. There's a couple of ways to do this, but since you've already got raster data that leans toward certain methods. The big thing is going to be your color selections, and I'm not sure exactly how to get the blending you desire. Typically this is done with two colors, one for each variable. So A 0 = ...


1

I dont think thereĀ“s a faster way to do that, but what you can do is a list in a table with the name of each multilayerraster with an identifier (column names: id & name, in this order). So you can write this: #load the table with the name of the image & id list<-read.table("Table.txt",header=T) # select "automatic" correlative id id<-id+1 ...


5

The issue here is that mosaic and do.call are expecting a raster object in the list and not just character names of the raster that is contained in the "rasters1" vector. You are, in effect, asking to mosaic a name in a vector and not a raster object. # Create some example data require(raster) r <- raster(ncol=100, nrow=100) r1 <- crop(r, ...


0

Why not just use the gmap() functionality offered by the dismo package instead of ggmap? You can download Google maps of type 'satellite', 'terrain', 'roadmap' and 'hybrid' there as well. The advantage is that the thus aquired maps are instantly available as objects of class 'RasterLayer' or 'RasterStack', holding a defined spatial information. Setting ...


0

Problem: applying moving window in matrix/raster to calculate Kappa statistics between classified map and reference dataset Solution: using focal{raster package}. This will implement moving window in raster function "modal" fun=modal to keep the majority values of neighbour values movingFun() from the {Raster}is mostly for vectors R code for focal() ...


3

This set of extracts from OSM data may be what you're looking for. In particular, this shapefile of the coastline around Helsinki.



Top 50 recent answers are included