Re: [postgis-users] Using raster2pgsql on a system withno postgresqlinstall
Bborie / Jorge, does it make a difference anymore if I compile w/wout GEOS? e.g. are their some formats that need geos if I don't or other idiosyncracies. I think it used to. From my testing, you don't need to compile GDAL with GEOS. I think GEOS is used for ogr operations (spatial processing?) but I've never used those functions. -bborie -- Bborie Park Programmer Center for Vectorborne Diseases UC Davis 530-752-8380 bkp...@ucdavis.edu ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
[postgis-users] Sampling a line shapefile based on own criteria
Hello, I was looking in internet a way to sample my line shapefile based on my onw decision, for instance, my line is 1-km long and I want three scenarios: (a) 1 point every 50 meters (20 points including starting and ending points), (b) 1 point every 20 meters (50 points including starting and ending points), (c) 1 point every 10 meters (100 points including starting and ending points). I appreciate your ideas about it. Thanks, Gery ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Sampling a line shapefile based on own criteria
Hi Gery, here an example for scenario (a) SELECT ST_Astext(ST_Line_Interpolate_point (the_geom,ser::float/20)) as points FROM (SELECT ST_GeometryFromText('LINESTRING(0 0,1000 0)') as the_geom) as foo1, generate_series(1,20,1) as ser You can easily make a function HTH, Fred On Mon, Jan 9, 2012 at 5:48 PM, Gery . gameji...@hotmail.com wrote: Hello, I was looking in internet a way to sample my line shapefile based on my onw decision, for instance, my line is 1-km long and I want three scenarios: (a) 1 point every 50 meters (20 points including starting and ending points), (b) 1 point every 20 meters (50 points including starting and ending points), (c) 1 point every 10 meters (100 points including starting and ending points). I appreciate your ideas about it. Thanks, Gery ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] new functions
Also another comment for your transrotate function: you can use 1 call to ST_Affine, rather than 3 indirect calls with st_rotate(st_translate(st_rotate(. You just need to wrangle the trigonometry in the affine transformation matrix correctly. I have an enhancement for a st_rotate with a point of origin in trac, where you can see how to use ST_Affine for this purpose: http://trac.osgeo.org/postgis/ticket/1251 -Mike ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Sampling a line shapefile based on own criteria
Hi Fred, Thank you very much for your answer, I'll try your code dude. One thing I forgot, how about if I want just to sample the line shapefile based on a number of positions, ie. the line is 1 km and I want 1000 positions or points, should I modify the code like this? SELECT ST_Astext(ST_Line_Interpolate_point (the_geom,ser::1000)) as points FROM (SELECT ST_GeometryFromText('LINESTRING(0 0,1000 0)') as the_geom) as foo1, generate_series(1,1000,1) as ser Thanks again, Gery -- View this message in context: http://postgis.17.n6.nabble.com/Sampling-a-line-shapefile-based-on-own-criteria-tp3518606p3521504.html Sent from the PostGIS - User mailing list archive at Nabble.com. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Sampling a line shapefile based on own criteria
Hi Gery, devide the length of th line by your amounts of points-1 and use the function ST_Line_Interpolate_Point() to calculate the points on the line. See http://postgis.org/documentation/manual-1.5/ST_Line_Interpolate_Point.html for the function. Best Regards Peter Universität Rostock Agrar- und Umweltwissenschaftliche Fakultät Professur für Geodäsie und Geoinformatik Justus-von-Liebig-Weg 6 18059 Rostock Tel: 0381 498 3212 Fax: 0381 498 3202 Am 09.01.2012 18:48, schrieb Gery .: Hello, I was looking in internet a way to sample my line shapefile based on my onw decision, for instance, my line is 1-km long and I want three scenarios: (a) 1 point every 50 meters (20 points including starting and ending points), (b) 1 point every 20 meters (50 points including starting and ending points), (c) 1 point every 10 meters (100 points including starting and ending points). I appreciate your ideas about it. Thanks, Gery ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Sampling a line shapefile based on own criteria
The code works really good, I tried it already and it gives the distance, really nice!, thanks Fred again :) now I'm a bit confused, I'll try to explain it below, hope I can explain it well :p, my table looks like this: db=# select gid,profile,seg_fldr,dist_dd,dist_m from dd_line_smoothline; gid | profile | seg_fldr | dist_dd | dist_m -++--++--- 1 | 20111220102834P-LF | 7281 | 0.02525395 | 2416.5765 2 | 20111220105932P-LF | 4997 | 0.02487362 | 2375.0371 3 | 20111220112109P-LF | 5342 | 0.02502609 | 2390.6025 ... ... and I need to do it one by one, I did using the seg_fldr and dist_dd info in the 1st row: select st_astext(st_line_interpolate_point(geom,ser::float/7281)) as points from (select st_geometryfromtext('linestring(0 0,0.02525395 0)') as geom) as foo1, generate_series(1,7281,1) as ser; and got: points --- POINT(3.46847273726137e-06 0) POINT(6.93694547452273e-06 0) POINT(1.04054182117841e-05 0) POINT(1.38738909490455e-05 0) POINT(1.73423636863068e-05 0) POINT(2.08108364235682e-05 0) POINT(2.42793091608296e-05 0) POINT(2.77477818980909e-05 0) ... ... but I tried to specify the row with where profile='20111220102834P-LF' but didnt work. The geom is wgs84 (SRID=4326) Also, is it possible to derive the longitude and latitude positions instead that only distances? Thanks in advance, Gery -- View this message in context: http://postgis.17.n6.nabble.com/Sampling-a-line-shapefile-based-on-own-criteria-tp3518606p3521745.html Sent from the PostGIS - User mailing list archive at Nabble.com. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] new functions
Am 09.01.2012 21:12, schrieb Mike Toews: Also another comment for your transrotate function: you can use 1 call to ST_Affine, rather than 3 indirect calls with st_rotate(st_translate(st_rotate(. You just need to wrangle the trigonometry in the affine transformation matrix correctly. I have an enhancement for a st_rotate with a point of origin in trac, where you can see how to use ST_Affine for this purpose: http://trac.osgeo.org/postgis/ticket/1251 -Mike Yes Mike, my transrotate function is a special case of an affine transformation. I have to consider the quadrants for the trigonometry calculation when i use st_affine. I will check it out. Thanks. Even if the form one after another shows exactly what happens, other than in the affine transformation. To the second comment with the point of origin: Nice to have it, but i think in my case its not necessary if rotating in one direction and than in the opposite with the same origin. But nevertheless, many thanks for the comments, nice conversation. Peter ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users