3
votes
2answers
57 views

Distance calculation PostGIS

I've got the following task to solve: I've got two tables; one contains buildings (houses) as points and the other contains train-stations (at_bhf_classified) as points. I need to find out the ...
3
votes
2answers
136 views

clustering points in postgresql to create contour map

UPDATE: To try to make this a little more simple, is it possible to create a query which selects a group of points such that each point in the group is at most X units away from at least one other ...
2
votes
1answer
48 views

using PostGIS to calculate distance of a route over a large area

I'm new to PostGIS and looking to measure the distance of the Pacific Crest Trail which spans western North America from Canada to Mexico. I have a data set containing the lat lon and dates from GPX ...
4
votes
1answer
88 views

Proximity search: ST_DWithin vs ST_Distance?

I have records stored in a table with latitude/longitude coordinates stored in a geometry field. I want to find all records nearby a user supplied reference point. Note "nearby" probably means less ...
2
votes
2answers
180 views

Postgis, get the points that are x meters near another point, in meters

I'm trying to find the points within a certain distance, in meters, from another point. I'm using the function ST_Buffer, but I don't get how to express the distance in meters. I'm trying with ...
4
votes
2answers
186 views

How to calculate the azimuth of a line of a multilinestring in PostGIS?

I have two spatially enabled tables in PostgreSQL with a geometry in each: First table is with POINT type, second is with MULTILINESTRING. I need to calculate the azimuth of the LINESTRING part of a ...
0
votes
3answers
208 views

Return all results within a 30km radius of a specific lat/long point?

I have a table with a column the_geom which contains data similar to: ...
0
votes
1answer
37 views

Can distance be calculated to a destination feature based on an attribute in the source?

All, Is it possible to specify which destination point to calculate distance to based on an attribute in the source? STDistance will give me the distance each student (point) is to their closest ...
0
votes
0answers
26 views

Bounding Boxes around nearby points [duplicate]

I've got a table with 200.000 points. My aim is to draw bounding boxes around points where this point have the same name and that are in a maximum distance of 500 meters to each other. I guess I can ...
1
vote
1answer
165 views

Mimimum distance between points (Postgres/PostGIS)

