[postgis-users] IDW on vector points instead of raster?
Dear list, Many references to IDW use QGIS, GRASS or GDAL to create raster surfaces. However, what I am looking for is a PL/SQL function to calculate the values at points in a grid from irregularly spaced observation points using IDW: all in vector space. Has anyone created such a function before? Many thanks in advance. Kind regards, Edward ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] One-way replication from ArcGIS 10.0 or 10.1 to PostGIS?
Stefan, You may want to ping the people at GeoCat. Their ArcGIS plugin GeoCatBridge seems to be able to do just that... Hence, they may be able to give you some ideas how to go about doing this yourself. Kind regards, Edward > Date: Fri, 17 Aug 2012 08:17:14 +0200 > From: sfkel...@gmail.com > To: postgis-users@postgis.refractions.net > Subject: [postgis-users] One-way replication from ArcGIS 10.0 or 10.1 to > PostGIS? > > Does anyone have experiences with "one-way replication > parent-to-child" from ArcGIS Server/ArcSDE (versions 10.0 or 10.1) to > PostGIS database? > Seems to be a rather bulky thing thing since ArcGIS parent data need > to be versioned (at least with 10.0). > What I actually would need is simply a periodical snapshot copy from > ArcSDE Server db to a PostGIS db instance. > > Yours, S. > ___ > 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] distance from centroid to the points that form the outer boundary of the polygon
Hi there, How about calculating the MinimumBoundingCircle of your geometry first http://postgis.refractions.net/docs/ST_MinimumBoundingCircle.html. Once you have the circle, it shouldn't be too difficult to derive the radius from this? HTH Edward From: yaminijsi...@live.com To: postgis-users@postgis.refractions.net Date: Mon, 30 Jul 2012 15:04:15 +0200 Subject: [postgis-users] distance from centroid to the points that form the outer boundary of the polygon Hi All, I am looking for suggestions for the following problem I have at hand. 1. I have a table that contain multipolygons 2. I want to calculate the maximum distance of points that form the polygon from the centroid of the polygon. For example of the polygon is formed of 50 points then I want to have distance of all the 50 points from the centroid of the polygon. I am not sure if someone has done this before. But I am finding it difficult to implement it. Any help in this regards is welcome… Best,YJS ___ 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] Loading Many .shp file into one table
James, By default, shp2psql creates a new table for each Shape file. Setting the option -a, appends the Shape file to an already existing table. Check http://postgis.refractions.net/documentation/manual-1.5/ch04.html#shp2pgsql_usage. Regards, Edward Date: Wed, 13 Jun 2012 13:56:13 -0700 From: butler.jam...@gmail.com To: postgis-users@postgis.refractions.net Subject: [postgis-users] Loading Many .shp file into one table How do I put many shape files into 1 table? The PostGIS plug-in shape file uploader makes one seperate table each time it uploads a shape file. ___ 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] Select smoothed lines
Maybe Paul Ramsey's recent posting provides some inspiration: http://blog.opengeo.org/2012/01/27/getting-curvey/ Regards, Edward Date: Mon, 30 Jan 2012 14:50:46 +0100 From: r.pisp...@gmail.com To: postgis-users@postgis.refractions.net Subject: [postgis-users] Select smoothed lines Hi all, my database contains a lot of paths of storms. Each storm path is generated by joining the centroids of the storm at any moment of measurement. The result is sometimes a line with a lot of edge.Can you suggest me a method to select these lines a little bit smoothed. TIA Rocco ___ 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] Insert a point value : ST_GeometryFromText unknown function
Just to see what version of postgis and libraries you have available, execute the following query SELECT PostGIS_Full_Version(); see http://www.postgis.org/docs/PostGIS_Full_Version.html > Date: Tue, 3 Jan 2012 10:25:31 -0800 > From: jeremie.br...@efusia.net > To: postgis-users@postgis.refractions.net > Subject: [postgis-users] Insert a point value : ST_GeometryFromText unknown > function > > > Hello, > > I have a table "test" with 2 columns: > nom: text > localisation: point NULL > > I make this query: > > INSERT INTO "test" ("nom", "localisation") > VALUES ('myName', 'ST_GeometryFromText(POINT(2.5 49.0), 4326)'); > > But I have this error message: > > Error in query: ERROR: invalid input syntax for type point: > "ST_GeometryFromText(POINT(2.5559 49.0083), 4326)" > LINE 2: VALUES ('myName', 'ST_GeometryFromText(POINT(2.5 49.0), ... > > > If I edit the Point syntax, sometimes an error says "ST_GeometryFromText > does not exists"... > > Where am I wrong ? > May I have to enable some postGis functions ? > -- > View this message in context: > http://old.nabble.com/Insert-a-point-value-%3A-ST_GeometryFromText-unknown-function-tp33073860p33073860.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 ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] Question about st_difference
Ge, Instead of an ST_Union on the full Tbl_b table, merging all polygons into one big polygon, establish first which polygons in Tbl_b intersect the same polygon in Tbl_a. Your recipe then would be: 1. Append the id of the polygon in Tbl_a that intersects with a polygon in Tbl_b. 2. Perform an ST_Union only on those polygons in Tbl_b that have the same id from Tbl_a. 3. Perform the ST_Difference. Thus you will have more iterations in the ST_Difference step, but with smaller geometries. Hope that will allow you to deal with 7M+ records. Regards, Edward Date: Wed, 7 Sep 2011 23:48:14 -0700 From: gves2...@yahoo.com To: postgis-users@postgis.refractions.net Subject: Re: [postgis-users] Question about st_difference Hi Nicolas and Chris, Thanks for pointing me in the right direction. On a small scale it works great. Now the job is to implement it on tables with 7million records. Thanks again and kind regards, Ge From: Chris Hermansen To: PostGIS Users Discussion Sent: Wednesday, September 7, 2011 8:39 PM Subject: Re: [postgis-users] Question about st_difference In addition to Nicolas' suggestion, one thing that can work, for example when the goal is to "make holes" with one theme in another, is to st_union the two themes, then re-attribute, then delete the unwanted polygons. This has worked for me in relatively small datasets but I've never truly stress tested it. 2011/9/7 Nicolas Ribot > Hello Group, > > About st_difference I've seen several topics but unfortunately with none of > them I could solve my problem. > > What I want to do is subtract one layer from the other. I could simplify this > down to the following; > > Tbl_a contains 1 record > "POLYGON(((168119.443682473 451093.811197312,197555.469699649 > 451093.811197312,197555.469699649 437539.54805452,168119.443682473 > 437539.54805452,168119.443682473 437539.54805452,168119.443682473 > 451093.811197312)))" > > Tbl_b contains 2 records of which both intersects with the object in tbl_a > > "POLYGON(((171424.484910418 453680.34544058,171424.484910418 > 435697.56759188,174568.140889894 435697.56759188,174568.140889894 > 453680.34544058,174568.140889894 453680.34544058,171424.484910418 > 453680.34544058)))" > > "POLYGON(((184904.90800885 453627.063135843,184904.90800885 > 435644.285287143,188048.563988327 435644.285287143,188048.563988327 > 453627.063135843,188048.563988327 453627.063135843,184904.90800885 > 453627.063135843)))" > > The result I'm looking for is the object of tbl_a abstracted with both > objects from tbl_b, since they are both intersecting. In this example the > result should be 3 squares since it is cut twice by tbl_b. > > > Does anyone know a solution for this? > > Many thanks in advance, > > Ge Hi Ge, You may want to union objects in table B to create a single polygon, then perfom the difference: select st_difference(a.geom, b.geom) from (select 'POLYGON((168119.443682473 451093.811197312,197555.469699649 451093.811197312,197555.469699649 437539.54805452,168119.443682473 437539.54805452,168119.443682473 437539.54805452,168119.443682473 451093.811197312))'::geometry as geom) as a, ( select st_union(geom) as geom from ( select 'POLYGON((171424.484910418 453680.34544058,171424.484910418 435697.56759188,174568.140889894 435697.56759188,174568.140889894 453680.34544058,174568.140889894 453680.34544058,171424.484910418 453680.34544058))'::geometry as geom UNION select 'POLYGON((184904.90800885 453627.063135843,184904.90800885 435644.285287143,188048.563988327 435644.285287143,188048.563988327 453627.063135843,188048.563988327 453627.063135843,184904.90800885 453627.063135843))'::geometry as geom ) as foo ) as b; (see attached pictures) Nicolas ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users -- Chris Hermansen Vice President TECO Natural Resource Group Limited301 · 958 West 8th Avenue Vancouver BC CANADA · V5Z 1E5Tel +1.604.714.2878 · Cel +1.778.840.4625 ___ 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 <>___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] how to keep geometry_columns in sync with tables and views
Hi Ge, You may want to check Probe_Geometry_Columns (http://postgis.refractions.net/docs/Probe_Geometry_Columns.html). Kind regards, Edward Date: Wed, 18 May 2011 04:38:51 -0700 From: gves2...@yahoo.com To: postgis-users@postgis.refractions.net Subject: [postgis-users] how to keep geometry_columns in sync with tables and views Hi All, We have a lot of tables and views updated, or better said, replaced on a daily basis. We have seen that under certain conditions (which are unclear) entries of the geometry_columns table are removed. So a mismatch occurs so now and then resulting in showing either no data or being very slow when an application has to do a table scan to obtain the geometry type. What I like to have is a procedure which checks all tables and views against the geometry_columns table and makes if necessary the right corrections. Before inventing the wheel again, does anyone know if this procedure already exist or knows perhaps another/better way to achieve this? Thanks in advance, Ge ___ 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] Trying to import natural earth data into
Thread @ natural earth data forum: http://www.naturalearthdata.com/forums/topic.php?id=81 E > Date: Fri, 7 Jan 2011 09:03:44 -0600 > From: david.fawc...@gmail.com > To: postgis-users@postgis.refractions.net > Subject: Re: [postgis-users] Trying to import natural earth data into > > Since it looks like there is a significant problem with the Natural > Earth data and many people are attempting to clean the data up in > parallel, has anyone approached the Natural Earth folks and made them > aware of the problem so they can hopefully fix the source data? > > David. > > On Fri, Jan 7, 2011 at 12:51 AM, Brian Hamlin wrote: > > regarding GRASS and PostGIS on Natural Earth vectors > > > > unfortunately, it seems that a v.in.ogr / v.out.ogr round trip > > does *not* clean the vectors completely, as tested by st_isValid() > > > > -- > > GRASS trunk (7) > > PostGIS 1.5.3 > > current Natural Earth shp files, > > > > tested table: 10m_urban_areas > > 12,022 polys > > > > st_isValid() shows 31 errors > > self-intersection and ring self-intersection > > > > PostGIS ST_Buffer(0) creates output > > that is clean of these errors, according to PostGIS > > > > GRASS 7 v.in.ogr / v.out.ogr creates output > > that still has 14 polys with "ring self-intersection" > > according to PostGIS > > - > > > > ps - > > this is true with or without benefit of the mighty "for" loop > > > > best regards > > -Brian > > > > == > > Brian Hamlin > > planetwork.net > > OSGeo California Chapter > > (415) 717-4462 cell > > > > ___ > > 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 ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] help setting up postgis
Simply check the proper location of the postgis.sql file. It should be in the directory where you installed postgis. $ sudo updatedb $ locate "postgis.sql" /usr/src/postgis-1.5.1/postgis/postgis.sql psql -d postgisdb -f /usr/src/postgis-1.5.1/postgis/postgis.sql HTH Edward > Date: Mon, 9 Aug 2010 13:43:16 +0200 > From: f...@dubmosphere.de > To: postgis-users@postgis.refractions.net > Subject: [postgis-users] help setting up postgis > > Dear all, > I am running into some troubles trying to install postgis 1.5.1. After > installation I followed the manual on which first steps to take. I > created a postgresql db and did the createlang part. > > Now, when I enter "psql -d postgisdb -f postgis.sql" I get a > "postgis.sql: No such file or directory" in return. > > What could be the problem? Where do I start looking? > > Regards, > Jan > > ubuntu 9.10 > postgresql 8.4 > postGis 1.5.1 > > > ___ > 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] Help in Defending FOSS SDI
Please feel free to provide your management with the technical design document for the SDI in the Netherlands. http://www.geonovum.nl/sites/default/files/MOT_20100618_TechnicalDesign_v1.01.pdf The document is in English, so you don't have to brush off your Dutch language skills. Also read Paul Ramsey's take on the document: http://blog.opengeo.org/2010/07/08/tulips-pancakes-and-open-source-mapping/ Kind regards, Edward Date: Sun, 1 Aug 2010 15:31:10 -0700 From: ravivundava...@yahoo.com To: grassu...@grass.itc.it; grass-u...@lists.osgeo.org; postgis-users@postgis.refractions.net Subject: [postgis-users] Help in Defending FOSS SDI Some so called SDI experts feel that FOSS SDI cannot perform at-par with Proprietary SDI. Please provide examples to fight a case from an Indian state which swears by Free and Open Source Software. We can never expect a better level playing field. Kerala - India Here are some excerpts from a document that has false claims supporting Proprietary Software. However, it is worthwhile to mention here that the OSS (Open Source Software) does not match the advanced functionalities of many of the commercial (proprietory) software that is in the market. Image processing and analysis capabilities of the open source software is not comparable to the commercial software when one require to carry out advanced data manipulations, image fusion, 3D modeling, ortho-correction, auto-georeferencing, stereo-image/air photo interpretation (PROBABLY REFERRING TO GRASS), advanced geospatial analysis etc., In such cases, certain proprietary software become an integral part of the Spatial Data Infrastructures, which can not be avoided. At a later stage the some of the proprietary software need to be purchased. It is a well known fact that web portal that run with OSS are neither OGC-compliant norinteroperable(PostGIS and Webservers to react). At the present juncture it is only possible to establish the KSDI Geoportalwith the available COTS enterprise software. The detailed PDF document will be emailed on demand. This is a case that has the potential to set trends in India. Hope to have a good discussion such that we can sum it up and present at a meeting being conducted on August 11th 2010, to settle the issue. Ravi Kumar ___ 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] Polygon to line
Hi Ricardo, Having been through the mailing list's archives myself over the last few weeks, i came up with the following recipe: First you dump all multipolygons into polygons: SELECT (ST_Dump(the_geom)).geom AS the_geom INTO polygon_table FROM multipolygon_table and create an index on that one CREATE INDEX geo_idx_polygon_temp ON polygon_table_temp USING GIST (the_geom); VACUUM ANALYZE polygon_table_temp; then you create a new table that contains the borders using ST_Intersection: CREATE TABLE borders AS SELECT ST_Intersection(t1.the_geom,t2.the_geom) AS the_geom FROM polygon_table_temp AS t1, polygon_table_temp AS t2 WHERE t1.the_geom && t2.the_geom; These borders are duplicated, as the intersection is computed twice (A intersects B and B intersects A). Also contains records of geometry other than multilinestring DELETE FROM borders WHERE GeometryType(the_geom) <> 'MULTILINESTRING'::text; SELECT Populate_Geometry_Columns('borders'::regclass); ALTER TABLE borders ADD COLUMN gid SERIAL; ALTER TABLE borders ADD PRIMARY KEY (gid); CREATE INDEX geo_idx_borders ON borders USING GIST (the_geom); VACUUM ANALYZE borders; so remove duplicates: DELETE FROM borders WHERE borders.gid < (SELECT MAX(b.gid ) FROM borders b WHERE b.the_geom && borders.the_geom AND ST_Equals(borders.the_geom, b.the_geom)); REINDEX TABLE borders; VACUUM ANALYZE borders; That should do it. Thanks to previous postings to this mailing list! regards, Edward Date: Thu, 24 Jun 2010 16:53:54 -0300 From: vilella.rica...@gmail.com To: postgis-users@postgis.refractions.net Subject: [postgis-users] Polygon to line Hi all, is the first time I use the list. I have a polygon that represent a country, if i want extract only the sides that touch with other polygon. How i have to do? The result should be a MultiLineString or a LineString representing the limits of the country but without the coast line if it has one. I tried with ST_Touches but i can't get it work. ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] using "&&" oprerator
___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] steps in creating a new database
Cristian, In PostGres, you can set up a new database scheme using a particular template. For spatial databases, you can create a template, so you don't have to add the postgis extensions or spatial reference systems each time you create a new spatial database. So you first create a new template for spatial databases that we call "template_postgis". createdb template_postgis $ createlang plpgsql template_postgis (plpgsql provides the functionality to use the spatial extensions) $ psql -d template_postgis -f postgis/postgis.sql $ psql -d template_postgis -f spatial_ref_sys.sql (contains the parameters of the various spatial reference systems, describing the projections and coordinate systems) Next you grant the appropriate actions to the user "postgres". $ psql -d template_postgis # grant select, update, insert, delete on table geometry_columns to postgres; # grant select on table spatial_ref_sys to postgres; #\q Since you do not want each database to be owned by postgres (just as you wouldn't want every directory in your file system to be owned by root), let's create a new user "gisuser": $ createuser gisuser -P Finally, you create your spatial database "gisdb" that is owned by the new user "gisuser". For this, you simply use the template that you created earlier "template_postgis". So, you create your template once and re-use every time you create a new spatial database, gisdb1, gisdb2, gisdb3 or a more explanatory database name. $ createdb -T template_postgis -E UTF8 -O gisuser gisdb Hope this helps. Edward Date: Fri, 9 Apr 2010 12:10:47 +0200 From: vasilees...@gmail.com To: postgis-users@postgis.refractions.net Subject: [postgis-users] steps in creating a new database Hi all, I try to create a new postgis database on Ubuntu, and I'm quite confused about the steps in creating a database. Creating database: # createdb -T [template] [name_of_the_database] - what are the use [-T] and [template] in this line - I can create my own template? for example: # createdb -T [general_data] [world] Adding plpsql language to the database: # createlang plpgsql [database] # psql -d [database] -f /usr/share/postgresql/8.4/contrib/postgis.sql # psql -d [database] -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql # psql -d [database] -c"select postgis_lib_version();" - is plpgsql a condition in creating a geodatabase - what's happening if I don't add this line # psql -d [database] -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql - This are the complete steps in creating a spatial database? - Where i can find more information regarding this subject? Thank you, Cristian ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users