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
1
vote
1 answer

dput() sp object in R

Is there a practical way to dput() an sp object in R? When I try to do the following: data(World, package = "tmap") dput(World[1:10, ], file=(tempFile <- tempfile())) World2 <- dget(tempFile) I get: > World2 <- dget(tempFile) Error in parse(file =…
dpprdan
  • 1,727
  • 11
  • 24
1
vote
1 answer

DistanceFromPoints with multiple XY coordinates

I'm trying to use distanceFromPoints function in raster package as: distanceFromPoints(object,xy,...) Where, object is raster and xy is matrix of x and y coordinates Now, if my raster has, for example, 1000 cells and xy represents one point, I get…
Amir M.
  • 71
  • 7
1
vote
1 answer

Difference between GTYPE and SDO_ELEM_INFO_ARRAY

I am learning the oracle spatial database, but am stuck on SDO_GEOMETRY. Actually this object has the following structure: CREATE TYPE sdo_geometry AS OBJECT( SDO_GTYPE NUMBER, SDO_SRID NUMBER, SDO_POINT SDO_POINT_TYPE, SDO_ELEM_INFO…
Bishwajit Purkaystha
  • 1,975
  • 7
  • 22
  • 30
1
vote
0 answers

MySQL spatial - within X km range

How can I effectively select all cities (points) within a radius of X km of a given coordinates (point) and order them by distance from MySQL table? I'm using MySQL 5.6 with the following table structure (imported from Open Street Maps): CREATE…
Sfisioza
  • 3,830
  • 6
  • 42
  • 57
1
vote
1 answer

spatial data clustering with sklearn

I have arrays of latitude and longitude data points which I want to do hierachical clustering. Here is my code: position = zip(longitude, latitude) X = np.asarray(position) knn_graph = kneighbors_graph(X, 30, include_self=False, metric=…
printemp
  • 869
  • 1
  • 10
  • 33
1
vote
0 answers

Finding nearest neighbour (log, lat), then the next closest neighbor, and so on for all points between two datasets in R

I have two datasets (csv format) of different lengths, both containing addresses as well as coordinates (log and lat). The both have this shape (example Dataset A): ID Address lat long 1 Lausitzer Strasse, 20/22, 2991, Lauta, Germany 51.46228 …
Nadja
  • 11
  • 7
1
vote
0 answers

Area calculation in R

So I haven been trying to calculate the total land loss due to climate change. The dataset that I use is from this website link This dataset consists of the longitude and latitude of the place that will most likely be lost. I want to calculate the…
Mathnoob
  • 13
  • 4
1
vote
1 answer

R Shiny: how to filter a dataframe before outputting a merged SpatialPolygonsDataFrame based on UI selectInput()?

At the moment I'm working on a dashboard-project to display store data on a leaflet map. I managed to do this without any (reactive) filtering input. A functionality I would like to add is to filter the stores. With this filter the user is able to…
Yoorizz
  • 217
  • 2
  • 12
1
vote
0 answers

Error save dbgeometry entity mysql

When trying to save via entity framework entity with DbGeometry field type in MySQL I'm having trouble. I can save a point, but LineString error. Can someone help me?
1
vote
1 answer

Spatial search for neighbor with distance limit?

In the example page it is shown how to do a neighbor search with a limit on the number of returned items. Is it possible to also specify a distance limit? I.e.: Return all items that are at most X distance from the point, and further limit the…
Roland
  • 7,525
  • 13
  • 61
  • 124
1
vote
1 answer

mongodb geospatial query for multyindex data

I have a collection of like so : db.records.save( { name : "John Smith", addresses : [ { context : "home" , loc : [ 55.5, 42.3 ] } , { context : "work", …
David Limkys
  • 4,907
  • 5
  • 26
  • 38
1
vote
1 answer

Snapping position to a grid that's size is <= 1

I'm creating a basic voxel editor that uses several different sizes of cubes. The user has a slider the use to control the current cube size their editing with, then when adjusted changes the scale of the cube to-be-placed and the guide grid. Now…
Keith M
  • 1,199
  • 2
  • 18
  • 38
1
vote
0 answers

spBayes spLM function with duplicate coordinates

I am using the spRecover function in package spBayes to produce a spatial univariate model. Here is a reproducible example where there I made a duplicate coordinate point. The modeling procedure itself executes just fine, but it won't let me recover…
makai
  • 31
  • 1
  • 8
1
vote
1 answer

How do I troubleshoot this CLR error in SQL Server spatial

I have the following query: Insert into PropertyTractsTemp Select P.field1 as field1 , P.field2 as field2, P.field3 as field3, P.field4 as field4, G.GEOID, P.field5 as field5 from…
arcee123
  • 101
  • 9
  • 41
  • 118
1
vote
1 answer

Inaccurate figure with Sql geography

I am converting geoFences into Sql geography instance.The problem currently is for some instance.The geography figure is pretty weird and inaccurate. The first one(green area) is a valid geofence and the second is which is created in sql. The…
Naved Mir
  • 97
  • 2
  • 9