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

Is the SQL Server 2012 version of Microsoft.SqlServer.Types' geometry UDT backward compatible with SQL Server 2008?

If I had both SQL Server 2008 and SQL Server 2012 installed locally, I would simply try this for myself; however I only have the newer version installed and would like to keep it that way. SQL Server 2008 comes with an assembly…
12
votes
1 answer

st_intersects Vs st_overlaps

What is the difference between these two queries : select a.gid, sum(length(b.the_geom)) from polygons as a , roads as b where st_intersects(a.the_geom,b.the_geom) group by a.gid ; select a.gid, sum(length(b.the_geom)) from polygons…
Abhishek Sagar
  • 1,189
  • 4
  • 20
  • 44
11
votes
4 answers

neo4j vs mongodb for spatial search

I'm getting ready to start a project where I will be building a recommendation engine for restaurants. I have been waffling between neo4j (graph db) and mongodb (document db). my nodes/documents will be things like restaurant and person. i know i…
drizkol
  • 155
  • 1
  • 9
11
votes
8 answers

Looking for library/tool to visualise multi-dimensional data

I'm using Python in an attempt to analyse a large chunk of empiric measurements. In essence, I've two functions transforming the empiric data which also takes 3 'count' parameters - and returns a sequence of floats in each configuration. I'm…
aSteve
  • 1,956
  • 1
  • 20
  • 35
11
votes
3 answers

Preserve start points in UnionAggregate

Use case 1: DECLARE @Geom TABLE ( shape geometry, shapeType nvarchar(50) ); INSERT INTO @Geom(shape,shapeType) VALUES('LINESTRING(1 2, 3 4)', 'A'), ('LINESTRING(3.2 4, 7 8)', 'B'); SELECT * FROM @Geom SELECT…
ParoX
  • 5,685
  • 23
  • 81
  • 152
11
votes
1 answer

How to separate a multipolygon geometry into several polygons objects after performing a st_union() operation?

I have a set of polygons of which some intersect and/or touch (common borders). I am using R's sfpackage to perform operations on polygons. My approach so far was to use sf::st_union() which joins neighboring and intersecting polygons as i want, but…
trevi
  • 589
  • 1
  • 6
  • 11
11
votes
1 answer

Principal component analysis (PCA) of time series data: spatial and temporal pattern

Suppose I have yearly precipitation data for 100 stations from 1951 to 1980. In some papers, I find people apply PCA to the time series and then plot the spatial loadings map (with values from -1 to 1), and also plot the time series of the PCs. For …
Yang Yang
  • 858
  • 3
  • 26
  • 49
11
votes
2 answers

Check if points lies inside a convex hull

I am making a convex hull using the scipy.spatial package http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.ConvexHull.html#scipy.spatial.ConvexHull I've tried searching, but have yet to know if there is an easy way to find if any…
bjornasm
  • 2,211
  • 7
  • 37
  • 62
11
votes
3 answers

spatial clustering in R (simple example)

I have this simple data.frame lat<-c(1,2,3,10,11,12,20,21,22,23) lon<-c(5,6,7,30,31,32,50,51,52,53) data=data.frame(lat,lon) The idea is to find the spatial clusters based on the distance First, I plot the map (lon,lat)…
Math
  • 1,274
  • 3
  • 14
  • 32
11
votes
3 answers

How to use Spatial Data Types in asp.net vnext with EF 7?

in vnext, using Entity Framework 7 (https://github.com/aspnet/EntityFramework) how to use Spatial Data types (e.g. DbGeography) in model (code-first method) to save points, shapes etc. when creating model for a table. e.g. public DbGeography…
Vijayant Katyal
  • 642
  • 2
  • 12
  • 22
11
votes
3 answers

Query points within a given radius in MySQL

I have created the following MySQL table to store latitude/longitude coordinates along with a name for each point: CREATE TABLE `points` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `location` point NOT NULL, …
gjb
  • 6,237
  • 7
  • 43
  • 71
11
votes
1 answer

Spatial data structure for finding all points greater than or less than a value in each cartesian dimension

I am currently working on an optimization problem that requires finding all points greater than (or in some cases less than) a particular point in all cardinal directions. For example, in 2D, I might need to find all points that satisfy the…
MarkD
  • 4,864
  • 5
  • 36
  • 67
11
votes
4 answers

How can I divide the globe in to small grids such that it allows me to assign each lat/long location to a grid?

In order to calculate the nearest locations that are represented by latitude/longitude, I was considering dividing the map into small grids, approximately 100x100 meter grids. Essentially each point would be assigned to a grid. I understand that I…
Nishith
  • 268
  • 3
  • 9
11
votes
2 answers

Spatial matching of big datasets

I have a dataset with about 100000 points and another dataset with roughly 3000 polygons. For each of the points I need to find the nearest polygon (spatial match). Points inside a polygon should match to that polygon. Computing all-pairs distances…
krlmlr
  • 25,056
  • 14
  • 120
  • 217
11
votes
2 answers

How to Import shape file into MySQL

I need to import the spatial data in shape file into MySQL tables. I am able to import into PostGreSQL. Any pointers for MySQL. I need the data in MySQL table.
PhantomM
  • 825
  • 6
  • 17
  • 34