Re: [postgis-users] PostGIS 2.1.1 Released
Hi, RPMs are available for PostgreSQL 9.2 and 9.3 (since Friday) at http://yum.postgresql.org Regards, Devrim On Fri, 2013-11-08 at 12:12 -0800, Paul Ramsey wrote: Get it while it's hot! http://download.osgeo.org/postgis/source/postgis-2.1.1.tar.gz * Important Changes * - #2514, Change raster license from GPL v3+ to v2+, allowing distribution of PostGIS Extension as GPLv2. * Bug Fixes * - #2396, Make regression tests more endian-agnostic - #2434, Fix ST_Intersection(geog,geog) regression in rare cases - #2454, Fix behavior of ST_PixelAsXXX functions regarding exclude_nodata_value parameter - #2449, Fix potential infinite loop in index building - #2489, Fix upgrades from 2.0 leaving stale function signatures - #2493, Fix behavior of ST_DumpValues when passed an empty raster - #2502, Fix postgis_topology_scripts_installed() install schema - #2504, Fix segfault on bogus pgsql2shp call - #2512, Support for foreign tables and materialized views in raster_columns and raster_overviews - #2525, Fix handling of SRID in nested collections - #2528, Fix memory leak in ST_Split / lwline_split_by_line - #2532, Add missing raster/geometry commutator operators - #2533, Remove duplicated signatures * Enhancements * - #2463, support for exact length calculations on arc geometries - #2478, support for tiger 2013 - #2527, Added -k flag to raster2pgsql to skip checking that band is NODATA -- Devrim GÜNDÜZ Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz signature.asc Description: This is a digitally signed message part ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
[postgis-users] Grid of points inside Polygon
Hi all, Would appreciate some advice on the best way to accomplish this please. Our situation is that we have a single polygon which has been created by buffering all of the major roads in the UK. Projection is OSGB36 (27700). Obviously it's quite a big polygon. -- SELECT st_area(geom) FROM roadbufferunion; st_area -- 77228753220.8271 What we now want to do is create a regular grid of 20 metre x 20 metre points instead the polygon area. So we wrote this function (based on some googling, apologies for not being able to recall the exact person who originally wrote it): CREATE OR REPLACE FUNCTION makegrid(geometry, integer, integer) RETURNS geometry AS 'SELECT ST_Collect(st_setsrid(ST_POINT(x,y),$3)) FROM generate_series(53320::int, 667380::int,$2) as x ,generate_series(7780::int, 1226580::int,$2) as y where st_intersects($1,st_setsrid(ST_POINT(x,y),$3))' LANGUAGE sql and we then run this by doing the following: SELECT st_x((ST_Dump(makegrid(geom, 20, 27700))).geom) as x, st_y((ST_Dump(makegrid(geom, 20, 27700))).geom) as y INTO grid_points from roadbufferunion; However after over 2 days of the query running on a pretty powerful linux cluster, we still have no result. I'm not sure if it is actually running or not to be honest. Does the query look right? Any ideas how we can make it run quicker? Thanks James ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Re: [postgis-users] How to create user-defined C function using a postgis C function
Hello Sandro, thank you for your answer. For testing I wrote another main() class: --- start main.c --- int main() { test(0,0); return 0; } --- end main.c --- and compiled cc -I/usr/include/pgsql/server -fpic -shared -o libtest.so test.c cc -llwgeom -ltest main.c -o main -L. -L/usr/lib64 In /usr/lib64 the liblwgeom.so is located (a liblwgeom.a I cannot find). Now the original error is resolved, but now I get /usr/lib64/liblwgeom.so: undefined reference to `lwgeom_init_allocators' Any ideas how to resolve this? /Peter Gesendet: Sonntag, 10. November 2013 um 20:57 Uhr Von: Sandro Santilli s...@keybit.net An: PostGIS Users Discussion postgis-users@lists.osgeo.org Betreff: Re: [postgis-users] How to create user-defined C function using a postgis C function On Sat, Nov 09, 2013 at 01:33:57PM +0100, Peter Tolkewitz wrote: cc -I/usr/include/pgsql/server -fpic -c test.c cc -shared -o test.so test.o [..] ...complains with undefined symbol lwgeom_clone_deep Add an -llwgeom line to your cc invocation, or add full path to liblwgeom.a for static linking (preferred by some) --strk; ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Re: [postgis-users] How to create user-defined C function using a postgis C function
On Mon, Nov 11, 2013 at 12:27:17PM +0100, Peter Tolkewitz wrote: Hello Sandro, thank you for your answer. For testing I wrote another main() class: --- start main.c --- int main() { test(0,0); return 0; } --- end main.c --- and compiled cc -I/usr/include/pgsql/server -fpic -shared -o libtest.so test.c cc -llwgeom -ltest main.c -o main -L. -L/usr/lib64 In /usr/lib64 the liblwgeom.so is located (a liblwgeom.a I cannot find). Now the original error is resolved, but now I get /usr/lib64/liblwgeom.so: undefined reference to `lwgeom_init_allocators' Any ideas how to resolve this? As of PostGIS 2.0.x you need to provide that function in your own library, if you switch to PostGIS 2.1.x you'll have a different requirement, due to: - #2089, liblwgeom: lwgeom_set_handlers replaces lwgeom_init_allocators. --strk; ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Re: [postgis-users] Grid of points inside Polygon
Hey, the whole point on using a sgbds like postgis is using index. If you have one line you don't use indexes... So in short, don't make one polygon with a buffer of all the road, but a table with a line for the buffer for every road, then do you computation to create grid of points inside of polygons, then union the result of points! And it s always a bad idea to run a function on big data when you have not tested it fully (including scaling behavior) on small data. Cheers Rémi-C 2013/11/11 James David Smith james.david.sm...@gmail.com Hi all, Would appreciate some advice on the best way to accomplish this please. Our situation is that we have a single polygon which has been created by buffering all of the major roads in the UK. Projection is OSGB36 (27700). Obviously it's quite a big polygon. -- SELECT st_area(geom) FROM roadbufferunion; st_area -- 77228753220.8271 What we now want to do is create a regular grid of 20 metre x 20 metre points instead the polygon area. So we wrote this function (based on some googling, apologies for not being able to recall the exact person who originally wrote it): CREATE OR REPLACE FUNCTION makegrid(geometry, integer, integer) RETURNS geometry AS 'SELECT ST_Collect(st_setsrid(ST_POINT(x,y),$3)) FROM generate_series(53320::int, 667380::int,$2) as x ,generate_series(7780::int, 1226580::int,$2) as y where st_intersects($1,st_setsrid(ST_POINT(x,y),$3))' LANGUAGE sql and we then run this by doing the following: SELECT st_x((ST_Dump(makegrid(geom, 20, 27700))).geom) as x, st_y((ST_Dump(makegrid(geom, 20, 27700))).geom) as y INTO grid_points from roadbufferunion; However after over 2 days of the query running on a pretty powerful linux cluster, we still have no result. I'm not sure if it is actually running or not to be honest. Does the query look right? Any ideas how we can make it run quicker? Thanks James ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users