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
13
votes
10 answers

Efficient represention for growing circles in 2D space?

Imagines there's a 2D space and in this space there are circles that grow at different constant rates. What's an efficient data structure for storing theses circles, such that I can query "Which circles intersect point p at time t?". EDIT: I do…
dan_waterworth
  • 6,261
  • 1
  • 30
  • 41
13
votes
2 answers

Automatic Label Placement for GIS maps in R

I'm making GIS maps in R using the sf package (and related packages) to read in shapefiles, and ggplot2 (and friends) for plotting. This works fine, but I can find no way to (automatically/programmatically) create label placements for features such…
invertdna
  • 171
  • 6
13
votes
2 answers

NHibernate.Spatial and Sql 2008 Geography type

i'm currently working on a project where i have to deal with sql server 2008 geography types. As big parts of the projects uses NHibernate as ORM i wonder how much work it will be to use/extend NHibernate.Spatial with this type (as far as i can see…
Joachim Kerschbaumer
  • 9,695
  • 7
  • 49
  • 84
13
votes
4 answers

Split polygon parts of a single SpatialPolygons Object

In R, I have single SpatialPolygons object (i.e. multi-polygons) containing several hundred polygons. I would like to split this SpatialPolygons object into a list of Polygons (i.e. holes should remain attached to the parent polygon). Any idea how…
jatobat
  • 749
  • 3
  • 8
  • 21
13
votes
6 answers

which data structure is appropriate to query "all points within distance d from point p"

I have a 3D pointcloud and I'd like to efficiently query all points within distance d from an arbitrary point p (which is not necessarily part of the stored pointcloud) The query would look something like Pointcloud getAllPoints(Point p, float…
genesys
12
votes
1 answer

SQL Spatial Join

I have 2 tables one with points as geographies and other with polygons as geographies. I am able to find which polygon a single point falls(from the point table) by the following query: DECLARE @p geography; select @p = PointGeom from dbo.PointTable…
ss_norwalk
  • 191
  • 1
  • 1
  • 3
12
votes
1 answer

sf: How to get back to MULTIPOLYGON from GEOMETRYCOLLECTION?

I have a world country dataset, and would like to split it on the prime meridian, and re-center the data to focus on the Pacific. I am trying to do this using Simple Features (sf), but am coming across an object-type issue I can't solve. In order to…
bealhammar
  • 155
  • 1
  • 7
12
votes
3 answers

MySQL INSERT/UPDATE on POINT column

I'm trying to populate my DB with geographical places of my country. One of my tables have 4 fields: ID[PK], latitude. longitude ande geoPoint EDIT `SCDBs`.`Punto_Geografico`; SET @lat = 18.469692; SET @lon = -63.93212; SET @g = 'POINT(@lat…
Luis D Urraca
  • 2,024
  • 4
  • 24
  • 46
12
votes
1 answer

Changing CRS of a SF object

I have some 'roads' as a sp object: class : SpatialLinesDataFrame features : 17360 extent : 490176.4, 567680.9, 148639.1, 212821 (xmin, xmax, ymin, ymax) coord. ref. : +init=epsg:27700 +proj=tmerc +lat_0=49 +lon_0=-2 …
TheRealJimShady
  • 777
  • 3
  • 9
  • 24
12
votes
5 answers

SQL Spatial polygon inside out

I am allowing users to draw a polygon in Silverlight by clicking to draw. Then I loop through the points, convert them to longitude and latitude and then save to SQL (in a geography column). The problem is that because of the world being round and…
Matt
  • 1,562
  • 2
  • 17
  • 27
12
votes
3 answers

Create Grid in R for kriging in gstat

lat long 7.16 124.21 8.6 123.35 8.43 124.28 8.15 125.08 Consider these coordinates, these coordinates correspond to weather stations that measure rainfall data. The intro to the gstat package in R uses the meuse dataset. At some point…
ace_01S
  • 387
  • 2
  • 5
  • 16
12
votes
1 answer

Creating shapefiles from points in data frame

After reading a lot of posts and websites I can't find out how to create a polygon shapefile from my lon-lat data table. I would like to create maps like this one. My csv data file contains longitude, latitude and attribute of 1000 points in the…
pacomet
  • 5,011
  • 12
  • 59
  • 111
12
votes
3 answers

Union all geometry in a SQL Server table like GeomUnion in Postgres

Just to clarify up-front: I'm talking about unioning geometry, not the SQL keyword UNION. I'm trying to move some spatial data from Postgres with PostGIS to SQL Server 2008. It was fine until I saw a statement like this: SELECT GeomUnion(the_geom)…
Brendan Long
  • 53,280
  • 21
  • 146
  • 188
12
votes
3 answers

Selecting a good SQL Server 2008 spatial index with large polygons

I'm having some fun trying to pick a decent SQL Server 2008 spatial index setup for a data set I am dealing with. The dataset is polygons, representing contours over the whole globe. There are 106,000 rows in the table, the polygons are stored in a…
12
votes
2 answers

SQL Geometry find all points in a radius

I am fluent in SQL but new to using the SQL Geometry features. I have what is probably a very basic problem to solve, but I haven't found any good resources online that explain how to use geometry objects. (Technet is a lousy way to learn new…
Roger Hill
  • 3,677
  • 1
  • 34
  • 38