Questions tagged [spatial]

Spatial data types store geometric data, that is data related to an object's position in space.

Spatial data types store an object's position in space, colloquially these types are "geometric" or "geographic", and operating on them will make use of geodesic or Cartesian calculations. The applied field devoted to spatial data is Geographic Information Systems (GIS); the GIS Stack Exchange should be considered for questions with this tag.

Many popular databases engines now include support of spatial data types, including:

3312 questions
10
votes
1 answer

What are the units of distance in gstat variogram?

This is a follow-up to this question. I have now managed to plot variograms of the data using the answers given to that question. The code I am using (where im is a variable containing the dput data given at https://gist.github.com/2780792…
robintw
  • 27,571
  • 51
  • 138
  • 205
9
votes
4 answers

Poor Performance when using Spatial Indexes in MySQL

I'm trying a little experiment at pushing a data set which is not geo-spatial but fits it quite well and am finding the results somewhat unsettling. The data set is genomic data e.g. the Human Genome where we have a region of DNA where elements like…
andeyatz
  • 428
  • 3
  • 9
9
votes
2 answers

MySQL latitude and Longitude table setup

I want to store latitude and longitude values of places in a mysql database table. With the future in mind I will want to be able to find these places within a certain radius of a specific location. Having said that, what datatypes should I store…
Martin
  • 10,294
  • 11
  • 63
  • 83
9
votes
1 answer

Spatial correlogram using the raster package

Dear Crowd Problem I tried to calculate a spatial correlogram with the packages nfc, pgirmess, SpatialPack and spdep. However, I was troubling to define the start and end-point of the distance. I'm only interested in the spatial autocorrelation at…
Benasso
  • 123
  • 5
9
votes
1 answer

Improve speed/use of gDistance function by using parallel processing and/or plyr/dplyr?

I have a bunch of locations for each of about 1000 individuals. The total dataset used to be around 2.5 million and my processing script took about 20 hours to run. Now however, I have 24 million observations and figure I need to clean up my code…
Jordan
  • 614
  • 1
  • 7
  • 20
9
votes
2 answers

How to create spatial index using EF 6.1 fluent API

Well, the question is clear enough. Is it possible to create spatial indexes using Entity Framework 6.1 fluent API?
9
votes
1 answer

DbGeography.PointFromText 24141: A number is expected at position

I have WCF REST service which contains following code var geo = DbGeography.PointFromText(string.Format("POINT({0} {1})", longitude, latitude), DbGeography.DefaultCoordinateSystemId); Unit test works fine, but when I call this code from client or…
Pavel Kharibin
  • 765
  • 2
  • 15
  • 24
9
votes
1 answer

Overplotting two SpatialPolygonsDataFrames with spplot

I have a bunch of data which I've plotted at the county level, without borders. I'd like to add in state boundaries. I have a state shapefile (polygons), but spplot doesn't seem to have any way to add on top of the previous map. Is there any way…
Ari B. Friedman
  • 71,271
  • 35
  • 175
  • 235
9
votes
3 answers

2D Game: Fast(est) way to find x closest entities for another entity - huge amount of entities, highly dynamic

I'm working on a 2D game that has a huge amount of dynamic entities. For fun's sake, let's call them soldiers, and let's say there are 50000 of them (which I just randomly thought up, it might be much more or much less :)). All these soldiers are…
Pygmy
9
votes
2 answers

Fast spatial data structure for nearest neighbor search amongst non-uniformly sized hyperspheres

Given a k-dimensional continuous (euclidean) space filled with rather unpredictably moving/growing/shrinking  hyperspheres I need to repeatedly find the hypersphere whose surface is nearest to a given coordinate. If some hyperspheres are of the same…
Regexident
  • 29,441
  • 10
  • 93
  • 100
8
votes
2 answers

create random points inside a shape in r

I'm trying to simulate some data for a project, and basically I need to draw an irregular oval-ish shape, then make a bunch of random points inside that shape, and I'm at a total loss for how to do this. For now, I've made a spline shape, then…
Jake L
  • 987
  • 9
  • 21
8
votes
3 answers

How to improve a spatial raster map using ggplot when compared to spplot?

How can I improve the legend of spatial raster map plot using ggplot when compared to a spplot() legend? I would like plot spatial maps using ggplot() instead of ssplot() however there are a few things that I would like to improve when compared to…
Janvb
  • 1,290
  • 2
  • 16
  • 17
8
votes
3 answers

Using Dapper with SQL Spatial Types as a parameter

I've got a system which basically has to do a query like this: SELECT * FROM MyTable WHERE @parameter.STIntersects(MyGeometryColumn) This is quite simple to do when using vanilla SQL parameters, you just have to create your parameter in a…
Erik van Brakel
  • 23,220
  • 2
  • 52
  • 66
8
votes
2 answers

R: SpatialPointsDataFrame code no longer working. Error in !res[[1]] : invalid argument type

I have been following this workflow to convert coordinates from Eastings / Northings to Latitude / Longitude in R. Up until today it has been working fine. Here is a reproducible example: require(rgdal) # create test coordinates x <- 259269 y <-…
RWard
  • 93
  • 1
  • 5
8
votes
1 answer

Is there a way in R to plot a legend with two axes?

I would like to plot a legend with two axes. Specifically, I have combined two spatial objects that have been classified, the first showing intensity of an event and the second showing the probability of the event at that location. I want to create…
dee_2_dee
  • 81
  • 1