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
11
votes
2 answers

convert matrix to raster in R

I have a matrix data with spatial coordinates and one variable. The spatial resolution is 1000 meters. > str(dat1) > List of 3 > $ x: num [1:710] 302340 303340 304340 305340 306340 ... > $ y: num [1:1241] 5431470 5432470 5433470 5434470 5435470…
Jian Zhang
  • 1,173
  • 5
  • 15
  • 20
10
votes
3 answers

How to create thiessen polygons from points using R packages?

I have multiple sets of points (for different years ~20) I want to generate thiessen polygons for each set of points using r spatial packages. I know this can be done using GIS but as i want a batch process something in R would be helpful.
user2760
  • 2,273
  • 7
  • 25
  • 34
10
votes
3 answers

Calculate Minimum Bounding Rectangle Of 2D Shape By Coordinates

I have a solution that uses spatial data to represent a cluster of points on a map. I have the need to used the coordinates that represent the extents of a cluster to find the minimum bounding rectangle that can contain said cluster of points. Does…
CSharpened
  • 11,674
  • 14
  • 52
  • 86
10
votes
2 answers

Getting a slot's value of S4 objects?

So I have a spatialpolygons object in R; but I am not sure why I am unable to retrieve the "area" slot from it. Here's my R session: > spatialpolygons An object of class "SpatialPolygons" Slot "polygons": [[1]] An object of class "Polygons" Slot…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
10
votes
4 answers

How to filter an R simple features collection using sf methods like st_intersects()?

SF is the R-Spatial package designed to work with tidy syntax like dyplr and pipes. I would like to do a simple spatial filter on a simple features collection object. Given a simple features collection, I would like to return all features from the…
jmw
  • 443
  • 3
  • 9
10
votes
3 answers

MySQL - Find points within radius from database

I have a table which has a POINT column containing the latitude and longitude of various locations. I then also have a users location from geo-location in the browser. What I need to be able to do is find all records from the table where the POINT…
tip2tail
  • 463
  • 1
  • 6
  • 23
10
votes
5 answers

3D clustering Algorithm

Problem Statement: I have the following problem: There are more than a billion points in 3D space. The goal is to find the top N points which has largest number of neighbors within given distance R. Another condition is that the distance between any…
Teng Lin
  • 129
  • 1
  • 1
  • 6
10
votes
1 answer

Get data frame with polygons id and Centroid (lat long) information from shapefile

I have a polygon shapefile (downloadable here) from which I want to create a data.frame with 3 columns containing: Polygon id Centroid latitude Centroid Longitude From this answer here, I know it its quite easy to get this information as a Formal…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
10
votes
3 answers

Convert SpatialPointsDataFrame to SpatialLinesDataFrame in R

I'm working with the HURDAT dataset to plot hurricane tracks. I have currently produced a SpatialPointsDataFrame object in R which looks something like this for the year 2004. > str(cluster.2004.sdf) Formal class 'SpatialPointsDataFrame'…
Richard Todd
  • 2,406
  • 5
  • 32
  • 40
10
votes
1 answer

Voronoi Diagram Edges: How to get edges in the form (point1, point2) from a scipy.spatial.Voronoi object?

I have spent a great deal of time now trying to obtain edges from the scipy.spatial.Voronoi diagram to no avail. Here is the main documentation: http://docs.scipy.org/doc/scipy-dev/reference/generated/scipy.spatial.Voronoi.html If you create a…
cgnorthcutt
  • 3,890
  • 34
  • 41
10
votes
2 answers

How to persist a calculated GEOMETRY or GEOGRAPHY column

I'm trying to create a table under SQL Server 2008 containing a GEOMETRY column and a calculated variation thereof. Considering the following table where the calculated column returns a buffered geometry: CREATE TABLE [dbo].[Test] ( [Geometry] …
Craig Nicholson
  • 1,241
  • 1
  • 11
  • 21
10
votes
4 answers

Know of any C# spatial data libraries?

I'm looking at implementing spatial queries in .NET without using SQL2008. The first requirement is to be able to create a (BTree styled) spatial index and be able to query it. Although SQL 2008 ships with .NET libraries for the types, you need to…
Simon Munro
  • 5,399
  • 6
  • 33
  • 40
10
votes
1 answer

calculating minimum distance between a point and the coast

I am trying to get the minimum distance between a given point and the coast. My example is the distance of Madrid to the coast: library(rgeos) library(maptools) coast <-…
user525602
  • 672
  • 1
  • 6
  • 18
10
votes
2 answers

Inserting coordinates into MySQL - PolyFromText SQL syntax error / returning null

I'm trying to insert geographic coordinates of a polygon into my MySQL database. I have a field named polygon of type POLYGON, and I've tried running all of these queries but continue to get SQL syntax errors: SET @g = 'POLYGON((-74.13591384887695…
Yev
  • 2,051
  • 9
  • 27
  • 46
10
votes
2 answers

JSON.Net JsonConverter for DbGeography

Long long struggles with this... Basically I have a model-first EF5 object with a DbGeography property. I would like to apply a JsonConverter that let's it roundtrip as simple latitude/longitude values. I'm using WebAPI. Looking for JSON output and…