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

Handling many points at one position in R

I have a question regarding data handling in R. I have two datasets. Both are originally .csv files. I've prepared two example Datasets: Table A - Persons http://pastebin.com/HbaeqACi Table B - City http://pastebin.com/Fyj66ahq To make it as less…
schlomm
  • 551
  • 2
  • 11
  • 22
3
votes
1 answer

How does SqlGeography.Reduce method works?

How does this API works? I am using some complex geography with ~2000 points (geometry of a river). While reducing with tolerance 2048, it works fine. But while reducing with tolerance factor 4096, it throws exception "24205: The specified input…
malay
  • 1,434
  • 4
  • 17
  • 28
3
votes
1 answer

PostGis insert Rectangle

Hi all i have a question: how i can insert a box (rectangle) with Ne_latitude, NE_longitude, SW_latitude, SW_longitude inside a postgis database and build an INDEX on top for retrieving the intersection between the different boxes? Thanks in advance
Asp1de
  • 151
  • 2
  • 12
3
votes
1 answer

Spatial SQL query showing parcels containing centroid of building

I am trying to write a query that selects parcels that contain the centroid of a certain building code (bldg_code = 3). The parcels are listed in the table "city.zoning" and contains a column for a PIN, geometry, and area of each parcel. The table…
mbcaradima
  • 251
  • 2
  • 11
3
votes
1 answer

postGIS applications

I would like to learn how to build applications using postGIS. I am wondering if there are good open source examples out there that I can take a look at? I am particularly interested in those that not only use postgres to store the map data but make…
JRR
  • 6,014
  • 6
  • 39
  • 59
3
votes
0 answers

Convert a rectangle to ranges of Hilbert numbers

When spatial data is represented using Hilbert numbers, a rectangular range is mapped to multiple ranges of Hilbert numbers. Is there any quick way to find this mapping without going through every cell the given rectangle, R, overlaps with? I can…
3
votes
1 answer

SQL Server 2008 Spatial Query. How to group polygons if they intersect each other?

In my table there is a geometry field that stores polygons. The polygons that intersects each other must be attached to and form a single polygon (see below) (source: location-world.com) The results can not be calculated but must be executed on…
3
votes
1 answer

Most efficient MySQL solution for querying against coordinates

I have a database of geolocalized objects: id latitude longitude I am querying the database to fetch objects that are inside a box: WHERE longitude >= - 33.83789 AND longitude <= 33.837891 AND latitude >= 4.214943 AND latitude <=…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
3
votes
1 answer

"Unable to determine the spatial data type in the specified dataset field..." using the map layer wizard

I'm using the map layer wizard for the first time in SSRS so we can add spatial data to the map. We get this error from the wizard: Unable to determine the spatial data type in the specified dataset field... The data type for the spatial data is…
Emad-ud-deen
  • 4,734
  • 21
  • 87
  • 152
2
votes
1 answer

sdo_relate ORA-13343: a polygon geometry has fewer than four coordinates

I am trying to do a SDO_relate however it is returning an error. My code: ON sdo_relate (f.tls_da_location, ntp.boundary, 'MASK=ANYINTERACT') = 'TRUE' WHERE ntp.boundary IS NOT NULL I have tried this and sdo_util.getnumvertices (ntp.boundary) >…
Marc
  • 81
  • 5
2
votes
0 answers

stSPARQL / GeoSPARQL ERROR - Problem with Intersection between Spatial data - Geometries

Hello everyone and have a Happy New Year!! I am using an StSparql/Geosparql endpoint and I have a spatial dataset which has geometries for lakes and rivers. My goal is to try and find all the lakes and rivers which intersect each other and display…
2
votes
1 answer

Exclude the geometry based on buffer from the bigger geometry

I have a multipolygon geometry in which polygon geometry is scattered. I want to exclude the geometry which is not part of the big geometry. For e.g. The below image is one region with one of the polygons is too far. I want to exclude that polygon…
user1298426
  • 3,467
  • 15
  • 50
  • 96
2
votes
1 answer

How to use PostGIS to buffer a point layer and find if points fall within these buffers, ignoring each buffer's own central point

I have a table containing point geometries and a buffer_distance column. I want to create a buffer around each point using the buffer_distance column and check if any point is within each buffer but making sure to ignore the point at the center of…
2
votes
0 answers

Error from nested query with GeoDjango

I'm having trouble constructing nested queries using in field lookup in GeoDjango. The following code demonstrates the problem: inner_qs = Footprint.objects.filter(geom__bboverlaps=bounding_box) outer_qs =…
ejel
  • 4,135
  • 9
  • 32
  • 39
2
votes
1 answer

Create area that cell tower covers

I have a dataset with cell tower information, as you can see below. The lat and lon fields are the location of the tower. The objective is to get the area (geometry) of the sector the cell tower covers, from start_angle to end_angle. As you can see…