Questions tagged [spatial-query]

a special type of database query on geodata

A spatial query is a special type of database query supported by geodatabases and spatial databases.

Unlike non-spatial SQL queries, these queries use geometry data types such as points, lines and polygons and they consider the spatial relationship between these geometries.

Implementations vary between databases, for instance by adding an extension like for PostgreSQL or using a planar spatial data type like geometry in Microsoft SQL Server.

416 questions
2
votes
1 answer

SQL Server 2008 Spatial Query performance

I have an application where user's store their commute routes in our database. The routes are stored as polylines (linestrings). The database also stores incidents, traffic accidents that kind of thing. Periodically we need to query a route to see…
CianM
  • 397
  • 5
  • 17
2
votes
1 answer

AS3 with Nape physics: How can I find a tangent from a point to a body?

The short question: Is there any simple way in Nape to calculate the points of tangency with a Nape body object or shape given a point outside that body? What I'm trying to do is create Worms-style rope physics. It basically works as an extendable…
Eric N
  • 218
  • 3
  • 13
2
votes
1 answer

Wrong sorting results with spacial index in Raven DB

When I try to take the 10 latest results (oder by date desc) from my index, I receive old documents. It look like the query take 10 outdated items and sort it. I have this problem when the query have many results to play with. Here's my index…
FouZ
  • 61
  • 7
2
votes
1 answer

How to perform MySQL spatial buffer function successfully?

Does anyone ever use MySQL spatial buffer function successfully? I've read the documentation here: http://dev.mysql.com/doc/refman/5.0/en/functions-that-create-new-geometries-from-existing-ones.html#function_buffer As stated in the documentation,…
goFrendiAsgard
  • 4,016
  • 8
  • 38
  • 64
2
votes
1 answer

In rtree, how can I specify the threshold for float equality testing?

In rtree, how can I specify the threshold for float equality testing? When checking nearest neighbours, rtree can return more than the specified number of results, as if two points are equidistant, it returns both them. To check this equidistance,…
1
vote
3 answers

Return records in chronological order, given a separation factor

I have a massive table in SQLServer 2008, it contains the position reported by technicians every minute. I need to report on this table but in order to control the amount of records that are displayed in the report both a time and distance…
Raciel R.
  • 2,136
  • 20
  • 27
1
vote
1 answer

ActiveRecord::UnknownAttributeReference: Query method called with non-attribute argument(s)

I'm trying to use spatial distance in my Rails app, but I keep running into the "ActiveRecord::UnknownAttributeReference: Query method called with non-attribute argument(s)" error when I try to use the order method. Here's my code: def…
Yousuf
  • 61
  • 5
1
vote
1 answer

Return a list of IDs in which geometry connect to each other with SQL Amazon Redshift

I have a list of geometry IDs which contains the Linestrings. I want to create a query that returns the object IDs as a LISTAGG from those that connect to each other. Here an example of a geometry I have with their IDs: I want to input all IDs into…
1
vote
1 answer

Balanced Tree structure for storing and updating 3D points

I'm on an odyssey to find a good tree structure to store and update my application data. The data are positions in 3 dimensions (x, y, z) They need to be able to be updated and queried by range quickly (every 30 milliseconds). The queries would be,…
PacaPaw
  • 13
  • 1
  • 4
1
vote
3 answers

convert Array of polygons to Multipolygon

I have an array of Polygons. I need to convert the array in to Multipolygon. ["POLYGON ((-93.8153401599999 31.6253224010001, -93.8154545089999 31.613245482, -93.8256952309999 31.6133096470001, -93.8239846819999 31.6142335050001, -93.822649241…
code_bug
  • 355
  • 1
  • 12
1
vote
1 answer

Correct way of writing a filter query on a geodjango model (finding out if a multipolygon field contains a point)

I am new to geodjango and trying to build an application after going through the tutorial. So, I have this model: from django.contrib.gis.db import models class CountryBorder(models.Model): f_code = models.CharField(max_length=5) name =…
musical_ant
  • 143
  • 2
  • 7
1
vote
1 answer

Get SRID of geometry column in exasol (ST_SRID equivalent)

It seems that there is no ST_SRID function in exasol like in other DBMS: SELECT ST_SRID(geom) FROM sampletable Is there an efficient workaround to determine the SRID of a geometry column? So far I only had success in parsing the COLUMN_TYPE string…
NielsFlohr
  • 183
  • 7
1
vote
2 answers

Why in my case ST_DWithin is not using index

I'm using Postgis extension for Postgres and trying to optimize my query for searching points in circle. Consider I have this table with index: create table position ( id bigserial not null primary key, date timestamp with time zone, point…
1
vote
1 answer

PostGIS Intersect to update a field based on intersected State

I'll admit I'm a little out of my element with PostGIS and spatial geometries in a DB but here's what I'm after: I need to update a field with the determined intersected US State of a geom of an object if it doesn't yet already have one. The DB…
Vaesive
  • 105
  • 1
  • 11
1
vote
1 answer

Convert Unknown ESPG to ESPG 4326

In running a spatial query in postgres, I got the following error: psycopg2.errors.InternalError_: lwgeom_intersection: GEOS Error: TopologyException: Input geom 1 is invalid: Self-intersection at or near point 676597.26377722982 3673373.5709498846…
CNIDog
  • 374
  • 3
  • 18