Hot answers tagged point
Skip the trig, create view mypoints as select id, st_makepoint( st_x(st_endpoint(geom)) + (st_x(st_endpoint(geom))-st_x(st_startpoint(geom)))/2, st_y(st_endpoint(geom)) + (st_y(st_endpoint(geom))-st_y(st_startpoint(geom)))/2 ) as geom from mytable; then select geom from mypoints where id = 1; should work fine, for all values of id
You can't efficiently delete large numbers of features from a large table, period. You'd be much better off just marking them as deleted (available varchar(1), values 'Y' or 'N') and adding an attribute constraint to your selection logic (or using a view). Building a parallel table to house a foreign key and available field is an adequate solution, though ...
A quick Google search turned up: Spar Point Group has a nice writeup on several web-based point cloud viewers at http://www.sparpointgroup.com/blogPost.aspx?id=3879 This viewer is just too cool: http://lidarview.com/ PointCloud looks promising, and supposedly is free: http://pointcloud.io/
You probably need a combination of ST_Dump() and ST_Distance() (with ORDER BY and LIMIT) in the solution. I think we really could benefit from a ST_ClosestVertex() and maybe a ST_SnapToVertex() function added to PostGIS.
There is also an earlier Select features at random script from Stephen Lead available for ArcGIS Desktop. Although written, I think, for ArcGIS 9.x, and last modified in 2008, I used it in about 2010 at 10.0, and it still worked well.
Because the points for each id are already sorted, you can solve with: ogr2ogr -dialect SQLite -sql "SELECT MakeLine(geometry), id FROM Muenster GROUP BY id" Muenster_lines.shp Muenster.shp Then you can easily join the single lines and obtain the result path, as shown below:
The "Layer input already exists" error is due to an existing file "output.csv", presumably from a previous attempt. This file needs to be deleted to make a new file (the -overwrite option sometimes works, but not always). From POSIX shells, use rm output.csv, or from a Windows shell, use del output.csv To only show X,Y fields, provide an empty select field ...
The error depicts that system don't have permissions to overwrite/append the output csv file because you have not mentioned it in your gdal ogr2ogr command. Possible solution can be addition of these Params in your command Ogr2ogr -f 'CSV' output.csv input.shp -lco GEOMETRY=AS_XY -append I hope it will help.
Generally, I also recommend using the spatial ecology tools as discussed by blah238. However, another method you could try would be to add an attribute called Random to store a random number: Then, using the field calculator on that attribute, with the Python Parser, use the following codeblock: import random def rand(): return random.random() See ...
Here's another random selection add-in for ArcGIS 10, the Sampling Design Tool. It will let you select 20% of the features in your dataset. However, this doesn't use a selected set to make a random selection, similar to the restrictions of the Hawth's Tools mentioned by blah238.
Only top voted, non community-wiki answers of a minimum length are eligible