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

Sql Server Geometry Column causing query to take long time to run

I have written a query to fetch the polygon data from Sql database. I have following query to fetch the results. SELECT ZIP, NAME, STABB, AREA, TYPE, orgZc.OrganizationId, orgZc.[ZipCode] AS ORGzip, …
Chandra Mohan
  • 729
  • 2
  • 10
  • 29
0
votes
3 answers

all points within distance

I´m really desperate. What I wanna do ist: I have a list of 2d points L=[(22.37, 29.48), (20.50, 30.28), (20.50, 30.28), (20.77, 30.01), (20.77, 30.01), (21.04, 29.74), (21.04, 29.74), (22.58, 29.44), (22.78, 29.19), (23.11, 28.87)] (my list…
men in black
  • 193
  • 1
  • 1
  • 9
0
votes
1 answer

PostGIS's st_overlaps method is only returning results overlapping the LinearRing which makes up the exterior of the polygon I'm searching under

I'm using PostGIS on ruby/rails, and have created a simple box-like polygon under which I wish to search for land parcels in a county. The st_overlaps tool has worked for this before and it has worked this time, sort of. So I created the polygon to…
boulder_ruby
  • 38,457
  • 9
  • 79
  • 100
0
votes
1 answer

Whats the metric used in MYSQL Spatial?

I am trying to determine the metric system for MySQL Spatial 5.6.12. For example, I have the following table that created to store point geometry for multiple records. CREATE TABLE POINTS_DATA( RECORD_ID INT(15), STREET_ADDRESS …
user2052129
  • 231
  • 4
  • 11
0
votes
2 answers

How to check if spatial search is working in Solr

I'm trying out the spatial search in Solr. What I did was to stop the service, then updated the schema.xml file for collection1 to include the following:
user225269
  • 10,743
  • 69
  • 174
  • 251
0
votes
1 answer

Caching user-specific proximity searches

The situation and the goal Imagine a user search system that provides a proximity search from a user’s own position, which is specified by a decimal latitude/longitude combination. An Atlanta resident’s position, for instance, would be represented…
dakab
  • 5,379
  • 9
  • 43
  • 67
0
votes
1 answer

How do i get the nearest neighbor locations based on a LAT/LONG and a distance in MySQL?

I need to get a list of nearest neighbor merchant locations based on a Latitude and longitide and a distance parameter. For this, i have created a table using t the query below: **create table location.ML_POINTS_5K( MERCHANT_ID INT(15),…
user2052129
  • 231
  • 4
  • 11
0
votes
2 answers

Oracle spatial data operator - SDO_nn - Not getting any results for sdo_num_res = 1

I am using SDO_NN operator to find the nearest hydrant next to a building. Building: CREATE TABLE "BUILDINGS" ( "NAME" VARCHAR2(40), "SHAPE" "SDO_GEOMETRY") Hydrant: CREATE TABLE "HYDRANTS" ( "NAME" VARCHAR2(10), "POINT"…
Kalyanaraman Santhanam
  • 1,371
  • 1
  • 18
  • 30
0
votes
2 answers

SQL Geography Polygon lat longs exception

I am trying to parse an xml file which contains spatial references and I've come to a standstill when trying to create the following polygon. To try and overcome this I have been using SSMS to try and debug my problem. I am using SQL 2012…
Helix 88
  • 701
  • 6
  • 19
0
votes
1 answer

Solr 4 Spatial Query Filter still returns documents out of range

The Target is to perform multisort by score then distance, and to limit to a radius of 0.14 degrees I perform the following query: localhost:8983/solr/coll1/select?sortsq={! score=distance}locations:"Intersects(Circle(34.0031792,-118.3082034…
Omar
  • 8,374
  • 8
  • 39
  • 50
0
votes
1 answer

SQL Server Spatial Index Nearest Neighbour

I am trying to query geopoints for nearest neighbour, Whether I use spatial index or not, I always get similar times and it takes about 6 seconds. How can I speed this query up? Here is my query: Declare @param nvarchar(50); set @param =…
0
votes
1 answer

SQL Server 2008 spatial data select query

I am working on a project that maintains an SQL database. In this database I have a table called AirportZone with an attribute named "area" of type geometry. Also, I maintain a table OfferRequest with an attribute named "location" of type geography.…
nick.katsip
  • 868
  • 3
  • 12
  • 32
0
votes
2 answers

mysql: store latitude and longitude of a lot of POIs, using mysql spatial, and calculating distances

I've to create a db of a lot of restaurants in italy (>100000), and I'd like to create a "near me" function. I woud like to create a table containing latitude and longitude of all restaurants, and I've thought to use mysql spatial. Do you have any…
satboy78
  • 217
  • 1
  • 5
  • 14
0
votes
2 answers

Spatial Index Query in php

I'm trying to write a query in PHP for a spatial index. But I'm having trouble writing the query for the following line of code... SET @p = CONCAT('Polygon((',lat1,'',lon1,',',lat1,'',lon2,',',lat2,'',lon2,',',lat2,'',lon1,',',lat1,'',lon1,'))');
donalg d
  • 194
  • 4
  • 11
-1
votes
1 answer

How to do spatial left joins with a multiple join query

I have some data I'm trying to query thats a mix of spatial data and some non spatial data. Some of these tables contain a MDSYS.SDO_GEOMETRY spatial data, some don't. My query is so far as shown: select table1.col1, table1.col2, table2.col5,…
cpljp
  • 29
  • 5
1 2 3
27
28