Tsolmongerel Orkhonselenge | 22 Aug 10:32 2014
Picon

Query for a point located in closed 3d polyhedral surface

Hi, PostGIS and SFCGAL users,
I have a closed 3D polyhedral surface. It is like exterior boundary of an anatomical feature. 

What is the best solution to query in PostGIS if a point is located within (or inside, or completely contained by) the boundary surface. 

I tried to use ST_3DIntersects. Obviously, result is empty because the feature is not solid.

The one way could be making my polyhedralsurface into solid. Is there a way to make a solid body in PostGIS. So, that I could use intersection.

Thanks a lot,
Tsolmon
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Timmons, Ryan P | 21 Aug 02:16 2014

Antipodal issues in upgrade

I'm having some trouble with an upgrade, following http://www.postgis.org/documentation/manual-svn/postgis_installation.html#hard_upgrade

Specifically I am going from Postgres 8.3.10, postgis "1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"   (given by
select postgis_version())
to Postgres 9.3.5, postgis "2.1 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"

When restoring I got this error:
ERROR:  Antipodal (180 degrees long) edge detected!
CONTEXT:  COPY voevents_general, line 15242, column hgc_bbox: "0103000020E610000001000000050000007ADFF8DA330165C000000000008056C05B087250C2EC274000000000008056C05B..."

Appears the entire table is unpopulated after that error.  From
http://trac.osgeo.org/postgis/ticket/1046 it seems the antipodal check was added between the
versions I'm transitioning between

Is there a function to find all rows in my old 1.5 version that will fail this check?  I don't see anything
obvious in http://postgis.net/docs/manual-1.5/ch08.html#PostGIS_GeographyFunctions .

Or, is there a way to have the upgrade script fail only the rows violating this condition?  ( I suspect it is a
small portion of the data, and not a useful field for the rows having this problem) .

Thanks,
Ryan

Ryan Timmons
Research Scientist, O/A014S
Control Systems & Information Sciences
Lockheed Martin SSC
Cell: 248-895-1935
DanielFranco | 20 Aug 23:00 2014
Picon

PostGIS Raster Performance

Hi, I'm a newbie in PostGIS Raster use and GIS applications, so this may be a
dumb question. I'm a little confused by some functionalities and I don't
know if it's possible to do what i'm trying to. Basically, I'm using postgis
functions either for raster and vector forms of an image and I'm trying to
visualize parts of the raster by using the informations presented only in
the shapefile. For example, I have an TIFF file of a land coverage (one
band) about 49746 x 71819 and it's shapefile with some grid codes. I'm doing
the following query to extract pixel values from an expecific gridcode (18)
presented in the shapefile imported (vector_table) so I could infer some
grid codes by the pixel value:

SELECT (gval).val as pixel_value
FROM 
( SELECT ST_DumpAsPolygons(ST_Clip(rast,1,geom)) as gval
from raster_table
join vector_table
on (st_intersects(rast,geom))
where geom in (select geom from vector_table where gridcode = 18)
) as intersection;

The query runs too slow and I don't know how to optimize it. The raster
image is big and I tried different tiles configurations (100x100, 200x200,
1000x1000) and 100x100 seemed to have better perfomance. I'm using st_clip
for a faster answer. I don't know if these pixels values would retrieve some
important information and if PostGIS raster is really suitable with area
calculations. Is there a way to optimize the query or postgis raster isn't
suitable for this case?

--
View this message in context: http://postgis.17.x6.nabble.com/PostGIS-Raster-Performance-tp5006902.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
Mohammed Kabeer | 20 Aug 11:37 2014

pointcloud extentions

Dear Sir,

 

I installed postgis with opengeosuit4. 1 (OpenGeoSuite-latest.exe) and created database and working fine

 

I run CREATE EXTENSION postgis: // working fine

 

But when I run CREATE EXTENSION pointcloud; // it gives me ERROR: could not open extension control file "C:/Program Files (x86)/Boundless/OpenGeo/bin/../pgsql/share/extension/pointcloud.control": No such file or directory

SQL state: 58P01

 

How to fix this problem

 

Thanks

Kabeer

 

Mohammed Kabeer Ahmed | Spatial Technologies| Tamimi Consulting Group|

Tel +966 1217 0152 | Mobile +966 545548353 | Skype: mkabeer2000
Riyadh, Saudi Arabia

 

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Tsolmongerel Orkhonselenge | 19 Aug 11:43 2014
Picon

ST_Within equivalent for TIN 3D

Dear PostGIS users,

I would like to query if a point is located in the TIN object. My TIN object is closed (convex hull) object (i.e. surface of a round object). I tried to use ST_Within, but the error message returns as: ERROR: Unknown geometry type: 15 - Tin
My query is as follows:
SELECT ST_Within(mypoint,mytinobject) As mypointinmytinobject
FROM (SELECT ST_GeomFromText('POINT(x,y,z)', SRID) As mypoint,
(SELECT geom FROM mytintable WHERE gid=1) As mytinobject ) As myobjects;

What are the equivalent 3D query functions like ST_Within for 3D TIN object in PostGIS?

Thanks in advance.
Tsolmon

_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Gery . | 16 Aug 14:50 2014
Picon

FW: json/json.h: No such file or directory

Hello,

I just received this after 'make' in version 2.1.3:

libtool: compile: gcc -g -O2 -DDLL_EXPORT -DPIC -Wall -Wmissing-prototypes -I/usr/local/include -c
lwin_geojson.c -DDLL_EXPORT -DPIC -o .libs/lwin_geojson.o
lwin_geojson.c:20:23: fatal error: json/json.h: No such file or directory
#include <json/json.h>
^
compilation terminated.
Makefile:156: recipe for target 'lwin_geojson.lo' failed
make[1]: *** [lwin_geojson.lo] Error 1
make[1]: Leaving directory '/opt/postgis/postgis-2.1.3/liblwgeom'
GNUmakefile:14: recipe for target 'all' failed
make: *** [all] Error 1

I read that this is a problem related to Geos 3.4.2. My configuration is:

-------------- Compiler Info -------------
C compiler: gcc -g -O2
C++ compiler: g++ -g -O2
SQL preprocessor: /usr/bin/cpp -w -traditional-cpp -P

-------------- Dependencies --------------
GEOS config: /usr/local/bin/geos-config
GEOS version: 3.4.2
GDAL config: /usr/local/bin/gdal-config
GDAL version: 1.11.0
PostgreSQL config: /usr/bin/pg_config
PostgreSQL version: PostgreSQL 9.3.5
PROJ4 version: 46
Libxml2 config: /usr/bin/xml2-config
Libxml2 version: 2.9.1
JSON-C support: yes
PostGIS debug level: 0
Perl: /usr/bin/perl

--------------- Extensions ---------------
PostGIS Raster: enabled
PostGIS Topology: enabled
SFCGAL support: disabled

-------- Documentation Generation --------
xsltproc: /usr/bin/xsltproc
xsl style sheets: /usr/share/sgml/docbook/xsl-stylesheets
dblatex: /usr/bin/dblatex
convert: /usr/bin/convert
mathml2.dtd: http://www.w3.org/Math/DTD/mathml2/mathml2.dtd

How can I circumvent this json/json.h problem and finish the installation of postgis?

Gery
 		 	   		  
Stephen Woodbridge | 14 Aug 23:40 2014

How to install on Amazon ec2 instance

Hi all,

I'm trying to setup an amazon ec2 instance with postgis using yum, but 
it does not seem to have postgis in their repos.

[ec2-user <at> ip-10-0-0-159 ~]$ uname -a
Linux ip-10-0-0-159 3.10.42-52.145.amzn1.x86_64 #1 SMP Tue Jun 10 
23:46:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[ec2-user <at> ip-10-0-0-159 ~]$ cat /etc/motd

        __|  __|_  )
        _|  (     /   Amazon Linux AMI
       ___|\___|___|

I would like to avoid building it from source.

I have installed:

sudo yum install postgresql9.x86_64 postgresql9-contrib.x86_64 
postgresql9-devel.x86_64 postgresql9-libs.x86_64 postgresql9-server.x86_64

Anyone know if there is a repository that is compatible with this? and 
how to configure the server to use it?

Thanks,
   -Steve
David Haynes | 13 Aug 15:37 2014
Picon

ST_AddBand

I have a question about this function, regarding the fifth variant.
Why does the function assume that all of the rasters input in the array have their information stored at the same band? The variant will only allow for 1 band number to be specified for all rasters.

raster ST_AddBand(raster torast, raster[] fromrasts, integer fromband=1, integer torastindex=at_end);

This is will not work

ST_AddBand(ST_MakeEmptyraster(layers.stack_rast),ARRAY[layers.stack_rast, layers.stack_rast], ARRAY[1,3]) as rast

This does, but assumes that I want band 1 both times.
ST_AddBand(ST_MakeEmptyraster(layers.stack_rast),ARRAY[layers.stack_rast, layers.stack_rast], 1) as rast

Shouldn't there be a variant that allows that uses an array integer that allows for you to individual specifications of bands.
_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Lauri Kajan | 12 Aug 08:52 2014
Picon

Points not in Polygons and 'jointype 5 not supported'

Hi all,

I'm trying to figure out an optimal query to find points in a table that are not in any polygons.
My points table contains 3,7 million points and 6000 polygons.

My goal is to find points from certain area that are not contained by polygons. Here is my current query:
  select
    id,
    geom
  from
   points
  where not exists(
    select * from polygons where st_contains(polygons.geom, points.geom)
  )
  and points.geom && 'BOX(425930 7197112, 429605.074 7200582.906)'::BOX2D;

I'm getting following notice from PostGIS:
NOTICE:  gserialized_gist_joinsel: jointype 5 not supported
What I have understood is that query works ok but the query plan might not be optimal.

Is there something to do to improve this?


Here is the explain analyze results:
"Nested Loop Anti Join  (cost=18.83..3356.77 rows=809 width=36) (actual time=3.986..438.047 rows=272 loops=1)"
"  ->  Bitmap Heap Scan on points  (cost=18.68..1540.86 rows=809 width=36) (actual time=0.724..2.955 rows=1452 loops=1)"
"        Recheck Cond: (geom && '010300000001000000050000000000000028FF1941000000006E745B410000000028FF19416DE7FBB9D1775B41F0A7C64B94381A416DE7FBB9D1775B41F0A7C64B94381A41000000006E745B410000000028FF1941000000006E745B41'::geometry)"
"        ->  Bitmap Index Scan on points_geom  (cost=0.00..18.48 rows=809 width=0) (actual time=0.699..0.699 rows=1452 loops=1)"
"              Index Cond: (geom && '010300000001000000050000000000000028FF1941000000006E745B410000000028FF19416DE7FBB9D1775B41F0A7C64B94381A416DE7FBB9D1775B41F0A7C64B94381A41000000006E745B410000000028FF1941000000006E745B41'::geometry)"
"  ->  Index Scan using polygons_geom on polygons  (cost=0.15..2.23 rows=1 width=4361) (actual time=0.296..0.296 rows=1 loops=1452)"
"        Index Cond: (geom && points.geom)"
"        Filter: _st_contains(geom, points.geom)"
"        Rows Removed by Filter: 0"
"Total runtime: 438.491 ms"


I appreciate all your help!

-Lauri


_______________________________________________
postgis-users mailing list
postgis-users <at> lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
Paragon Corporation | 9 Aug 01:23 2014
Picon

PostGIS 2.1 and PostgreSQL 9.3 on Ubuntu 14.0.4 (Trusty) with PostgreSQL apt Repo

I know some people were complaining on the list about being able to install
PostGIS on Ubuntu trusty.
I finally spun up a Trusty VM 64-bit and was able to successfully install
using Apt PostgreSQL repo.

I've updated the wiki instructions:

http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt

Hopefully this helps others.  Let me know if the updates don't work for you.

Thanks,
Regina
http://www.postgis.us
http://postgis.net
Paragon Corporation | 9 Aug 02:08 2014
Picon

PostGIS 2.1 and PostgreSQL 9.3 on Ubuntu 14.0.4 (Trusty) with PostgreSQL apt Repo

I know some people were complaining on the list about being able to install
PostGIS on Ubuntu trusty.
I finally spun up a Trusty VM 64-bit and was able to successfully install
using Apt PostgreSQL repo.

I've updated the wiki instructions:

http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt

Hopefully this helps others.  Let me know if the updates don't work for you.

Thanks,
Regina
http://www.postgis.us
http://postgis.net

Gmane