I have a table (tab_Cities with cities which own more than 50000 inhabitants. The table also contains lat, long and the_geom as columns. I can already see the points via QGIS. Now I want to write a ...
2
votes
2answers
178 views

Finding points along a path

I am unsure of the best approach to this problem. I can think of some ways of doing it which I will list below but I am looking for the best and most efficient way of doing this. Problem Given a ...
0
votes
1answer
89 views

How to visualise “distance from amenities”?

I'm interested in calculating for every point the distance to the nearest amenity of each of a certain number of types (train station, supermarket and so on). I think the calculation will be ...
1
vote
1answer
82 views

PostGIS integer loop

PostGIS is very new to me, and I'm having difficulty performing an operation that probably isn't too difficult. I have vector layers each filled with the outline of a landmass through time. I want to ...
3
votes
3answers
223 views

Why is sum of st_length() of segments 20% too big?

I'm running a query to return the total length of some bike paths, from OpenStreetMap. Compared to the known actual length of these paths, they're all a bit too big - something like 10-30%. I know it ...
1
vote
0answers
41 views

windows function with points in a mixed (multipoint/point) table

I have a table comprising multipoints (tracks) and points (stops between tracks). there can be several consecutive multipoints. now, i want to merge any points lying very closely to each other ...
1
vote
1answer
568 views

Distance between DB field and Point using PostGIS

I'm using Postgresql 9.0 with PostGIS 2.0 extension. I've got the table and geographic field location: =# SELECT * FROM geography_columns; f_table_catalog | f_table_schema | f_table_name | ...
4
votes
2answers
420 views

ST_Distance is not delivering right results

I want to calculate the distance between lat/lon points. I tried the following queries: Select ST_DISTANCE(ST_GeomFromText('POINT(-73.97923 40.75571)', 4326), ST_GeomFromText('POINT(-73.974509 ...
1
vote
1answer
740 views

postgis distance calculation between points with lat, long coordinates

Team, I am new to postgis, but a postgres user for quite a while. I would like to compare the geospatial capabilities between postgresql and mongodb. I have the lat.lon, zip code of US locations; ...
1
vote
1answer
299 views

Accurate and fast nearest neighbour, which distance function should I use and how to it speed up? [duplicate]

I am solving the following problem: I have a map with many points in it and I need to find the nearest point to given location. Each point carries information about it's latitude and longitude. This ...
6
votes
4answers
444 views

How to calculate the “depth” of a linestring using postgis

I have linestring features, which look like bent linestrings, hemicycles or convex or concave linestrings. In the moment I can select the distance between the startpoint and endpoint of each feature. ...
0
votes
1answer
107 views

How to find features within a distance? [duplicate]

I insert the values from lat/long into the points. Those users move around and send me new Lat/long and of course , I made an update of the position. I need to find people that are in a distance ...
2
votes
3answers
688 views

Calculate min distance between points in PostGIS

I have point layer in PostGIS database. Help please with query which add for each points in layer distance in attribute table between this point and another nearest point. Thanks! Update Calculate ...
1
vote
0answers
22 views

How to perform a join on simultaneous spatial and attribute criteria in PostGIS [duplicate]

Possible Duplicate: How to perform a join on simultaneous spatial and attribute criteria in ArcGIS? I have two point layers and want to perform a spatial join on nearest distance. I have a ...
2
votes
1answer
419 views

Getting points within a range from a postgres database?

ok so this is query i'm making which returns no result: SELECT building.gid FROM building WHERE ST_Dwithin(building.geom, ST_GeomFromText('POINT(long lat)',4326), 400) If I run this ...
1
vote
1answer
284 views

PgRouting Driving Distance crashing postgis server

I haven't used PgRouting much so I'm a little in the dark here. However, I am attempting a driving distance calculation like the one described by Underdark here. My SQL is identical, I have a ...
0
votes
0answers
403 views

Implementing custom (Vincenty/Haversine formula) functions for MySQL vs Using PostGIS?

I currently am using MySQL for all of my relational data. I have hit a crossroads with geo calculations. Since, MySQL does not have good support for spatial functions, I am contemplating on using ...
2
votes
1answer
660 views

MySQL GeoSpatial function for ST_Distance_Spheroid? Metric used in return Type of GLength?

Is there a ST_Distance_Sphere, ST_Distance_Spheroid equivalent function in MySQL's GeoSpatial Support? If not, any way to emulate this? What is the metric used in return type of ...
8
votes
1answer
681 views

PostGIS - Calculate progressive distance between points on a GPX path

I am attempting to build an elevation profile using PostGIS-PostgreSQL only. I have imported GPX data in my PostGis database, so now I have a table full of the GPS coordinates of the track and the ...
1
vote
1answer
346 views

PostGIS - table with 3d points with fast ordering by distance

I am pretty new to PostGIS and I am trying to solve the following problem. I need a table with 3D points (x,y,z) that will contain around 1-10million points. I want to be able to efficiently ask the ...
5
votes
1answer
532 views

How to find the two furthest points between a group of points?

I have a table with 20000 records and with those columns Shop, longitude, latitude, geom I would like to find a way to find the pair of ths farthest shops between a selection of shops For example we ...
3
votes
2answers
1k views

How do I get the distance meter value between two geometries in PostGIS?

I have a simple question about calculating distances in PostGIS. I would like to get the distance between two geometries. I am using this sid : 4269 in meters what i am doing now is this : ...
5
votes
1answer
2k views

How do I perform a proximity search with Postgis?

OK, so I downloaded the Geonames database (cities1000) and wrote a small Ruby program to import them into my table (geo_cities). I then added geography column called geog. So after all of that, I ...
5
votes
1answer
4k views

Simple PostGIS ST_Distance query for two points from the same geometry table?

Note: This question was published at Stackoverflow at first. I have a geometry table points_table with SRID 4326 and a few points in it. I need to find a distance between a pair of points (features) ...
3
votes
2answers
582 views

Total great circle distance along a path of points (PostGIS)

I am looking for an SQL query that sums the distances between a series of points using PostGIS. The situation is as follows: I have 2 tables: tracks and points. Points belong to a track and thus ...
3
votes
1answer
635 views

clip linestring by length

Is there a way to clip a linestring based on distance? For example, linestring from a to b is 150 meters. I would like to get the linestring from a to a point that is is 75 meters away from a ...
4
votes
3answers
426 views

How to efficiently find points within an elliptical area?

Using PostGIS 2.0.0 I need to filter the results of a function, which returns many POINTs, to find the ones that lie within an elliptical area defined by two points and a distance (all parameters ...
2
votes
2answers
1k views

ST_Distance versus ST_Distance_Spheroid?

As my client software uses lat/lon coordinates when communicating with my (spherical mercator) postgis database i decided to ST_Transform every geometry to WGS-84. However i noticed that ST_Distance ...
5
votes
2answers
410 views

PostGIS ST_Distance vs. pgRouting

I am looking to create a city directory web app, and the site will need to be able to calculate distances between two geospatial points (like the distance between the user and a restaurant, or the ...
3
votes
1answer
775 views

Distance between points and polygons in QGIS / PostGIS

I need to work out the distance between a table of polygons and a table of points. The table of polygons has different site boundaries, and the point table has points relating to each of the site ...
2
votes
1answer
1k views

Using a geodjango PointField with geography=True, my distance calculations are wrong

Here's my model: class ExchangeArea(models.Model): """ An Exchange Service Area, calculated from a phone exchange and surrounding census tracts. """ coordinates = ...
5
votes
1answer
2k views

Calculate distances between series of points in postgis

I have a postgres/postgis table containing a series of sequential points. I want to add a new column to the table which contains the distance between each point and the first one, and so forth until ...