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

Query Optimization: Select polygons that intersect points

I have two Oracle 18c tables: ply — Polygons: 4970 rows. pnt — Points: 3500 rows. The shapes are stored in SDO_GEOMETRY columns. Edit: I realize now that most of the points are duplicates (spatially). But I don't think that’s a problem. The data…
User1974
  • 276
  • 1
  • 17
  • 63
3
votes
1 answer

How to fix postgresql update with join performance?

I hawe geospatial tables named node and ways. I want to set end_node_id column of ways table with node table attribute using spatial join. two tables have about 100K data. update ways set end_node_id = n.node_id from ways w inner join …
barteloma
  • 6,403
  • 14
  • 79
  • 173
3
votes
1 answer

MySQL Spatial Data Type Indexing Performance Comparison

Would a MBR function query against an indexed column with geometry type containing points and polygons (GeomCollection type) be slower than a MBR function against an indexed column with a polygon type? My programmer instincts tell me that it would…
Nate
  • 1,889
  • 1
  • 20
  • 40
3
votes
3 answers

Spatial index/query (finding k nearest points)

I have +10k points (latitude, longitude) and I'm building an app that shows you the k nearest points to a user's location. I think this is a very common problem and I don't want to reinvent the wheel. I'm learning about Quadtrees. It seems to be a…
ccarpenterg
  • 779
  • 2
  • 10
  • 11
3
votes
1 answer

Hololens Spatial Understanding Calculating Measurements

I have been reading through related holotoolkit spatial understanding codes but could not find anything related to getting the dimentions of found table. I followed this great tutorial to add table as custom shape. But then stuck on the…
firativerson
  • 435
  • 1
  • 4
  • 14
3
votes
0 answers

JPA criteria: spatial restrictions

I cannot find any way to use spatial criteria with Hibernate 5.2. Using criteria is not a problem: CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery cq = cb.createQuery(geoObjectClass); Root root =…
3
votes
2 answers

Spatial Search in Azure Search .NET client API

How can I do a spatial search using the Azure Search .NET SDK? The question has been answered for the REST API here: SO thread for REST API How can I do the exact same using the .NET client API? To be more specific: How do I need to define the…
Marc
  • 12,706
  • 7
  • 61
  • 97
3
votes
0 answers

SSRS - Spatial Data/Map report issue

I'm having trouble implementing what I feel should be a fairly basic report in SSRS (SQL Server 2014 and VS2013 Shell). I work for a company based in the UK and I want to show various data using the Maps functionality. To start with I simply want to…
3
votes
3 answers

Return multiple rows from procedure , select statement PL/SQL

This is the procedure section of an anonymous block from which it takes the parameter pID, parcel_id. My problem is the select statement is meant to find and display all parcels that touch the query parcel and it works perfectly fine in a normal SQL…
Delta1x
  • 83
  • 1
  • 3
  • 10
3
votes
1 answer

Spatial query: A .NET Framework error occurred during execution of user-defined routine or aggregate "geography":

I am trying to create a parameterized stored procedure from a spatial query (SQL Server 2016). The underlying spatial query works fine when the parameter (@long/ longitude) is hard coded (e.g 174.7115) . When I attempt to create a Stored Proc with…
Steve
  • 475
  • 4
  • 12
  • 25
3
votes
1 answer

Returning Polygon Name that contains a point in SQL Server 2014

I have a table of 40 polygons, they contain name, id and the geometry. I have a second table of addresses with it's own geometry represented as points. I have aggregated the 40 polygons using geometry::UnionAggregate. I want to be able to return the…
SSingh
  • 153
  • 3
  • 13
3
votes
2 answers

Get area of municipality

I am using stSPARQL and the ref says: xsd:float strdf:area(strdf:geometry A): Returns the area of the surface if it is a polygon or multi-polygon. and so I am trying: PREFIX geo: PREFIX rdf:…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
3
votes
2 answers

hibernate-spatial: can't find function

I'm having a problem while using H2 and GeoDB (in-memory, junit). Also, using Hibernate 5 (latest versions for each package, including hibernate-spatial) and Spring 4. Persisting and querying by id entities works just fine. Geometry types are…
Stefano Cazzola
  • 1,597
  • 1
  • 20
  • 36
3
votes
1 answer

Can I query a DocumentDB document with a bounding polygon, by a nearby polygon?

Like many people I was excited when the Microsoft Azure team announced support for spatial queries in DocumentDB two months ago. In particular, DocumentDB supports the ST_DISTANCE query which allows you to query documents by their distance from…
08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
3
votes
0 answers

Construct lineString from points in mysql

Giving the following table (Position) +--------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra …