geospatial

PostgreSQL: Casting two separate numeric values to a point

I'm trying to change the application schema of a database in Postgres...so I need to copy data from one table to another. In the original table, co-ordinates are specified as numeric values in two separate columns, one for the x value and one for the y value. In the new table, the co-ordinates need to be stored as one value of the point ...

What is the best way to efficiently calculate which points are close to a given lat/long using MySQL?

I'm trying to design a MySQL schema that can store a list of users with an associated latitude and longitude. I would then, for a given user, like to build a query which can return the nearest 50 users to him/her and sort those users by distance (with the nearest being presented first). Given that there may be many thousands of users ...

Geographic grid search algorithm

Many of the location based services provide APIs for finding places/venues/spots around a given latitude longitude pair. I'm looking into how I can search for these places across an entire city. I can build a grid for a city by getting its bounds from the Google Maps Geocoder and then incrementing the lat/longs to lay down points to fo...

SQL query to query nearby points of interest based on lat/long - SQLite

Given a database that contains three fields: Latitude Longitude Proximity Where Lat and Long are GPS coordinates, and Proximity is (some unit - feet? Seconds? Minutes?) And given the user's current GPS lat/long... I want to write a SQL query that will retrieve all rows where the user is within "Proximity" of those rows. And the tric...

SQL 2008 Spatial ordering of objects

I have a dataset containing the start and end points (both OSGB36 and corresponding WGS84 coordinates) of sections of a road network. I am able to import this data in SQL and create geometry and geography data types for the start and end points and for the entire object (LINESTRING etc). Viewing the coordinates in SQL query window enab...

How can I show different points with different markers( as image) using database on Report Builder 3 .0?

Hi, i encountered some problems on Report Builder. i created two tables. One of them includes geospatial data(points), city name and city code. other includes city code and its image(each city has own image). these tables have relationship as you see. date type of Fiels : geom : geography cityname: varchar(50) citycode : varchar(1...

OpenJUMP Error: Relation does not exist

I am trying to open a dataset through a data store layer in OpenJUMP. I have successfully made the connection to the project that I have created with Postgres. However, when I select the dataset that should be loaded, OpenJUMP gives an error message saying that the relation does not exist (Runtime Exception, PSQL Exception) What could be...

Database procedure for locations

Hi, I'm trying to store a database of GPS locations and run queries which find the points within a given radius and also the closest points. I'm using mysql and have been looking at the spatial extensions. I am not sure if i see how to actually use the spatial extensions to do what I'm looking for in the location radius queries. So h...

How do I guess which geografic projection system is used for a dataset?

I have a bunch of shapefiles to convert to kml. I can open them, but I don't understand the coordinate systems they are in (nor was it provided by the creators). For instance, this should be a point on the border of the city of Amsterdam: 'x': 106980.0, 'y': 491810.0. Ideally I'd love to find a website, a library, a script, an oracle,...

How do you use MySQL spatial queries to find all records in X radius?

I have a table in a MySQL database with a spatial geometry column of type POINT. I'd like to be able to take a point at the center of a map and find all records within X miles (or whatever distance) of it. I can't seem to find a good example or explanation of how to do this that doesn't get heavily into geometric math. I'm happy to go th...

Determine compass direction from one lat/lon to the other

Does anyone have an algorithm to determine the direction from one lat/lon to another (pseudo-code): CalculateHeading( lat1, lon1, lat2, long2 ) returns string heading Where heading is e.g. NW, SW, E, etc. Basically, I have two points on a map and I want to get a general idea of the direction taking into account that 50 miles East an...

How can I get the installed GDAL/OGR version from python?

How can I get the installed GDAL/OGR version from python? I aware of the gdal-config program and are currently using the following: In [3]: import commands In [4]: commands.getoutput('gdal-config --version') Out[4]: '1.7.2' However, I suspect there is a way to do this using the python API itself. Any dice? ...

How to implement Spatial(Geo-Location) searching in Grails?

Hi, I am working on Grails 1.3.2 with MySql. I need to store the latitude and longitude of certain locations in the database and then on the basis of the user's current location, I need to return the items that are within a particular radius of that location. So, we basically have the following requirements: Search for places with-in ...

Google Earth Determining zoom level from bounding box

Hi guys, I got a Windows Forms app making use of Google Earth where users can draw a polygon on the map which is used as a geofence. What I'd like to do is to be able to zoom to the polygon so that it fits nicely on screen with a click of a button. A sort of zoom to fit function. Finding the centre of the polygon and setting the Googl...

Is it possible to connect Oracle with ArcGIS for doing spatial query?

Is it possible to connect Oracle with ArcGIS for doing spatial query? ...

Unions of polygons (ST_UNION for Geography type)

Hi everyone, I am looking for a function that will return the intersection of 2 or more polygons (geography type). I am aware of ST_UNION, ST_COLLECT but it works only for geometry type. Any tip will be really appreciated ...

Work flow for georeferencing imagery using open source tools?

Does anyone have a recommendation for a work flow for georeferencing high resolution aerial photography using open source tools? I have GPS coordinates for control points and would need to associate them with the imagery (I do not know the pixel x,y values). Also, any open source options that can perform more sophisticated correction l...

countouring two xyz files

i have two spatial xyz file with different resolution how can i contour a composition of both files i like working with R or open source geographical systems like GMT if u know of a different way of solving this i would be glad to listen ...

Geometry: find point a specific distance between two points

This is similar to this question, but kind of the opposite. I have two geographic points (latitude, longitude) A and B. Let's say they're 40 nautical miles apart. I'd like to calculate the coordinates of the point 10 nautical miles from point A, on the line between A and B. I'm sure this is very basic math, but it's been YEARS since I'v...

how to store spatial files in MySQL

what is a better way to store spatial data in MySQL (say tracks) internally or as references to the external flat files? ...